-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Backend] Remove Response Envelopes #1245
Comments
Hello @JakeIsMeh I would like to work on this but I am new in open source contribution, so can you please help me ? Thanks |
Hello, @JakeIsMeh As I'm currently refactoring the Angular repo, i share your thoughts. I have been thinking about that for a while, about which path to follow (envelopes as a standard versus only for response with extra metadata like pagination), and by experimenting with it directly, keeping it as a standard adds complexity everywhere. @Aakash017 This will be part of the new versions of the specs (as it would introduce a breaking change). I need to clean up the old v2 branch as there were a lot of changes on the main branch. Once done, I'll tag you for the contribution opportunity. I should be able to setup it up for this weekend. |
sure @geromegrignon Thanks for the update |
@JakeIsMeh sorry I forgot about the project versions: the v2 has not been released yet. |
About open-source contribution, you can rely on the CONTRIBUTING file. About the changes themselves, here are the affected parts:
There are some other affected parts but not ready for v2:
Please tell me which parts you want to work on, and don't hesitate if you need support. |
Currently, the spec (both v1 & v2) call for all responses (and requests) to be enveloped in an object describing the resource.
This is not only redundant as the URI should indicate the resource that the endpoint receives and/or returns, but also an annoyance if you are trying to strongly type responses instead of constructing your response in an anonymous object.
For example, if I'm using ASP.NET Core, I might write something like this without enveloping:
However, due to the enveloping requirements, a wrapper type has to be created:
While not hard to do, it creates a useless type for each endpoint that returns a singular resource.
Note that this only applies to singular resources. For endpoints that return a list of resources, it is understandable that for pagination purposes that it comes in an envelope containing pagination metadata.
The text was updated successfully, but these errors were encountered: