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
Is your feature request related to a problem? Please describe.
When returning data from an API call, we usually unwrap the single field that might be returned by the API. Sometimes we return a Response wrapper including the different fields returned by the API.
This makes our API a bit inconsistent, and not future-proof: if a new field is added to the response, we usually have to implement a new method to return the new desired fields inside a wrapper class.
#181 is an example where we have to implement some dirty work around to provide the missing field.
Describe the solution you'd like
Make the return object consistent with the API response, and ensure we wrap all the returned fields in an object where it makes sense.
Feature Request
Is your feature request related to a problem? Please describe.
When returning data from an API call, we usually unwrap the single field that might be returned by the API. Sometimes we return a Response wrapper including the different fields returned by the API.
This makes our API a bit inconsistent, and not future-proof: if a new field is added to the response, we usually have to implement a new method to return the new desired fields inside a wrapper class.
#181 is an example where we have to implement some dirty work around to provide the missing field.
Describe the solution you'd like
Make the return object consistent with the API response, and ensure we wrap all the returned fields in an object where it makes sense.
If the API returns:
{ "action": {} }
we return a class with an action field:
Adding a new field should be easy
Teachability, Documentation, Adoption, Migration Strategy
I wonder how this can be solved without asking too much effort to users, as this would be a decent amount of work.
Maybe using the trick with the
return_response
argument in #276 can solve this ?The text was updated successfully, but these errors were encountered: