Thanks to the HTML doc of our interfaces, I could easily browse through most of the endpoints written to date. I see a query pattern that goes against the style guide. Many entities specify a /search path, but instead of using query parameters, use very specific endpoints. For example, the /orders resource has endpoints like:
/orders/csv/{id}/search/findBySupplyingFacility
/orders/csv/{id}/search/findBySupplyingFacilityAndRequestingFacility
/orders/csv/{id}/search/findBySupplyingFacilityAndProgram
/orders/csv/{id}/search/findBySupplyingFacilityAndRequestingFacilityAndProgram
The requisitions resource, however, has a single /search endpoint that takes a number of parameters. This is the method specified in the style guide.
Unless there is a specific need, all new APIs should prefer search parameters. Each parameter should have documentation (Is it an integer? UTC date? UUID? String? Are wildcards supported? Is it required?).
I have a few more questions on how sorting and paging are handled, but haven’t had the chance to look deeper. I would like to hear from the team and tech leads on specifics we should adhere to, and put into the style guide.
Rich
--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openlmis-dev...@googlegroups.com.
To post to this group, send email to openlm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/BN1PR02MB021CBDE8445A62BBEE5446A930F0%40BN1PR02MB021.namprd02.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
Hi Sebastian,
OLMIS-872 sounds good. Whoever grabs it should post a list of the decremented endpoints and proposed query parameter list (I’ll add that to the story). This is important as we’re also continuing with test automation, so we don’t want to automate endpoints that are going away.
I like the idea of some boilerplate solution for paging/sorting on MVC endpoints. Yes, please create an issue for it. IMO, any resource that would be exposed via UI should support sorting and pagination.
Thanks – Rich
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/579A2053.90502%40soldevelo.com.
Thanks Szymon. That list looks good to me. I’m sure we’ll add to the query parameter lists as we continue building domain and UI.
Do string parameters support any special or wildcard characters? I think we will want this eventually, but have to take some care in implementing it (e.g. to prevent runaway queries, SQL injection, etc.).
Rich
--
You received this message because you are subscribed to the Google Groups "OpenLMIS Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
openlmis-dev...@googlegroups.com.
To post to this group, send email to
openlm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openlmis-dev/af2cf6a8-ef3a-423f-a0e3-646e34afee68%40googlegroups.com.
To post to this group, send email to openl...@googlegroups.com.