fix(ibm-valid-schema-example): prevent recursive schemas from failing the validator#797
Open
fix(ibm-valid-schema-example): prevent recursive schemas from failing the validator#797
Conversation
… the validator Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
…napi-validator into lt/example-keyword-issue
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
pyrooka
approved these changes
Mar 10, 2026
Member
pyrooka
left a comment
There was a problem hiding this comment.
I left two small comments that should be addressed before merging this. The changes look pretty good overall so I approve the PR to avoid the re-review.
| @@ -0,0 +1,16 @@ | |||
| /** | |||
| * Copyright 2017 - 2025 IBM Corporation. | |||
Member
There was a problem hiding this comment.
Suggested change
| * Copyright 2017 - 2025 IBM Corporation. | |
| * Copyright 2017 - 2026 IBM Corporation. |
I missed this earlier but please make sure that the copyright years are up to date in the files that you modify.
| * SPDX-License-Identifier: Apache2.0 | ||
| */ | ||
|
|
||
| const NestedSchemaKeys = [ |
Member
There was a problem hiding this comment.
Sorry for being picky, but I according to the conventions this should start with a lowercase - I think.
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.
PR summary
Due to spectral's way of resolving schema references, the validator fails with errors if circular/recursive schema references are present, due to the
ibm-valid-schema-examplerule. This PR fixes the rule to first check if there are unresolved references before running the validation, this prevents the validator from failing.PR Checklist
General checklist
Please make sure that your PR fulfills the following requirements:
.secrets.baselinehas been updated as needednpm run update-utilitieshas been run if any files inpackages/utilities/srchave been updated