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

protoc_gen_swagger openapiv2_field definition ignores the type option #1002

Closed
snowzach opened this issue Aug 22, 2019 · 3 comments
Closed

Comments

@snowzach
Copy link
Contributor

snowzach commented Aug 22, 2019

I am using an int64 type inside of my proto specification, I have overriden the JSON encoder/decoder to use a number instead of a string(int64) as I am okay with the 56bit JSON limit but I want it bigger than 32 bit.

I would like the the swagger definition to reflect the proper value.

message Test {
  int64 mynumber = 1 [(grpc.gateway.protoc_gen_swagger.options.openapiv2_field) = {type: NUMBER}];
}

The model in swagger still shows string(int64). Ideally it should instead show something like integer($int32)

It would be ideal if it respected the type option.

@johanbrandhorst
Copy link
Collaborator

Cool, sounds like a great first contribution! The source for this logic is in https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-swagger/genswagger/template.go, please feel free to look around and see if you could contribute this fix! Let me know if you have any questions!

@snowzach
Copy link
Contributor Author

Sure started #1003

@snowzach
Copy link
Contributor Author

snowzach commented Sep 2, 2019

Thanks. All handled now.

@snowzach snowzach closed this as completed Sep 2, 2019
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

2 participants