Open isaackearl opened 2 years ago
Do you have an example? I'm not sure what your suggesting would fit the https://jsonapi.org/ spec that this package is written around.
Yeah would be good to get an example. The major problem with having an endpoint that returns multiple resources is how you handle query parameters - i.e. include paths, sorting, etc. As you wouldn't know what e.g. include paths refer to which resource.
@BenWalters makes a good point that the purpose of this package is to implement the specification. I don't think (but might be wrong) multi-resource endpoints are covered by the spec. However, JSON:API 1.1 will add in profiles and extensions, so this kind of thing could be covered by a profile or extension.
Need some concrete examples though to fully understand the use case and flesh it out in a way that would work for any application.
Hello!
My team started using this package for a mobile application and it is very nice (thank you). One feature that would be really nice would be to make it possible to query multiple non-related resources in a single api call and get all the data back at one time (rather than making multiple requests to various api endpoints and getting back individual responses). We end up making quite alot of custom endpoints where we manually send back the data we want for a given interface in our apps so that we can avoid multiple round trips to the api. Anyway, this is just a suggestion that I hope is considered for the future. Thanks!