Repository navigation
fix(functions): clearer schema errors for array items and oneOf/anyOf - #3095
Merged
Merged
Conversation
Mateusz Wroński (kopernic-pl)
requested review from
a team,
Jonas Lagoni (jonaslagoni) and
Sergio Moya (smoya)
as code owners
October 21, 2026 08:56
Mateusz Wroński (kopernic-pl)
force-pushed
the
chore/better-errors
branch
from
October 21, 2026 12:12
05868e8 to
5a8e49e
Compare
Michał Rychel (micryc)
approved these changes
Oct 22, 2026
Array indexes were reported as properties (`"1" property must ...`) and oneOf/anyOf failures gave no hint that the other errors explain the mismatch. Refs #1072
Mateusz Wroński (kopernic-pl)
force-pushed
the
chore/better-errors
branch
from
October 22, 2026 10:22
5a8e49e to
73bf66b
Compare
Stoplighticus Roboticus (stoplight-bot)
pushed a commit
that referenced
this pull request
Nov 6, 2026
## @stoplight/spectral-functions [1.11.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-functions-1.11.0...@stoplight/spectral-functions-1.11.1) (2026-11-06) ### Bug Fixes * **functions:** clearer schema errors for array items and oneOf/anyOf ([#3095](#3095)) ([5c566df](5c566df)), closes [#1072](#1072) * **functions:** republish 1.11.1 after failed release ([#3104](#3104)) ([d5da3c0](d5da3c0))
Stoplighticus Roboticus (stoplight-bot)
pushed a commit
that referenced
this pull request
Nov 6, 2026
## [6.17.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-cli-6.17.0...@stoplight/spectral-cli-6.17.1) (2026-11-06) ### Bug Fixes * **cli:** lint files whose names contain glob characters ([#3101](#3101)) ([bf782be](bf782be)), closes [#2814](#2814) * **cli:** switch binary target to node22 ([#3080](#3080)) ([1355fa6](1355fa6)) * **core:** resolve a redefined rule's given against the aliases of its ruleset ([#3089](#3089)) ([6497ddd](6497ddd)), closes [#3085](#3085) * **functions:** clearer schema errors for array items and oneOf/anyOf ([#3095](#3095)) ([5c566df](5c566df)), closes [#1072](#1072) * **functions:** republish 1.11.1 after failed release ([#3104](#3104)) ([d5da3c0](d5da3c0)) * **rulesets:** guard null definitions in oas2-discriminator given ([#3098](#3098)) ([74a5fe0](74a5fe0)) * **rulesets:** relaxRequired does not traverse "not" schemas ([#3083](#3083)) ([95ab37e](95ab37e)), closes [#3068](#3068)
Collaborator
|
🎉 This PR is included in version 1.11.1 🎉 The release is available on Your semantic-release bot 📦🚀 |
Stoplighticus Roboticus (stoplight-bot)
pushed a commit
that referenced
this pull request
Nov 6, 2026
## [1.24.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-core-1.24.0...@stoplight/spectral-core-1.24.1) (2026-11-06) ### Bug Fixes * **cli:** lint files whose names contain glob characters ([#3101](#3101)) ([bf782be](bf782be)), closes [#2814](#2814) * **cli:** switch binary target to node22 ([#3080](#3080)) ([1355fa6](1355fa6)) * **core:** resolve a redefined rule's given against the aliases of its ruleset ([#3089](#3089)) ([6497ddd](6497ddd)), closes [#3085](#3085) * **functions:** clearer schema errors for array items and oneOf/anyOf ([#3095](#3095)) ([5c566df](5c566df)), closes [#1072](#1072) * **functions:** republish 1.11.1 after failed release ([#3104](#3104)) ([d5da3c0](d5da3c0)) * **rulesets:** guard null definitions in oas2-discriminator given ([#3098](#3098)) ([74a5fe0](74a5fe0)) * **rulesets:** relaxRequired does not traverse "not" schemas ([#3083](#3083)) ([95ab37e](95ab37e)), closes [#3068](#3068)
Stoplighticus Roboticus (stoplight-bot)
pushed a commit
that referenced
this pull request
Nov 6, 2026
## [1.23.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-rulesets-1.23.0...@stoplight/spectral-rulesets-1.23.1) (2026-11-06) ### Bug Fixes * **cli:** lint files whose names contain glob characters ([#3101](#3101)) ([bf782be](bf782be)), closes [#2814](#2814) * **cli:** switch binary target to node22 ([#3080](#3080)) ([1355fa6](1355fa6)) * **core:** resolve a redefined rule's given against the aliases of its ruleset ([#3089](#3089)) ([6497ddd](6497ddd)), closes [#3085](#3085) * **functions:** clearer schema errors for array items and oneOf/anyOf ([#3095](#3095)) ([5c566df](5c566df)), closes [#1072](#1072) * **functions:** republish 1.11.1 after failed release ([#3104](#3104)) ([d5da3c0](d5da3c0)) * **rulesets:** guard null definitions in oas2-discriminator given ([#3098](#3098)) ([74a5fe0](74a5fe0)) * **rulesets:** relaxRequired does not traverse "not" schemas ([#3083](#3083)) ([95ab37e](95ab37e)), closes [#3068](#3068) ### Features * **repo:** minor release trigger ([#3079](#3079)) ([eabafec](eabafec))
Mateusz Wroński (kopernic-pl)
pushed a commit
to smsalisbury/spectral
that referenced
this pull request
Nov 12, 2026
## @stoplight/spectral-functions [1.11.1](https://github.com/stoplightio/spectral/compare/@stoplight/spectral-functions-1.11.0...@stoplight/spectral-functions-1.11.1) (2026-11-05) ### Bug Fixes * **functions:** clearer schema errors for array items and oneOf/anyOf ([stoplightio#3095](stoplightio#3095)) ([5c566df](stoplightio@5c566df)), closes [stoplightio#1072](stoplightio#1072)
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.
Summary
Follow-up to the error-message review in #1072 (closed). Re-running its repros showed most were already fixed; this addresses the one that still read badly (array example failing a `oneOf`).
The change is in the `schema` function's result mapper, since the wording comes from `@stoplight/[email protected]`, which has no newer release. The upstream `better-ajv-errors` 3.x has a different API and message format, so I did not migrate.
Not addressed
Testing