aip-dev / google.aip.dev

API Improvement Proposals. https://aip.dev/
Other
1.08k stars 491 forks source link

Proposal: required "response_mask" field in Create and Update response that can be left empty #1123

Open DanielvNiek opened 1 year ago

DanielvNiek commented 1 year ago

Currently, if a create/update method does not return a fully populated resource in their response, this needs to be documented.

Instead of relying on documentation to convey this exception to a client, I am proposing a new required field in create/update methods' response message definitions, called "response_mask" (of type google.protobuf.FieldMask). If the service leaves the field empty, it implies that the returned resource is fully populated, similar to the logic for update and read masks.

toumorokoshi commented 1 year ago

I think this is an interesting idea, and might help with use cases we've looked at regarding policy validation.

Feel free to send a pr!