JSON API raw response
I have a json API route to an action that returns a raw binary which is already gzipped in advance with
:zlib.gzip()
. But Ash JSON API tries to encode it with Jason and raises an error.
How do I tell it to return the raw response as is?3 Replies
You will either need to write your own controller to make that happen or modify ash_json_api to support some kind of "raw response" option for generic action routes
Should I then modify the generated OpenAPI schema to include my custom route?
I wanted to go through the route to automatically get policies enforcement and all that tbh
That's the beauty of Ash
You can still get all that
Yes you'd need to modify the open api schema
But your controller would just call your Ash action
And you'd still get policy enforcement etc.
Adding a raw response mode for generic actions probably wouldn't be too hard FWIW