RESTful API – Designing sub-resources

Both approaches can be considered RESTful, provided you do not break the REST constraints defined in the chapter 5 of Roy Thomas Fielding’s dissertation: Client-server Stateless Cache Uniform interface Layered system Code-on-demand I cannot see major pitfalls in both approaches, but I would prefer the Approach B over the Approach A: the URLs are shorter, … Read more

Swagger UI passing authentication token to API call in header

@ApiImplicitParams and @ApiImplicitParam should do the trick: @GET @Produces(“application/json”) @ApiImplicitParams({ @ApiImplicitParam(name = “Authorization”, value = “Authorization token”, required = true, dataType = “string”, paramType = “header”) }) public String getUser(@PathParam(“username”) String userName) { … } From the documentation: You may wish you describe operation parameters manually. This can be for various reasons, for example: Using … Read more

OpenID Connect Authentication Flow (using KeyCloak) in a Mobile App + REST Backend

I believe Resource Owner Credentials flow should be avoided unless really needed AND the client app and environment are under your own full control. You may have full control over the app but you cannot control the phone OS (security updates, …) This blog post goes over the various problems. I do not fully agree … Read more

GitHub API v4: How can I traverse with pagination? (GraphQL)

According to graphql documentation there are more than one pagination model. GitHub is using complete connection model In this model you can traverse with adding after:”Y3Vyc29yOjEwMA==” to your search query. query { search(first: 100, after:”Y3Vyc29yOjEwMA==”, type:USER, query:”location:usa repos:>0 language:java”) { pageInfo { startCursor hasNextPage endCursor } userCount nodes { … on User { bio company … Read more

GraphQL or REST [closed]

This question is primarily opinion-based. But from my experience: Multiple requests on a RESTful-API for just one thing often indicates a lack in the API design, namely the needed resource was not available and therefore stuff needs to be gathered from different resources to compensate for this. A REST-API that could be easily replaced by … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)