Repository navigation
Fix type-checking rules to accept allOf, anyOf, and oneOf - #44
Merged
Merged
Conversation
Gérald Barré (geraldbarre-workleap)
requested a review
from a team
as a code owner
March 5, 2026 14:55
Gérald Barré (geraldbarre-workleap)
temporarily deployed
to
ci
March 5, 2026 14:55 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the repository’s Spectral ruleset so OpenAPI schemas using composition keywords aren’t incorrectly flagged by the “must-have-a-type” lint rules.
Changes:
- Extend all four type-checking rules to treat
allOf,anyOf, andoneOfas valid schema definitions (in addition totypeand$ref).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Gérald Barré (geraldbarre-workleap)
temporarily deployed
to
ci
March 5, 2026 15:16 — with
GitHub Actions
Inactive
…ype requirements; add new test specifications for valid compositions.
Gérald Barré (geraldbarre-workleap)
force-pushed
the
feature/FENG-2021
branch
from
March 5, 2026 15:55
15e6edc to
c46fb21
Compare
Gérald Barré (geraldbarre-workleap)
temporarily deployed
to
ci
March 5, 2026 15:55 — with
GitHub Actions
Inactive
Mathieu Gamache (PrincessMadMath)
approved these changes
Mar 5, 2026
This branch was previously deployed
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.
Jira issue link: FENG-2021
Summary
schema-object-must-have-a-type,items-must-have-a-type,schemas-properties-must-have-a-type,path-schema-properties-must-have-a-type) only acceptedtypeor$refas valid schema definitionsallOf,anyOf,oneOf) were incorrectly flagged as errors — for example, schemas usingallOffor inheritance oroneOffor polymorphism (discriminator patterns)allOf,anyOf, andoneOfas accepted alternatives in all four type-checking rulesTest plan
spectral lintagainst a test spec containingallOf(inheritance) andoneOf(discriminator) patterns — no false positives