Skip to content

fix(ibm-valid-schema-example): prevent recursive schemas from failing the validator#797

Open
diatrcz wants to merge 6 commits intomainfrom
lt/example-keyword-issue
Open

fix(ibm-valid-schema-example): prevent recursive schemas from failing the validator#797
diatrcz wants to merge 6 commits intomainfrom
lt/example-keyword-issue

Conversation

@diatrcz
Copy link
Contributor

@diatrcz diatrcz commented Mar 9, 2026

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-example rule. 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:

  • The commit message follows the Angular Commit Message Guidelines.
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Dependencies have been updated as needed
  • .secrets.baseline has been updated as needed
  • npm run update-utilities has been run if any files in packages/utilities/src have been updated

diatrcz added 2 commits March 9, 2026 14:37
… the validator

Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
@diatrcz diatrcz marked this pull request as ready for review March 9, 2026 13:41
@diatrcz diatrcz requested review from Andris28 and pyrooka March 9, 2026 13:41
diatrcz added 4 commits March 9, 2026 14:47
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
Copy link
Member

@pyrooka pyrooka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being picky, but I according to the conventions this should start with a lowercase - I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants