Skip to content

Commit

Permalink
fix(AIP-235): allow hosting allow_missing (#1416)
Browse files Browse the repository at this point in the history
Allow hoisting `allow_missing` to the top level for Batch Delete. It is an allowed field for Standard Delete and it is not necessarily unique to each delete request (like `etag`), so it can be safely hoisted. 

Updates #1404
  • Loading branch information
noahdietz committed Aug 9, 2024
1 parent 6874dab commit 6bfbcdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions rules/aip0235/request_unknown_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var requestUnknownFields = &lint.FieldRule{
},
LintField: func(field *desc.FieldDescriptor) []lint.Problem {
allowedFields := stringset.New(
"allow_missing", // AIP-135
"force", // AIP-135
"names", // AIP-235
"parent", // AIP-235
Expand Down
3 changes: 2 additions & 1 deletion rules/aip0235/request_unknown_fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ func TestRequestUnknownFields(t *testing.T) {
FieldName string
problems testutils.Problems
}{
{"Valid-AllowMissing", "BatchDeleteBooks", "allow_missing", testutils.Problems{}},
{"Valid-Force", "BatchDeleteBooks", "force", testutils.Problems{}},
{"Valid-Names", "BatchDeleteBooks", "names", testutils.Problems{}},
{"Valid-Parent", "BatchDeleteBooks", "parent", testutils.Problems{}},
{"Valid-RequestID", "BatchCreateBooks", "request_id", testutils.Problems{}},
{"Valid-RequestID", "BatchDeleteBooks", "request_id", testutils.Problems{}},
{"Valid-Requests", "BatchDeleteBooks", "requests", testutils.Problems{}},
{"Valid-ValidateOnly", "BatchDeleteBooks", "validate_only", testutils.Problems{}},
{"Invalid", "BatchDeleteBooks", "foo", testutils.Problems{{Message: "Unexpected field"}}},
Expand Down

0 comments on commit 6bfbcdf

Please sign in to comment.