Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lint] protobufer types should(n't) be named after RPC name #4485

Closed
JordiSubira opened this issue Mar 15, 2024 · 1 comment
Closed

[lint] protobufer types should(n't) be named after RPC name #4485

JordiSubira opened this issue Mar 15, 2024 · 1 comment

Comments

@JordiSubira
Copy link
Contributor

JordiSubira commented Mar 15, 2024

Currently the linting complains if we want to use the well-known types google.protobuf.Empty https://protobuf.dev/reference/protobuf/google.protobuf/#empty.

proto/daemon/v1/daemon.proto:40:19:RPC request type "Empty" should be named "PortRangeRequest" or "DaemonServicePortRangeRequest".

In the same document, they encourage to use it to avoid duplicity and having a myriad of protobuf types which are empty. Is there a good reason why we would like to have one empty type for request?

@matzf
Copy link
Contributor

matzf commented Jul 12, 2024

Done, in #4344 we've set rpc_allow_google_protobuf_empty_requests/rpc_allow_google_protobuf_empty_responses to true in buf.yaml.

FWIW, the rationale for disallowing the Empty type is source code compatibility (which is what the tooling that "buf" sells wants to achieve); if Empty needs to be changed to something non-empty, the generated wrapper code will have different types. In the wire format, this is perfectly compatible. I don't see that we're striving for this level of automatic and complete API compatibility, so allowing to use Empty is fine.

@matzf matzf closed this as completed Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants