Skip to content

Add application/ld+json format associated to json #25599

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

Closed
wants to merge 2 commits into from
Closed

Add application/ld+json format associated to json #25599

wants to merge 2 commits into from

Conversation

vincentchalamon
Copy link
Contributor

Q A
Branch? 2.7 up to 4.0
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Add application/ld+json Content-Type as json format in Request.

@@ -1875,7 +1875,7 @@ protected static function initializeFormats()
'txt' => array('text/plain'),
'js' => array('application/javascript', 'application/x-javascript', 'text/javascript'),
'css' => array('text/css'),
'json' => array('application/json', 'application/x-json'),
'json' => array('application/json', 'application/x-json', 'application/ld+json'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON-LD documents are indeed valid JSON, but all JSON documents aren't valid JSON-LD ones. They are different format, so we should introduce a new key for application/ld+json. I suggest to use jsonld, because it is already used in API Platform.

@dunglas
Copy link
Member

dunglas commented Dec 25, 2017

If we decide to add this format, to merge in 4.1 as a new feature.

@nicolas-grekas nicolas-grekas added this to the 2.7 milestone Dec 25, 2017
@vincentchalamon vincentchalamon changed the base branch from 2.7 to 3.1 December 25, 2017 09:54
@vincentchalamon vincentchalamon changed the base branch from 3.1 to 2.7 December 25, 2017 09:54
@vincentchalamon
Copy link
Contributor Author

vincentchalamon commented Dec 25, 2017

@nicolas-grekas Do you agree with @dunglas to merge it in 3.1 instead of 2.7? If so, I must close this PR and open a new one.

@nicolas-grekas
Copy link
Member

looks ok as bug fix to me,
won't object if ends up in 4.1 (not 3.1)

@dunglas
Copy link
Member

dunglas commented Dec 25, 2017

If we merge it in 2.7, we'll be able to remove some code in API Platform, so 👍 for 2.7 for me.

@ostrolucky
Copy link
Contributor

You don't need to create new PR, just edit this PR and change target branch.

Target for new feature can be master only

@vincentchalamon
Copy link
Contributor Author

@ostrolucky But I cannot change the origin of my PR (which is currently 2.7), that's why I was saying to close & open a new PR. But @nicolas-grekas & @dunglas both agree for 2.7.

@dunglas
Copy link
Member

dunglas commented Dec 25, 2017

@vincentchalamon you can rebase and change the target branch from the GitHub UI (but 2.7 is fine here, indeed).

Copy link
Member

@javiereguiluz javiereguiluz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More info about this format and its official extension, type, subtype, etc.: https://www.iana.org/assignments/media-types/application/ld+json

@nicolas-grekas
Copy link
Member

Thank you @vincentchalamon.

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

Successfully merging this pull request may close these issues.

10 participants