-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Cryptic "reference resolves to more than one schema" errors #2140
Comments
Hey! |
It appears so! I will close it, but add a note to the other issue in case this supplemental test case is helpful. Thanks @P0lip! |
padamstx
added a commit
to padamstx/spectral
that referenced
this issue
Feb 22, 2023
This commit modifies the oasExample function so that example fields are removed from the schema to be used for validation. This is needed because the presence of an "example" field in a schema confuses ajv in certain scenarios. References: - stoplightio#2081 - stoplightio#2140 - ajv-validator/ajv#1426
4 tasks
padamstx
added a commit
to padamstx/spectral
that referenced
this issue
Feb 23, 2023
This commit modifies the oasExample function so that example fields are removed from the schema to be used for validation. This is needed because the presence of an "example" field in a schema confuses ajv in certain scenarios. References: - stoplightio#2081 - stoplightio#2140 - ajv-validator/ajv#1426
4 tasks
padamstx
added a commit
to padamstx/spectral
that referenced
this issue
Mar 1, 2023
This commit modifies the oasExample function so that example fields are removed from the schema to be used for validation. This is needed because the presence of an "example" field in a schema confuses ajv in certain scenarios. References: - stoplightio#2081 - stoplightio#2140 - ajv-validator/ajv#1426
padamstx
added a commit
to padamstx/spectral
that referenced
this issue
Apr 5, 2023
This commit modifies the oasExample function so that example fields are removed from the schema to be used for validation. This is needed because the presence of an "example" field in a schema confuses ajv in certain scenarios. References: - stoplightio#2081 - stoplightio#2140 - ajv-validator/ajv#1426
P0lip
added a commit
that referenced
this issue
Apr 25, 2023
* fix(rulesets): avoid false errors from ajv This commit modifies the oasExample function so that example fields are removed from the schema to be used for validation. This is needed because the presence of an "example" field in a schema confuses ajv in certain scenarios. References: - #2081 - #2140 - ajv-validator/ajv#1426 * docs(repo): fix lint warning in README Signed-off-by: Phil Adams <phil_adams@us.ibm.com> * chore(rulesets): use traverse --------- Signed-off-by: Phil Adams <phil_adams@us.ibm.com> Co-authored-by: Jakub Rożek <jakub@stoplight.io>
P0lip
added a commit
that referenced
this issue
Apr 25, 2023
* fix(rulesets): avoid false errors from ajv This commit modifies the oasExample function so that example fields are removed from the schema to be used for validation. This is needed because the presence of an "example" field in a schema confuses ajv in certain scenarios. References: - #2081 - #2140 - ajv-validator/ajv#1426 * docs(repo): fix lint warning in README Signed-off-by: Phil Adams <phil_adams@us.ibm.com> * chore(rulesets): use traverse --------- Signed-off-by: Phil Adams <phil_adams@us.ibm.com> Co-authored-by: Jakub Rożek <jakub@stoplight.io>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
For certain schema compositions and example values, the
oas3-valid-media-example
andoas3-valid-schema-example
rules emitreference <value from example> resolves to more than one schema
.To Reproduce
spectral lint <document>
with thespectral:oas
rulesetExpected behavior
As far as I can tell, these errors are spurious.
Environment (remove any that are not applicable):
The text was updated successfully, but these errors were encountered: