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
I am using the latest version of grpc-gateway(1.12.1). I have a proto message with field of type google.protobuf.ListValue. protoc-gen-swagger was added support for struct.proto types - #990
However, it generates the following swagger model
protobufListValue:
type: objectproperties:
values:
type: arrayitems:
$ref: '#/definitions/protobufValue'description: Repeated field of dynamically typed values.description: |- `ListValue` is a wrapper around a repeated field of values. The JSON representation for `ListValue` is JSON array.
But this seems wrong as ListValue (as written in comment) is an array. Is there a reason we couldn't generate the following? -
protobufListValue:
type: arrayitems: {}description: |- `ListValue` is a wrapper around a repeated field of values. The JSON representation for `ListValue` is JSON array.
I understand that, swagger 2.0 doesn't have anyOf support over array, but we could have added examples in the tempalate, rather than using object and then explaining in the description.
The text was updated successfully, but these errors were encountered:
Hi! This might make sense - I think I made the original change and I wasn't sure what to do with some of them. If you'd like to submit a PR we can take a look!
@johanbrandhorst So when I ran locally from this repo, the swagger generation was perfect. I found an issue in my own build process where I was not able to update the dependency.
However, I will raise a PR with an example of struct values in examples/proto/examplepb
I am using the latest version of grpc-gateway(1.12.1). I have a proto message with field of type
google.protobuf.ListValue
. protoc-gen-swagger was added support forstruct.proto
types - #990However, it generates the following swagger model
But this seems wrong as
ListValue
(as written in comment) is an array. Is there a reason we couldn't generate the following? -I understand that, swagger 2.0 doesn't have anyOf support over array, but we could have added examples in the tempalate, rather than using object and then explaining in the description.
The text was updated successfully, but these errors were encountered: