-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Boolean type should not have a format (OAS) #1463
Comments
@ozraza very interesting. We generate OpenAPI v2 definitions, is this also true for the v2 spec? |
I believe the fix here is as simple as updating our internal mapping to reflect the correct value. Would you be willing to send in a PR to address this? |
Yes, I am willing to submit a PR with the fix. |
PR is open for review: #1466 |
johanbrandhorst
pushed a commit
that referenced
this issue
Jun 17, 2020
ozraza
added a commit
to ozraza/grpc-gateway
that referenced
this issue
Jun 18, 2020
ozraza
added a commit
to ozraza/grpc-gateway
that referenced
this issue
Jun 18, 2020
johanbrandhorst
pushed a commit
that referenced
this issue
Jun 18, 2020
This was referenced Aug 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
According to OAS specifications, boolean types should not have a format. Presence of format for boolean results in IBM OpenAPI Validator failing on boolean type/format verification. Turning off
invalid_type_format_pair
schema rule is not an option as it disables the data type/format rules.https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-swagger/genswagger/template.go#L68
Prerequisities
Install ibm-openapi-validator
npm install -g ibm-openapi-validator
Install protobuf 3.7.0
https://github.com/protocolbuffers/protobuf/releases/download/v3.7.0/protoc-3.7.0-linux-x86_64.zip
Get latest version of protoc-gen-swagger
https://github.com/grpc-ecosystem/grpc-gateway
To Reproduce
Generate swagger.json file using protoc-gen-swagger
Perform openapi validation
lint-openapi <path-to-swagger.json>
See error
Expected behavior
Boolean format is not present to comply with OAS specifications thereby allowing openapi validation to pass.
Actual Behavior
Boolean format is present thereby causing openapi validation to fail.
Your Environment
MacOS Catalina 10.15.4
The text was updated successfully, but these errors were encountered: