-
Notifications
You must be signed in to change notification settings - Fork 8
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
application/form+json instead of application/json #11
Comments
I'm not sure that I see the value in this, and the cost is effectively that it removes the value in addressing JSON services directly since most (if not all) won't recognise the new media type. This does not reduce coupling. The purpose is to produce JSON, and that's what it does. It won't allow us to refine serialisation any more than what we have. It won't enable the addition of schema validators — they are already entirely possible. Sorry, but I really don't see what this would buy us. |
How so? This statement implies that all existing services already recognise Submitted payload with Additionally if i have resource
and so on, how should request processors differentiate if what
Yes it does. Existing spec couples everything to "Hello world!"
i do not think we can say about these values that these are serialized HTML forms even though these are valid |
But just because an HTML form will never lead to a simple value doesn't mean it will not produce perfectly fine JSON and therefore The only thing I thing that could speak for this approach is mentioned in #8:
Besides that, it is never mentioned in the current draft that the outcome must conform RFC 7159 - an issue I try to address with #35. |
I disagree with inventing a new mediatype for the same encoding. There is enough information in the HTTP headers to disambiguate where the request has come from. If there is the potential for CSRF then JSON encoding should use CORS to validate the origin. If sites want to do mediatype switching they can always override the HTTP response Content-Type header to whatever they choose. |
I think it would be more appropriate to introduce
application/form+json
media type instead of usingapplication/json
media type directly.As long as serialized
JSON
directly depends on the structure of HTML forms it would be nice if request processors could distinguish from submitted payload format by theirContent-Type
and substitute appropriate parsers instead of "guessing"...Potential benefits
HTML
forms specThe text was updated successfully, but these errors were encountered: