Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Aron Kyle <aron.kyle@lightspeedhq.com>
  • Loading branch information
ls-aron-kyle committed Oct 17, 2024
1 parent 1c89b33 commit 795f4e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func TestSetParameter(t *testing.T) {
fields: "unknownField",
value: "hello",
want: &testv1.ParameterValues{},
wantErr: "in field path \"unknownField\": element \"unknownField\" does not correspond to any field of type vanguard.test.v1.ParameterValues: unknown field",
wantErr: "unknown field in field path \"unknownField\": element \"unknownField\" does not correspond to any field of type vanguard.test.v1.ParameterValues",
},
}
for _, testCase := range testCases {
Expand Down
2 changes: 1 addition & 1 deletion protocol_http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func TestHTTPEncodePathValues(t *testing.T) {
tmpl: "/v1/{string_value=books/*}:get",
wantPath: "/v1/books/1:get",
wantQuery: url.Values{},
wantErr: "in field path \"unknownQueryParam\": element \"unknownQueryParam\" does not correspond to any field of type vanguard.test.v1.ParameterValues: unknown field",
wantErr: "unknown field in field path \"unknownQueryParam\": element \"unknownQueryParam\" does not correspond to any field of type vanguard.test.v1.ParameterValues",
},
}
for _, testCase := range testCases {
Expand Down
4 changes: 4 additions & 0 deletions vanguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ func WithRESTUnmarshalOptions(options RESTUnmarshalOptions) ServiceOption {
})
}

// RESTUnmarshalOptions contains options for unmarshalling REST requests.
//
// If DiscardUnknownQueryParams is true, any query parameters in a request that do not correspond to a field in the
// request message will be ignored. If false, such query parameters will cause an error. Defaults to false.
type RESTUnmarshalOptions struct {
DiscardUnknownQueryParams bool
}
Expand Down

0 comments on commit 795f4e3

Please sign in to comment.