-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Conversation
@@ -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'), |
There was a problem hiding this comment.
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.
If we decide to add this format, to merge in 4.1 as a new feature. |
@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. |
looks ok as bug fix to me, |
If we merge it in 2.7, we'll be able to remove some code in API Platform, so 👍 for 2.7 for me. |
You don't need to create new PR, just edit this PR and change target branch. Target for new feature can be master only |
@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. |
@vincentchalamon you can rebase and change the target branch from the GitHub UI (but 2.7 is fine here, indeed). |
There was a problem hiding this 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
Thank you @vincentchalamon. |
Add
application/ld+json
Content-Type as json format in Request.