google / google/apitools

Request message eliding doesn't respect `@OutputOnly` fields

Open
#61 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
157
Forks
131
PR merge metrics
No merged PRs in 30d

Description

A method that takes a path parameter called "foo" and a request body with a field called "foo" has the request message and path parameter elided, assuming that the value of "foo" specified in the request body will be the same one that should be specified in the path.

This ignores the case where the "foo" field in the request body is marked as `@OutputOnly`, where it's not valid to pass the value in the request body.

`--unelidable_request_methods` can specify that the message should not be elided, but ideally the eliding logic would skip eliding messages when `@OutputOnly` is involved.

I believe the necessary change is somewhere in `_NeedRequestType` [here](https://github.com/google/apitools/blob/b780937b9e0e4ddcf249d36ed49c86af8420257b/apitools/gen/service_registry.py#L294).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.