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
Currently proto-gen-swagger will generate an empty string for this field on a 200 response, but I am unsure if this is enough to meet the specification. This has some ramifications as at least one of the generators in swagger-codegen or openapi-codegen, rust-server will not compile if the description is set to an empty string without manual intervention.
It seems to be this line which is responsible, so it may just be a matter of setting a default value, though I am not sure what this value should actually be.
Thanks for submitting this issue @johnchildren! This does indeed seem to be in breach of the spec. What can I do to help you get a pull request in to fix this? I think it should be okay to introduce this backwards-incompatibility since any comments or explicit description will override it. How about just A successful response?
Have created a pull request for the change, but I am unsure how best to provide automated tests. I also interested to see how the default value looks when used with streaming responses.
In the swagger specification it says the following about description fields:
https://swagger.io/specification/#responseObject
Currently proto-gen-swagger will generate an empty string for this field on a 200 response, but I am unsure if this is enough to meet the specification. This has some ramifications as at least one of the generators in
swagger-codegen
oropenapi-codegen
,rust-server
will not compile if the description is set to an empty string without manual intervention.It seems to be this line which is responsible, so it may just be a matter of setting a default value, though I am not sure what this value should actually be.
https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-swagger/genswagger/template.go#L697
The text was updated successfully, but these errors were encountered: