Adding custom routes with AshJsonApi
Is it possible to add custom routes like:
Looks like you can do something similar with relationships, but is there a way to expose additional actions on the resource?
This is related to the many issues on JSON:API, but most of these have to do with discoverability; the spec is fairly wide-open when it comes to adding additional routes in general.
https://github.com/json-api/json-api/issues/745
https://github.com/json-api/json-api/issues/684
https://github.com/json-api/json-api/issues/773
https://github.com/json-api/json-api/pull/1268
https://github.com/json-api/json-api/pull/1254
5 Replies
Bump
Sorry, didn't see this 🙂
I'm not exactly sure I understand the question though
You can add as many route as you want, connected to as many actions as you want
Maybe I'm just not locking down the syntax for it. I tried a couple of ways including as above but it doesn't seem to be happy. Is the way to go to add additional
routes
blocks with different base
s?
Something like that is what you'd want
you can only have one base
multiple route blocks won't work
In fact if you did
The second
base
would overwrite the firstYeah, that was my understanding actually, that it would behave like all the other transformers and merge the
route
blocks together. Great, that's the missing piece of the syntax though!
Do you mind approving the workflow for https://github.com/ash-project/ash/pull/528 ? Overlaps with the PR we talked about.