elliots/protoc-gen-twirp_swagger

Incorrect type gen for []int64 (repeated int64), single int64 fields

titpetric opened this issue · 3 comments

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".

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.

PB encoding is defaulted to strings, so... closing this.