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

swagger ui validation errors with security definitions #73

Closed
deefactorial opened this issue Jan 29, 2016 · 2 comments
Closed

swagger ui validation errors with security definitions #73

deefactorial opened this issue Jan 29, 2016 · 2 comments

Comments

@deefactorial
Copy link

I posted this issue on swagger-tools:
apigee-127/swagger-tools#329

When I run the swagger-tools UI and I browse to the /docs There is an ERROR at the bottom of the page,

When I click on it brings me to:

https://online.swagger.io/validator/debug?url=https://cloud.openmoney.cc/api-docs

The errors I'm getting are:

{"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"oneOf","message":"instance failed to match exactly one schema (matched 0 out of 6)","schema":{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/securityDefinitions/additionalProperties"},"instance":{"pointer":"/securityDefinitions/oauth2AccessCodeSecurity"}},{"level":"error","domain":"validation","keyword":"oneOf","message":"instance failed to match exactly one schema (matched 0 out of 6)","schema":{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/securityDefinitions/additionalProperties"},"instance":{"pointer":"/securityDefinitions/oauth2ApplicationSecurity"}},{"level":"error","domain":"validation","keyword":"oneOf","message":"instance failed to match exactly one schema (matched 0 out of 6)","schema":{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/securityDefinitions/additionalProperties"},"instance":{"pointer":"/securityDefinitions/oauth2ImplicitSecurity"}},{"level":"error","domain":"validation","keyword":"oneOf","message":"instance failed to match exactly one schema (matched 0 out of 6)","schema":{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/securityDefinitions/additionalProperties"},"instance":{"pointer":"/securityDefinitions/oauth2PasswordSecurity"}}]}

My swagger.json file has no errors on http://editor.swagger.io/

@webron
Copy link
Contributor

webron commented Jan 29, 2016

Haven't tested it, but I would guess that it's because your URLs (or rather URIs) are invalid URLs (due to the curly braces). If you can test easily, try removing them and see if it resolves the issue. Otherwise, I could get around to testing it a bit later.

@deefactorial deefactorial changed the title Valid swagger.json produces validation errors swagger ui validation errors with security definitions Jan 29, 2016
@webron
Copy link
Contributor

webron commented Jan 29, 2016

Okay, just tested it, and that's indeed the issue. The URLs for oauth2 definitions do not allow templating/parameter substitution like regular paths. You could escape the curly braces, but it would still not provide you with what you hope - templated URLs.

If you'd like to see supported added for it in the future, I'd suggest opening an issue on the spec.

I'm afraid this is not really a bug, so will be closing the issue.

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

No branches or pull requests

2 participants