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 2.0 's security scheme validated against OAS 3.0 instead of swagger 2.0 #4364

Closed
pbarbier opened this issue Mar 23, 2018 · 2 comments

Comments

@pbarbier
Copy link

When editing a swagger 2.0 yaml content featuring oauth2 security schemes like below:

securityDefinitions:
oauth2_Password:
type: oauth2
tokenUrl: /authorizationserver/oauth/token
flow: password
scopes:
basic: ''
oauth2_client_credentials:
type: oauth2
tokenUrl: /authorizationserver/oauth/token
flow: application
scopes:
extended: ''

Validation error is reported:

Schema error at securityDefinitions['oauth2_Password']
should NOT have additional properties
additionalProperty: tokenUrl, flow, scopes
Jump to line 5243
Schema error at securityDefinitions['oauth2_Password'].type
should be equal to one of the allowed values
allowedValues: basic, apiKey
Jump to line 5244
Schema error at securityDefinitions['oauth2_Password'].tokenUrl
should match format "uri"
format: uri
Jump to line 5245
Schema error at securityDefinitions['oauth2_Password'].flow
should be equal to one of the allowed values
allowedValues: implicit, application, accessCode
Jump to line 5246

Basically the validator acts as if the input content was OAS 3.0 while it is swagger 2.0 content

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? Swagger 2.0
Which Swagger-UI version? 3.13.0
How did you install Swagger-UI? Use through editor.swagger.io
Which browser & version? Chrome latest
Which operating system? WIN10

Demonstration API definition

See above

Configuration (browser query string, constructor, config.yaml)

regular use of editor.swagger.io

Expected Behavior

No error should be shown for this part of the yaml

Current Behavior

See above

Possible Solution

Context

The error messages are misleading. They claim the content is not valid when it is.

@shockey
Copy link
Contributor

shockey commented Mar 24, 2018

This issue was moved to swagger-api/swagger-editor#1711

@lock
Copy link

lock bot commented Jul 2, 2019

Locking due to inactivity.

This is done to avoid resurrecting old issues and bumping long threads with new, possibly unrelated content.

If you think you're experiencing something similar to what you've found here: please open a new issue, follow the template, and reference this issue in your report.

Thanks!

@lock lock bot locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants