fix: recursively resolve and dereference extended refs#45
Open
skyqrose wants to merge 6 commits into
Open
Conversation
|
I just merged in #47 to address the |
6bb66b5 to
7b94ae0
Compare
Author
|
I've merged in those changes from upstream. Unfortunately, I'm still getting the same MissingPointerError. Perhaps the same fixes from #47 or this PR needs to be applied to dereference.js in addition to resolve-external.js? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(tests don't pass, not ready to merge, see description)
Motivation and Context
Resolves #44
This is blocking my usage of this library, and I don't have any other workaround besides writing my own custom resolving or dereferencing.
Description
elseso that the crawl recurses into the children of an object even if it has a $ref.Unfortunately there's also a bug in dereferencing, and I've tried to fix it, but the dereferencing recursion is more complicated and I wasn't able to figure it out on my own. This would need attention from a maintainer to fix it.
Specifically the new test fails with
MissingPointerError: at "#/local", token "$defs" in "#/$defs/local" does not exist
And in
lib/dereference.js:dereference$Refthe path is wrong. The log statement (currently commented out) incorrectly says(note that
referenced-root.yaml#/localdoesn't exist)If you remove the top level
$ref: "referenced-root.yaml"fromtest/specs/nested-extended/nested-extended.yaml(so it's not an extended ref anymore), that same log says (correctly)I tried to fix this, but I didn't understand enough about how paths are made and what they mean. Someone who's more familiar with the code would need to fix
dereference.jsso that the new test passes.How Has This Been Tested?
Screenshot(s)/recordings(s)
Types of changes
This is a behavior change, so could potentially be considered breaking, but I think it still falls under "bug fix".
Checklist