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 Conformance #815

Open
birdayz opened this issue Nov 17, 2018 · 3 comments
Open

Swagger Conformance #815

birdayz opened this issue Nov 17, 2018 · 3 comments

Comments

@birdayz
Copy link
Contributor

birdayz commented Nov 17, 2018

Go to https://editor.swagger.io/

Click File -> Import URL

Enter https://raw.githubusercontent.com/grpc-ecosystem/grpc-gateway/master/examples/proto/examplepb/a_bit_of_everything.swagger.json (current ABE example)

Find some validation errors:

Schema error at paths['/v1/example/a_bit_of_everything/echo/{value}'].get.responses['404']
should NOT have additional properties
additionalProperty: description, schema
Jump to line 63
Schema error at paths['/v1/example/a_bit_of_everything/echo/{value}'].get.responses['404'].schema
should match exactly one schema in oneOf
Jump to line 65
Schema error at paths['/v1/example/a_bit_of_everything/echo/{value}'].get.responses['404'].schema.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, null, number, object, string, file
Jump to line 66
Semantic error at paths./v1/example/a_bit_of_everything/{uuid}
Equivalent paths are not allowed.
Jump to line 422
Schema error at paths['/v2/example/echo'].get.responses['404']
should NOT have additional properties
additionalProperty: description, schema
Jump to line 689
Schema error at paths['/v2/example/echo'].get.responses['404'].schema
should match exactly one schema in oneOf
Jump to line 691
Schema error at paths['/v2/example/echo'].get.responses['404'].schema.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, null, number, object, string, file
Jump to line 692
Schema error at paths['/v2/example/echo'].post.responses['404']
should NOT have additional properties
additionalProperty: description, schema
Jump to line 724
Schema error at paths['/v2/example/echo'].post.responses['404'].schema
should match exactly one schema in oneOf
Jump to line 726
Schema error at paths['/v2/example/echo'].post.responses['404'].schema.type
should be equal to one of the allowed values
allowedValues: array, boolean, integer, null, number, object, string, file
Jump to line 727

I wonder, what does their "should" actually mean? If it's a RFC-style "SHOULD", it's not critical.. but it reads like a "real" error though.

@johanbrandhorst
Copy link
Collaborator

Is that not validating based on the OpenAPI 3 spec? Remember we only support OpenAPI 2 (swagger 2.0).

@birdayz
Copy link
Contributor Author

birdayz commented Nov 17, 2018

If i load https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/api-with-examples.json or https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v2.0/json/uber.json there's no errors. Since the document contains the version,i think it supports both. But i might be wrong..

@johanbrandhorst
Copy link
Collaborator

Looks mostly to be a problem with the way we're rendering the responses, could you dig a little deeper and see how we're violating the spec exactly?

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

2 participants