feat: JSON:API 1.1 compliance (v2.1.0)#134
Open
treere wants to merge 1 commit into
Open
Conversation
- API config: add version: :"1.1", extensions and profiles options - ContentTypeNegotiation: accept ext/profile params per 1.1 spec; 415 on unsupported ext URI, 406 when all Accept entries unsupported - ResponseContentType: emit ext/profile params in Content-Type and add Vary: Accept header when extensions/profiles configured - JSONAPIObject: add ext and profile fields; populate from API config on render; emit version 1.1 when configured - LinkObject: add rel, describedby, title, type, hreflang fields - ErrorObject: pass through links.type key (1.1 addition) - Document: silently drop @-prefixed keys from attributes, relationships and meta during deserialization - Bump version to 2.1.0
Owner
|
Looks good to me. We can maybe test this a little bit in the real world and then release it. |
lucacorti
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! A small big change but this should complete the support of jsonapi 1.1
Adds JSON:API 1.1 compliance to
jsonapi_plug, bumping the library to v2.1.0.The changes are backward-compatible with JSON:API 1.0 and are opt-in via API configuration.
Changes
API Configuration
version: :"1.1",extensions, andprofilesoptions to the API module config.Content-Type Negotiation
ContentTypeNegotiationplug now acceptsextandprofileparameters inContent-TypeandAcceptheaders per the 1.1 spec.415 Unsupported Media Typewhen an unsupported extension URI is requested.406 Not Acceptablewhen allAcceptentries are unsupported.Content-Typewith multiple entries is now correctly accepted if at least one entry is a valid JSON:API media type, regardless of order.Response Content-Type
ResponseContentTypeplug emitsextandprofileparameters in theContent-Typeresponse header when extensions/profiles are configured.Vary: Acceptheader when extensions or profiles are configured.JSON:API Object
JSONAPIObjectgainsextandprofilefields."version": "1.1"in the top-leveljsonapimember when configured.Link Object
LinkObjectgainsrel,describedby,title,type, andhreflangfields as per the 1.1 link object spec.Error Object
ErrorObjectpasses through thelinks.typekey, which is a 1.1 addition.Document Deserialization
@-prefixed keys fromattributes,relationships, andmetaduring deserialization, as required by the 1.1 spec.Version
Bumps library version to
2.1.0.