Skip to content

Commit

Permalink
fix: replace erroneous use of "Get" with "Delete" for AIP-135 (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
apasel422 authored Sep 16, 2020
1 parent 4c58450 commit cb2a30f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rules/aip0135/http_body_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ func TestHttpBody(t *testing.T) {
// Create a MethodOptions with the annotation set.
opts := &dpb.MethodOptions{}
httpRule := &annotations.HttpRule{
Pattern: &annotations.HttpRule_Get{
Get: "/v1/{name=publishers/*/books/*}",
Pattern: &annotations.HttpRule_Delete{
Delete: "/v1/{name=publishers/*/books/*}",
},
Body: test.body,
}
proto.SetExtension(opts, annotations.E_Http, httpRule)

// Create a minimal service with a AIP-135 Get method
// Create a minimal service with a AIP-135 Delete method
// (or with a different method, in the "Irrelevant" case).
service, err := builder.NewService("Library").AddMethod(builder.NewMethod(test.methodName,
builder.RpcTypeMessage(builder.NewMessage("DeleteBookRequest"), false),
Expand Down
2 changes: 1 addition & 1 deletion rules/aip0135/request_name_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var requestNameField = &lint.FieldRule{
LintField: func(f *desc.FieldDescriptor) []lint.Problem {
if f.GetType() != builder.FieldTypeString().GetType() {
return []lint.Problem{{
Message: "`name` field on Get RPCs should be a string",
Message: "`name` field on Delete RPCs should be a string",
Suggestion: "string",
Descriptor: f,
Location: locations.FieldType(f),
Expand Down

0 comments on commit cb2a30f

Please sign in to comment.