cs3org / reva

WebDAV/gRPC/HTTP high performance server to link high level clients to storage backends
https://reva.link
Apache License 2.0
165 stars 113 forks source link

protobuf should be un-/marshaled using protojson, not encoding/json #4704

Open butonic opened 1 month ago

butonic commented 1 month ago

OMG ... protobuf generated code has a json tag that uses snake_case AND a protobuf tag that uses camel case:

    // REQUIRED.
    // The list of app providers which can open this mime type
    AppProviders []*ProviderInfo `protobuf:"bytes,4,rep,name=app_providers,json=appProviders,proto3" json:"app_providers,omitempty"`

But the json tag and encoding/json should not be used:

Generation of the json tags was a historical mistake. If we could go back in time, we would not have generated it. It gives the illusion that protobuf messages work correctly with encoding/json, but they don't.

Unfortunately, we are using encoding/json all over the place. google.golang.org/protobuf/encoding/protojson should be used.

AFAICT that would change all the generated json clients rely on ... 😞