Exclude get, create, and update RPC Responses from rpc_allow_same_request_response Linter Rule #3457
Riku-programming
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
We disagree with this approach, and disagree with the Google API Design Guide's position on this matter. Separate request and response types are important to make sure that the changes to one RPC do not guarantee changes to other RPCs (however, of course, types referenced by these request/responses may change and affect multiple RPCs). |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I propose updating the
rpc_allow_same_request_response
linter rule to exclude get, create, and update RPCs from requiring separate response types.This adjustment would align with the Google API Design Guide, which recommends returning the resource directly for these RPCs.
Details
The current
rpc_allow_same_request_response
rule mandates that all RPCs use distinct response messages, which is beneficial for flexibility in some cases. However, Google’s API Design Guide specifies that get, create, and update methods should directly return the resource object.According to the buf document, this setting is enabled by default.
I understand that this linter is enabled when defining request messages, etc., but I think it is redundant that this linter also issues warnings for get, create, and update response messages.
Example
Currently:
Proposed Behavior(No Linter Warning)
I'd like to hear your opinions. Thanks for taking a look.
Beta Was this translation helpful? Give feedback.
All reactions