Skip to content
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

About the SHOULD contain a array business :) #28

Closed
mackelito opened this issue Feb 21, 2017 · 3 comments
Closed

About the SHOULD contain a array business :) #28

mackelito opened this issue Feb 21, 2017 · 3 comments

Comments

@mackelito
Copy link

Most of the API´s I have been using lately all deliver a json object at the top level
Readning here: http://jsonapi.org/format/#fetching
we can see the following statement:

A JSON object MUST be at the root of every JSON API request and response containing data. This object defines a document’s “top level”.

But when using restangular it states that it should be an array.. why is that?
I´m not saying that this is wrong.. just want to understand why.

Note: I already use RestangularProvider.addResponseInterceptor to handle this for me so I have no real issue.

@logvinoleg89
Copy link
Collaborator

Hi @mackelito, this is the restangular "inheritance" and there were no reasons to change it.

@mackelito
Copy link
Author

@logvinoleg89 do you know the reasoning behind it? Why it was decided to do it this way?
Perhaps we should revise it and see if it should be changed to match jsonapi?

@logvinoleg89
Copy link
Collaborator

Hi @mackelito, we have considered this but it can be performed not earlier than in the next ng2-restangular version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants