Skip to content
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

fix(api-symmetry): handle nested reference schemas #639

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Oct 11, 2023

If reference schemas were nested in composed properties on the canonical schema, the code would not resolve them the way it would for non-nested reference schemas.

This moves the resolving code to the constraint checker, so that every schema and applicator sub-schema will be resolved if it is a reference.

If reference schemas were nested in composed properties on the canonical
schema, the code would not resolve them the way it would for non-nested
reference schemas.

This moves the resolving code to the constraint checker, so that every
schema and applicator sub-schema will be resolved if it is a reference.

Signed-off-by: Dustin Popp <[email protected]>
@dpopp07 dpopp07 requested review from pyrooka and padamstx October 11, 2023 21:34
@@ -145,60 +145,43 @@ function checkForGraphFragmentPattern(
schemaFinder
) {
let variantOmitsProperties = false;
let isValidGraphFragment = true;
Copy link
Member Author

Choose a reason for hiding this comment

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

This didn't necessarily cause problems but it did make debugging a lot harder, since once this got set, every call to isGraphFragment would return false. Now, we use a local variable which is probably a more clean and appropriate overall.

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.

As far as I can tell, it looks good!

@dpopp07 dpopp07 merged commit 603e689 into main Oct 16, 2023
3 checks passed
@dpopp07 dpopp07 deleted the dp/api-symmetry-fix branch October 16, 2023 15:48
ibm-devx-sdk pushed a commit that referenced this pull request Oct 16, 2023
## @ibm-cloud/openapi-ruleset [1.14.2](https://github.com/IBM/openapi-validator/compare/@ibm-cloud/[email protected]...@ibm-cloud/[email protected]) (2023-10-16)

### Bug Fixes

* **api-symmetry:** handle nested reference schemas ([#639](#639)) ([603e689](603e689))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 1.14.2 🎉

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.14.2 🎉

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.3.1 🎉

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