-
Notifications
You must be signed in to change notification settings - Fork 191
fix: error can't resolve $ref when components.parameters has a ref to the components.schemas
#2407
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
base: main
Are you sure you want to change the base?
fix: error can't resolve $ref when components.parameters has a ref to the components.schemas
#2407
Conversation
🦋 Changeset detectedLatest commit: 7b0d730 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
4631f22 to
ec8a31c
Compare
tatomyr
left a comment
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.
Co-authored-by: Jacek Łękawa <[email protected]>
7c12980 to
06df369
Compare
|
did you check if this works for other components? headers, pathItems in 3.1.x, examples, requestBodies, responses |
|
@jeremyfiel Yeah, you are right, need to test with all cases, i will test it tomorrow. At the first glance, everything looks good and all users, that reported this bug faced it in parameters. I thought, that we covered a lot of cases in test and if all tests passes the fixes work correctly. |
This reverts commit 3a43128.
|
@jeremyfiel Great point, i implemented new fix for this case and tested for all type of components, provided in |
Co-authored-by: Andrew Tatomyr <[email protected]>
| resolveBundledComponent(node, resolved, ctx.location.source.absoluteRef); | ||
| // Also register from root document location if this is an external ref | ||
| // This ensures refs inside bundled components can be resolved when visited later | ||
| if (ctx.location.source !== rootDocument.source) { |
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.
Could you add a test to demonstrate how would such cases look like?




What/Why/How?
The issue happens when
parameterhas a reference toschemasandremove-unused-componentsdecorator provided inredocly.yaml.This PR contains the global fix, nothing changes inside
remove-unused-componentsdecorator, because the issue happens in all decorators/rules, which are usingParametersvisitor.Reference
Resolves #2350
Testing
Ran tests and created new for this specific case.
Screenshots (optional)
Check yourself
Security