Skip to content

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

Merged
diatrcz merged 7 commits intomainfrom
lt/example-keyword-issue
Mar 11, 2026
Merged

fix(ibm-valid-schema-example): prevent recursive schemas from failing the validator#797
diatrcz merged 7 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.

Signed-off-by: Lídia Tarcza <100163235+diatrcz@users.noreply.github.com>
@diatrcz diatrcz merged commit 48c4bf0 into main Mar 11, 2026
9 checks passed
@diatrcz diatrcz deleted the lt/example-keyword-issue branch March 11, 2026 09:07
ibm-devx-sdk pushed a commit that referenced this pull request Mar 11, 2026
## @ibm-cloud/openapi-ruleset [1.33.8](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/openapi-ruleset@1.33.7...@ibm-cloud/openapi-ruleset@1.33.8) (2026-03-11)

### Bug Fixes

* **ibm-valid-schema-example:** prevent recursive schemas from failing the validator ([#797](#797)) ([48c4bf0](48c4bf0))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.33.8 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.37.12 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants