Content-Length: 231102 | pFad | http://github.com/koemeet/JsonApiBundle/issues/10

E4 Serialize as json api on the base of the headers Content-Type and Accept · Issue #10 · koemeet/JsonApiBundle · GitHub
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

Serialize as json api on the base of the headers Content-Type and Accept #10

Open
silverqx opened this issue Jul 24, 2015 · 4 comments
Open
Milestone

Comments

@silverqx
Copy link

Hi, I discovered another solution, how could be resolved this problem and it's based on headers. I think that it's much cleaner solution.

The headers Content-Type and Accept will be checked, if contains application/vnd.api+json value, as is described here http://jsonapi.org/format/#content-negotiation, if yes so the entities will be serialized by json api serializer.

And I don't know if it's implemented now, but in this step would be good to implement 415 Unsupported Media Type and 406 Not Acceptable responses on the base of this rules http://jsonapi.org/format/#content-negotiation-servers. Or to create new ticket.

@koemeet
Copy link
Owner

koemeet commented Jul 26, 2015

@szachara I was thinking about this too, but I am not sure if we want this as the default behaviour. It is indeed a very clean way to do it. But it could resolve in some weird behaviour (if we leave it under the json format) which can confuse people a lot. Need to think more about this..

@silverqx
Copy link
Author

Ok and what about 415 and 406 responses, they are acceptable, do they?

I need to think about content negotiation too, if there is something more we can do or implement. Of course everything it's OK for now.

@koemeet
Copy link
Owner

koemeet commented Aug 3, 2015

@szachara They are indeed, the JSON-API spec is pretty big and in the future I want to make if fully compatible. I will flag this issue for 1.0.

@koemeet koemeet added this to the 1.0 milestone Aug 3, 2015
@silverqx
Copy link
Author

silverqx commented Aug 3, 2015

Ok

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








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/koemeet/JsonApiBundle/issues/10

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy