Open
Description
🐛 Bug Report
If we use google.protobuf.ListValue, the generated swagger spec specifies items type as object:
"listvalueField": {
"type": "array",
"items": {
"type": "object"
}
},
Swagger-ui considers it an error, if we pass an array, e.g. of strings:
propKeysystemTagserrorindex0errorParameter string value must be valid JSON
The generated json spec contains:
"listvalueField": {
"type": "array",
"items": {
"type": "object"
}
},
To Reproduce
- Create a proto file:
syntax = "proto3";
package my_service;
option go_package = "./pb";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
message UpdateItem {
message Request {
google.protobuf.ListValue listvalue_field = 1;
}
}
service MyService {
rpc UpdateA(UpdateA.Request) returns (google.protobuf.Empty) {
option (google.api.http) = {
patch: "/v1/item"
body: "*"
};
}
- Generate swagger spec with protoc.
Expected behavior
There should be a choice to specify the type for items.
Actual Behavior
The items type is taken from wktSchemas:
https://github.com/grpc-ecosystem/grpc-gateway/blob/v2.16.0/protoc-gen-openapiv2/internal/genopenapi/template.go#L98-L104
Your Environment
OSX Ventura 13.4.1, Go 1.20, [email protected]
Metadata
Metadata
Assignees
Labels
No labels