Skip to content

Commit

Permalink
Add HTTP caching and DTOs to style guide
Browse files Browse the repository at this point in the history
Cross reference to performance docs. If HTTP caching is being implemented, need to check and potentially fix DTOs.
  • Loading branch information
chunky56 committed Apr 25, 2018
1 parent f7592bc commit 57da961
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions STYLE-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ taken to design the endpoints in a way that makes sense for clients. Examples:
* When giving names to resources in the APIs, if it is a UUID, its name should have a suffix of "Id"
to show that. (e.g. `/api/users/{userId}/fulfillmentFacilities` has query parameter `rightId` to get
by right UUID.)
* If you are implementing [HTTP caching](http://docs.openlmis.org/en/latest/conventions/performanceTips.html#e-tag-and-if-none-match)
for an API and the response is a DTO, make sure the DTO implements equals() and hashCode() using
all its exposed properties. This is because of potential confusion of a property change without a
change of ETag.

We use RAML (0.8) to document our RESTful APIs, which are then converted into HTML for static API
documentation or Swagger UI for live documentation. Some guidelines for defining APIs in RAML:
Expand Down

0 comments on commit 57da961

Please sign in to comment.