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

Why does $ref automatically resolve on extensions? #1387

Open
shockey opened this issue Sep 15, 2018 · 1 comment
Open

Why does $ref automatically resolve on extensions? #1387

shockey opened this issue Sep 15, 2018 · 1 comment

Comments

@shockey
Copy link
Contributor

shockey commented Sep 15, 2018

From @rwrife on September 14, 2018 18:2

I've noticed that the Swagger UI is trying to resolve $refs on extensions, and in my case failing, even though it can't use the data in the extension, thus resulting in a meaningless error to the end-user. Ideally I think it would, more or less, ignore anything defined in the extensions. For example on an operation I have:

"x-ms-examples": { "Test Examples": { "$ref": "./examples/myExamples.json" } }

The UI can't do anything with x-ms-examples, so why attempt to resolve the ref (which it can't resolve in my specific case)?

Copied from original issue: swagger-api/swagger-ui#4880

@shockey
Copy link
Contributor Author

shockey commented Sep 15, 2018

Hi @rwrife, Swagger Client (which handles resolution for Swagger UI) operates on a blacklist of things to not resolve, and doesn't currently ignore vendor extension fields.

It's not as easy as ignoring anything under a key that matches ^x-, though: for example, consider header names like x-rate-limit.

I'm going to move this over to Swagger Client as a bug now 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant