You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an API that works like the following (names changed to protect the innocent):
GET /fruits/1.json => {"apple": {"id": 1}} GET /fruits/2.json => {"orange": {"id": 2}}
This is from a Rails app that has uses ActiveRecord::Inheritance to store multiple related types in a single table and include_root_in_json to return the types in the API.
The only way I see to handle this in Her (haven't implemented it) is to implement custom middleware that parses the JSON, stores the type in metadata (which doesn't seem very well documented), and reverses the process when doing requests.
Is there a better way to do this in Her that I'm not seeing?
The text was updated successfully, but these errors were encountered:
The only way I see to handle this in Her (haven't implemented it) is to
implement custom middleware that parses the JSON, stores the type in
metadata (which doesn't seem very well documented), and reverses the
process when doing requests.
Is there a better way to do this in Her that I'm not seeing?
—
Reply to this email directly or view it on GitHub #379.
I have an API that works like the following (names changed to protect the innocent):
GET /fruits/1.json
=>{"apple": {"id": 1}}
GET /fruits/2.json
=>{"orange": {"id": 2}}
This is from a Rails app that has uses
ActiveRecord::Inheritance
to store multiple related types in a single table andinclude_root_in_json
to return the types in the API.The only way I see to handle this in Her (haven't implemented it) is to implement custom middleware that parses the JSON, stores the type in metadata (which doesn't seem very well documented), and reverses the process when doing requests.
Is there a better way to do this in Her that I'm not seeing?
The text was updated successfully, but these errors were encountered: