Error resolving references within extended objects
Glossary
An "extended object" is a JSON object that has other properties in addition to $ref. For example:
{
"name": "additional name property",
"$ref": "#/some/reference"
}
Note: that extended objects are not allowed by the JSON Schema or JSON Reference specs. The
json-schema-ref-parserlibrary only supports them for backward-compatibility, and it's possible that this support will be removed at some point in the future to bring this library inline with the official spec.
Issue Description
There is currently a bug in the dereference() method when an extended object contains both an external file reference and an internal reference. The internal reference gets broken, because the dereference() method attempts to resolve it in the external file instead.
Issue Reproduction
Here is sample code that reproduces this issue: https://runkit.com/bigstickcarpet/swagger-cli-issue-19
Any updates on this? Im having the same issue ... I tried using a custom resolver, but this error occurs before my custom resolver can intercept and handle the #/some/reference
No update on this yet. It's lower on my priority list than other issues, since it only occurs for schemas that are technically invalid (see my note above)
Thanks ... will keep eyes on this issue to see what is done going forward ... Hoping it gets in, but understand the bring this library inline with the official spec statement .... any chance of a fork?
My plan is for the core library to be spec-compliant and to move the non-spec-compliant functionality to a companion library or a plugin.