-
Notifications
You must be signed in to change notification settings - Fork 64
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
Filter 'relative' does not behave as expected #154
Comments
Here is an example: Input {
"a": "./b/c.yaml",
"d": "https://my.domain.com/e/f.yaml
} Expected Output {
"a": {
"b": "c"
},
"d": "https://my.domain.com/e/f.yaml
} Actual Output {
"a": {
"b": "c"
},
"d": {
"e": "f"
}
} Update March 11thI just submitted a PR that includes a unit test that showcases this issue (see #155). While I was writing this unit test I realized that this example is actually not accurate and is not valid to reproduce the issue. The problem only applies to the remote references contained by any relative reference. Therefore, a more appropriate example would look like this: Input Root json file
{
"a": {
"$ref": "./b/c.json"
}
"d": {
"$ref": "https://my.domain.com/e/f.json"
}
}
File ./b/c.json
{
"b": {
"$ref": "https://my.domain.com/c.json"
}
} Expected Output {
"a": {
"b": {
"$ref": "https://my.domain.com/c.json"
}
}
"d": {
"$ref": "https://my.domain.com/e/f.json"
}
} Actual Output {
"a": {
"b": {
"c": "some dummy content"
}
}
"d": {
"$ref": "https://my.domain.com/e/f.json"
}
} I hope this example makes more sense @whitlockjc |
Thanks for the reproduction, I didn't realize we broke this. I will get on this. |
@whitlockjc do you have an ETA for the fix? Thanks in advance. |
According to the API documentation, the
filter
option allows us to specify what type of references we want to be resolved. In a previous version of this library (2.1.6
), it was possible to do:Resulting in only
relative
references being resolved, meaning that any other references (likeremote
references) would remained unresolved.However, in the latest version of this library this is no longer possible, given that all reference types that are considered "remote" (both
relative
andremote
, see here) are forced to be fully resolved (see here).It would be great if this
filter
option could be restored to allow developers decide which reference types should be resolved and which not.Please let me know if this issue seems interesting to you. I would be happy to contribute with a fix. Cheers!
The text was updated successfully, but these errors were encountered: