Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Definitions containing URLs with trailing slashes won't compile #370

Closed
zweizeichen opened this issue Apr 21, 2017 · 2 comments
Closed

Definitions containing URLs with trailing slashes won't compile #370

zweizeichen opened this issue Apr 21, 2017 · 2 comments

Comments

@zweizeichen
Copy link

Hi,
Thank you for maintaining this project! Just a quick question. I just tried compiling my definition containing a URL containing a trailing slash:

get: "/v1/my/endpoint/param/{param_value}/"

When I try to compile that definition, I get this error:

--grpc-gateway_out: segment neither wildcards, literal or variable: expected "{" but got "\x00": /v1/my/endpoint/param/{param_value}/

See: parse.go:150
Seems like it does not expect the segment started by the trailing slash to end instantly. Without the trailing slash everything just works. Is this a deliberate design choice or simply a bug? If it is a design choice, providing a more helpful error message might be a good idea. If it's a bug, it should be fairly easy to fix.

@tamalsaha
Copy link
Collaborator

@zweizeichen , gateway follows Google's http.proto spec https://github.com/googleapis/googleapis/blob/master/google/api/http.proto#L214

This spec does not allow trailing slash.

@zweizeichen
Copy link
Author

Thanks! That answers my question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants