REST API best naming conventions for resources/endpoints to guarantee maintainability -


usually happens when creating new microservice api lasts couple of months before refactored.

i trying create microservice placed on microservice environment , have questions regarding rest apis better scalability , maintainability:

  • resources (resourcex) does not belong specific microservice responsibility/domain exists on environment , crucial (parameter) of endpoint should considered resource , exists on endpoint?

example: have microservice content recommendation , have users on system. recommendation microservice not handles users, uses parameters recommend content. endpoint recommend cars based on specific user should this? /user/{id}/cars/scores or should put query param, or this?

  • how retrieve specific fields (like lazy loading) given complex resources? resources collections (composed resources, car has array of doors), how should write endpoints it?

example 1: okay have 'partial get' based on parameters? best way accomplish that? get /resourcex/{id}/cars/{id}?params=doorsqty,color,owner or get /resourcex/{id}/cars/{id}?mode=compact or get /resourcex/{id}/cars/{id}/justwhatiwant.

example 2: endpoint retrieve doors car, should that? get /resourcex/{id}/cars/{id}/doors


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -