Add JSON:API v1.1 support as an additive overlay#1
Open
arjenblokzijl wants to merge 2 commits into
Open
Conversation
Introduces jsonapi-1.1.yml, which extends the untouched v1.0 ruleset (.spectral.yml) and only redefines the rules that changed in JSON:API v1.1: the ext/profile media type parameters, expanded links object members (rel, describedby, title, type, hreflang), the jsonapi object ext/profile/meta members, and the lid local identifier on resource objects and resource identifier objects. The v1.0 ruleset is unchanged, so existing consumers are unaffected. Spectral does not inherit aliases through extends, so the alias block is duplicated into the overlay (rules are not). Adds an examples/valid-1.1 fixture exercising the new features and a test:1.1 script; npm test now lints both rulesets. Bumps to 1.1.0.
Note both v1.0 (.spectral.yml) and v1.1 (jsonapi-1.1.yml) rulesets, how to select one per API version, and that the v1.1 file is an additive overlay on top of v1.0.
joelcox
requested changes
Jun 26, 2026
joelcox
left a comment
Member
There was a problem hiding this comment.
Ik kan zo'n spec nogal slecht reviewen, maar zie wederom veel kebab case, ook in URLs. Ook zou ik liever zien dat het een conceet voorbeeld gaat i.p.v. abstracte resources.
| - 'qa' | ||
| default: 'dev' | ||
| paths: | ||
| /myResources: |
| - 'qa' | ||
| default: 'dev' | ||
| paths: | ||
| /myResources: |
Member
There was a problem hiding this comment.
Allicht sowieso goed om dit minder abstract te maken. Posts en comments bijv.
| - $ref: '#/components/parameters/sort' | ||
| responses: | ||
| '200': | ||
| $ref: '#/components/responses/MyResource_Collection' |
| 'default': | ||
| $ref: '#/components/responses/DefaultError' | ||
| components: | ||
| securitySchemes: |
Member
There was a problem hiding this comment.
Volgens mij niet relevant/niet gespacced in JSON:API, dus kan weg?
Collaborator
Author
|
op zich eens, maar onderstaande feedback is 1 op 1 overgenomen uit de originele voorbeelden. wilde eigenlijk zo frictieloos die 1.1 in main krijgen. ironisch 😏 kan het wel aanpassen, maar dan ook in de 1.0 versie lijkt me. waddayasay? |
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.
Adds JSON:API v1.1 support without changing v1.0 behaviour.
jsonapi-1.1.ymlextends the untouched.spectral.ymland only redefines the rules that changed in v1.1:ext/profilemedia type parameters (content negotiation)linksobject members (rel,describedby,title,type,hreflang)jsonapiobjectext/profile/metamemberslidlocal identifier on resource objects and resource identifier objectsEverything else is inherited unchanged, so existing v1.0 consumers are unaffected (non-breaking, bumped to
1.1.0).Notes
aliasesthroughextends, so the alias block is duplicated into the overlay (rules are not). Flagged with a sync comment in the file.examples/valid-1.1/exercising the new features and atest:1.1script;npm testnow lints both rulesets and passes (0 errors).Before upstreaming (draft jmlue42#79)
jsonapi-1.1.ymlagainst our real API definitions, not just the fixture