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

Support Enum Types in Path #322

Open
johanbrandhorst opened this issue Mar 6, 2017 · 2 comments
Open

Support Enum Types in Path #322

johanbrandhorst opened this issue Mar 6, 2017 · 2 comments

Comments

@johanbrandhorst
Copy link
Collaborator

Having merged Enum support into the query parameters, would it be possible to now support Enum Types in the path as well? Currently this appears to be limited by

// TODO(yugui) Handle Enum
not being implemented for Enum types.

@patrickwmcgee
Copy link

Hello wonderful grpc-gateway maintainers! I was wondering what the state of this issue is. Currently the Readme.md has the line

Enum fields in path parameter (including repeated enum fields).

This made me think I could use Enum fields in the request path via options like

rpc Echo(MyMessage) returns (SimpleMessage) {
	option (google.api.http) = {
		post: "/v1/example/echo/{my_enum}"
	};
}

Where my_enum is an Enum that is used in MyMessage.

If this is not the case, perhaps the Readme.md could be updated?

@johanbrandhorst
Copy link
Collaborator Author

The wording might not be great, enums are supported in query parameters of the URL, not the path.

maros7 pushed a commit to maros7/grpc-gateway that referenced this issue Aug 28, 2018
Related to grpc-ecosystem#322

Updated protoc-gen-swagger to output enum path parameters correctly

Updated protoc-gen-grpc-gateway to handle enum path parameters

Regenerated examples

Added pathenum proto for an externally imported enum example and verification

Added enum_helper.go to handle the lack of enum support in the swagger-codegen-cli 2.2.2 for Go, see swagger-api/swagger-codegen#5635

Fixed browser integration test cases

Updated bazel config

Fixed last, faulty bazel config

Updated integration test case to test both index == 0 and index > 0 for enums
johanbrandhorst pushed a commit that referenced this issue Aug 29, 2018
Related to #322

Updated protoc-gen-swagger to output enum path parameters correctly

Updated protoc-gen-grpc-gateway to handle enum path parameters

Regenerated examples

Added pathenum proto for an externally imported enum example and verification

Added enum_helper.go to handle the lack of enum support in the swagger-codegen-cli 2.2.2 for Go, see swagger-api/swagger-codegen#5635

Fixed browser integration test cases

Updated bazel config

Fixed last, faulty bazel config

Updated integration test case to test both index == 0 and index > 0 for enums
adasari pushed a commit to adasari/grpc-gateway that referenced this issue Apr 9, 2020
Related to grpc-ecosystem#322

Updated protoc-gen-swagger to output enum path parameters correctly

Updated protoc-gen-grpc-gateway to handle enum path parameters

Regenerated examples

Added pathenum proto for an externally imported enum example and verification

Added enum_helper.go to handle the lack of enum support in the swagger-codegen-cli 2.2.2 for Go, see swagger-api/swagger-codegen#5635

Fixed browser integration test cases

Updated bazel config

Fixed last, faulty bazel config

Updated integration test case to test both index == 0 and index > 0 for enums
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants