Skip to content
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

Error resolving references within extended objects #92

Closed
JamesMessinger opened this issue Jul 23, 2018 · 4 comments
Closed

Error resolving references within extended objects #92

JamesMessinger opened this issue Jul 23, 2018 · 4 comments
Labels

Comments

@JamesMessinger
Copy link
Member

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-parser library 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

@gaviniflix
Copy link

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

@JamesMessinger
Copy link
Member Author

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)

@gaviniflix
Copy link

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?

@JamesMessinger
Copy link
Member Author

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.

@jonluca jonluca closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants