Incorrect type gen for []int64 (repeated int64), single int64 fields
titpetric opened this issue · 3 comments
titpetric commented
I get the following output for a type generated in a swagger file:
"userGetMultiRequest": {
"type": "object",
"properties": {
"userIDs": {
"type": "array",
"items": {
"type": "string",
"format": "int64"
}
}
},
"title": "GetMulti() rpc request and response"
},
From the proto definition for:
message GetMultiRequest {
repeated int64 userIDs = 1;
}
It seems single fields (non-repeating) for int64 also get encoded as "string".
titpetric commented
Invalid issue, FML: https://github.com/golang/protobuf/blob/master/jsonpb/encode.go#L542
titpetric commented
I’m reopening this, partially because integers can be int64 formatted by swagger spec, as the main target isn’t nodejs/javascript, but any environment that may support int64 natively.
titpetric commented
PB encoding is defaulted to strings, so... closing this.