fix: error can't resolve $ref when components.parameters has a ref to the components.schemas #2407
fix: error can't resolve $ref when components.parameters has a ref to the components.schemas #2407AlbinaBlazhko17 wants to merge 25 commits intomainfrom
can't resolve $ref when components.parameters has a ref to the components.schemas #2407Conversation
🦋 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
Co-authored-by: Jacek Łękawa <164185257+JLekawa@users.noreply.github.com>
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 <andrew.tatomyr@redocly.com>
| 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.
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