6

Why does the protobuf JavaScript code generator suffix collections with the collection type?

For example:

  • repeated string names becomes obj.namesList
  • map<string, string> bar becomes obj.barMap

And this is as per the documentation, here: https://developers.google.com/protocol-buffers/docs/reference/javascript-generated#repeated

Why is that?

It makes life difficult when using grpc-gateway with --swagger_out because the swagger API definitions don't match the generated JavaScript.

David Wolever
  • 148,955
  • 89
  • 346
  • 502

0 Answers0