According to some JSON API specifciations, such as http://jsonapi.org/format/#urls-individual-resources, the server should interpret a GET request to /myResources/1,2,3,4,5.
Right now the Sails.js router sends this to the findOne
action.
What is the best way to get this to be handled properly?
I think ideally the router should interpret /1,2,3,4,5
in the same way it would interpret ?ids[1,2,3,4,5]
, but I realize this may not be trivial.
Another option is to add a policy to all findOne
requests to check if req.params('id')
has commas and then reformat the list of ids to a query string and then redirect to find
(would this work?). Kind of annoying to add the policy to every controller.
Thoughts?