-
Notifications
You must be signed in to change notification settings - Fork 91
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
Conversation
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]>
@@ -145,60 +145,43 @@ function checkForGraphFragmentPattern( | |||
schemaFinder | |||
) { | |||
let variantOmitsProperties = false; | |||
let isValidGraphFragment = true; |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
## @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))
🎉 This PR is included in version 1.14.2 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.14.2 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.3.1 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
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.