Skip to content

Conversation

@gunadhya
Copy link
Contributor

References to other Issues or PRs

Fixes #1863

Have you read the Contributing Guidelines?

Yes

Brief description of what is fixed or changed

Changes to error format

Before:

return Parameter{}, fmt.Errorf("aggregate type %s in parameter of %s.%s: %s", target.Type, meth.Service.GetName(), meth.GetName(), path)

After:

return Parameter{}, fmt.Errorf("%s.%s: %s is a protobuf message type. Protobuf message types cannot be used as path parameters, use a scalar value type (such as string) instead", meth.Service.GetName(), meth.GetName(), path)

Other comments

@google-cla google-cla bot added the cla: yes label Jan 12, 2021
Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, do you think you could add a test which triggers this error? You can look at

func TestExtractServicesWithPathParam(t *testing.T) {
for an example of a test that uses a path parameter.

@johanbrandhorst johanbrandhorst merged commit a9a27c4 into grpc-ecosystem:master Jan 18, 2021
@johanbrandhorst
Copy link
Collaborator

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poor error message when using message in path parameter

2 participants