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

content-type with "+ convention" #172

Open
RubenVerborgh opened this issue Apr 11, 2016 · 5 comments
Open

content-type with "+ convention" #172

RubenVerborgh opened this issue Apr 11, 2016 · 5 comments

Comments

@RubenVerborgh
Copy link

I would have expected application/home+json in line with the "+ convention".

@asbjornu
Copy link

That would also be more in line with RFC 7807's application/problem+json.

@mnot mnot added the json-home label Apr 26, 2016
@mnot mnot changed the title [json-home] content-type with "+ convention" content-type with "+ convention" Apr 26, 2016
@mnot
Copy link
Owner

mnot commented May 3, 2016

Yes. I've intentionally not registered the media type because I want the flexibility to change the format when it's more baked.

@dret
Copy link
Contributor

dret commented Oct 10, 2017

as one additional data point: https://tools.ietf.org/html/draft-wilde-home-xml-03#section-4.1 defines application/problem+xml assuming that the structured syntax suffix is a useful pattern to follow.

@RubenVerborgh
Copy link
Author

Seems like it's time to turn this convention into an officially meaningful thing.

@dret
Copy link
Contributor

dret commented Oct 10, 2017

@RubenVerborgh: it is an RFC (https://tools.ietf.org/html/rfc6838), but media types are free to follow or ignore this pattern.

cdent added a commit to cdent/gabbi that referenced this issue Sep 2, 2021
Some formats that look like they might be JSON,
based on the media-type in the content-type header
are not actually valid JSON. This presents problems
with tests trying to decode, but being unable to
do so, causing unexpected failures.

These changes update the accepts method in the
JSONHandler to be more specific and adds tests
to cover it.

As part of this some test which showed that we
accept "application/json-home" as valid JSON have
been removed. That media type is not considered
legitimate. See: mnot/I-D#172

Note that this change is an improvement, but it
is not 100% reliable as there is no good way to
be so because the world is complex and ambiguous,
which is part of why #301 was done: to deal with
gaps.

Thanks to @FND for ideas from #298.

Fixes #296
cdent added a commit to cdent/gabbi that referenced this issue Sep 3, 2021
Some formats that look like they might be JSON,
based on the media-type in the content-type header
are not actually valid JSON. This presents problems
with tests trying to decode, but being unable to
do so, causing unexpected failures.

These changes update the accepts method in the
JSONHandler to be more specific and adds tests
to cover it.

As part of this some test which showed that we
accept "application/json-home" as valid JSON have
been removed. That media type is not considered
legitimate. See: mnot/I-D#172

Note that this change is an improvement, but it
is not 100% reliable as there is no good way to
be so because the world is complex and ambiguous,
which is part of why #301 was done: to deal with
gaps.

This change was driven by needing to not match
'application/json;stream=<some value>'. This is
based on what Kubernetes does for watch requests,
streaming json objects over chunks.

Thanks to @FND for ideas from #298.

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

No branches or pull requests

4 participants