You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that if the above security_requirement is given value: {}, generation with buf succeeds.
Your Environment
gen-go-swagger v1.9.6
GNU/Linux x86_64
The text was updated successfully, but these errors were encountered:
krishicks
changed the title
panic when SecurityRequirement is missing a value
openapiv2: panic when SecurityRequirement is missing a value
Nov 12, 2020
🐛 Bug Report
protoc-gen-openapiv2
panics when specifying an OpenAPI security option with a security requirement that is missing a value.This was discovered when using
buf
to generate protos. @bufdev hinted that:(Note: the issue was found in v1.9.6, and has been adapted to master, which includes the rename to openapiv2)
To Reproduce
Given the following proto:
Try to compile the proto with
buf
:buf generate --template '{"version":"v1beta1","plugins":[{"name":"openapiv2","out":"out"}]}' --file proto/swagger-description.proto
Expected behavior
The plugin exits successfully.
Actual Behavior
The plugin panics:
The master line that equates to the v1.9.6 panic above is here: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-openapiv2/internal/genopenapi/template.go#L1358
Note that if the above security_requirement is given
value: {}
, generation withbuf
succeeds.Your Environment
gen-go-swagger v1.9.6
GNU/Linux x86_64
The text was updated successfully, but these errors were encountered: