Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Swagger Required objects #97

Closed
goodwillhacking opened this issue Dec 29, 2017 · 3 comments
Closed

Swagger Required objects #97

goodwillhacking opened this issue Dec 29, 2017 · 3 comments
Assignees
Labels

Comments

@goodwillhacking
Copy link

Would like some clarification on required objects for valid swagger 2.0 spec. Based on swagger-object section version 2.0 spec which can be found here --> https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#swagger-object

securityDefinitions and security (and others too) are not required object for a specification file to be valid .

However when if I do not include the objects in my spec I get error messages similar to

" Data does not match any schemas from 'oneOf'........." `

Granted this may be version 3.0 (although I doubt there is a difference) When I test here: https://editor.swagger.io/ and remove the security definition object as well as all references to it it is recognized as valid.

@goodwillhacking
Copy link
Author

Here is a spec without the security definitoons http://editor2.swagger.io/#!/

@bhaskarmelkani bhaskarmelkani self-assigned this Jan 2, 2018
@bhaskarmelkani
Copy link
Contributor

Hey,

We are using swagger-parser to validate swagger schema .
securityDefinitions and sceurityRequirements are not mandatory in Swagger 2.0.

I also checked removing security from the petstore schema (in the gh-pages-source branch) and it works fine.

Can you please share the schema on which your testing it ?

The link(swagger editor) you shared for schema shows schema stored in your local system, so cannot check whats wrong.

@rbarilani
Copy link
Contributor

Stale, closing

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants