cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.22k stars 3.6k forks source link

Upgrade to grpc-gateway V2 #8055

Open amaury1093 opened 3 years ago

amaury1093 commented 3 years ago

Summary

Upgrade to grpc-gateway V2

Problem Definition

From the author:

The grpc-gateway v1 is in maintenance mode, you are encouraged to migrate to v2. Check out our v2 migration guide.

Proposal

Follow the migration guide.


For Admin Use

amaury1093 commented 2 years ago

Note that grpc-gateway in v2 defaults to camelCase, which is also the default ProtoJSON spec case.

We should make a decision whether to switch to camelCase everywhere (con: huge client breaking change) or stick with camel_case (con: not following SPEC).

My preference is to eventually switch to camelCase, so that we don't have inconsistencies anymore, see e.g. (totalWeight vs total_weight in the docs).

(credits to @haveanicedavid for flagging this)

aaronc commented 2 years ago

I believe this will only be possible once we migrate away from gogo to google.golang.org/protobuf.

alexanderbez commented 2 years ago

I personally hate seeing camel-case in JSON, but this is what Google recommends so 🤷

aaronc commented 2 years ago

I personally hate seeing camel-case in JSON, but this is what Google recommends so 🤷

I really would prefer to stick to the proto names for fields in JSON. It is configurable and I think we should take advantage of that.

julienrbrt commented 1 month ago

Is that something we should do while adding it to server/v2? ref: https://github.com/cosmos/cosmos-sdk/issues/20798

cc @tac0turtle & @testinginprod