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

chore: use standard httpMethod in generated code #4970

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

mmorel-35
Copy link
Contributor

Description

This uses standard httpMethod in generated code instead of their quoted raw value.

Comment on lines +330 to +332
"toHTTPMethod": func(method string) string {
return httpMethods[method]
},
Copy link
Contributor Author

@mmorel-35 mmorel-35 Nov 20, 2024

Choose a reason for hiding this comment

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

@johanbrandhorst,
I was wondering if this deserves a dedicated package as "github.com/grpc-ecosystem/grpc-gateway/v2/internal/casing" is with for example "github.com/grpc-ecosystem/grpc-gateway/v2/internal/mapping", what do you think ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nah this is fine as it is.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
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.

At first I wasn't sure about this, but it is nice to have the constants in the generated code. Thank you!

Comment on lines +330 to +332
"toHTTPMethod": func(method string) string {
return httpMethods[method]
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nah this is fine as it is.

@johanbrandhorst johanbrandhorst merged commit 46d2661 into grpc-ecosystem:main Nov 21, 2024
14 checks passed
@mmorel-35 mmorel-35 deleted the template/httpMethod branch November 21, 2024 06:01
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

Successfully merging this pull request may close these issues.

2 participants