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

POST and PUT request not using attributes #36

Open
parampal opened this issue Oct 8, 2015 · 1 comment
Open

POST and PUT request not using attributes #36

parampal opened this issue Oct 8, 2015 · 1 comment

Comments

@parampal
Copy link

parampal commented Oct 8, 2015

I just wanted to double check how a typical POST/PUT request should look like for this lib to work.

It seems you don't expect the attributes to be placed within the attributes element like below. Instead you expect the attributes simply inside data. This is easy enough to change (inside Handler->parseRequestContent()) - was there a reason why its done this way? Am i missing something?

{
"data": {
"type": "resource",
"id": "",
"attributes": {
"name": "blah blah",
"age": "5"
}
}
}

The spec follows what I've done above: http://jsonapi.org/format/#crud

Thanks mate,

@egeriis
Copy link
Owner

egeriis commented Oct 20, 2015

Yes, there's a specific reason. That reason being that this library was build initially for a previous version of the JSON API spec—RC3 if I recall correctly.

Feel free to do a pull request, as the goal should be for this library to be v1 compliant.

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