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

Error while defining enum comments #897

Closed
fahernandez opened this issue Mar 6, 2019 · 3 comments
Closed

Error while defining enum comments #897

fahernandez opened this issue Mar 6, 2019 · 3 comments

Comments

@fahernandez
Copy link
Contributor

Steps to reproduce the issue

Steps

  1. Define an enum proto message with comments containing a .
// DeepEnum is one or zero.
enum DeepEnum {
    // FALSE is false.
    FALSE = 0;
   // TRUE is true.
   TRUE = 1;
}

// DeepEnum comment.<--This dot
DeepEnum ok = 3 [(grpc.gateway.protoc_gen_swagger.options.openapiv2_field) = {description: "DeepEnum description."}];
  1. Generate the swagger documentation.

Expected behavior

  1. The swagger code is generated without errors

Actual behavior

  1. An error code is triggered.

Hipotesis
This error is triggered by an error on protoc-gen-swagger/genswagger/template.go:1268. The solution is to refactor the if behavior.

If you remove the dot from the comment it will generate the swagger code without errors.

@johanbrandhorst
Copy link
Collaborator

What does the generated swagger look like? Would you like to contribute a fix for this?

@fahernandez
Copy link
Contributor Author

fahernandez commented Mar 6, 2019

The swagger file is not generated due the error code. Sure, I will fix it.

@johanbrandhorst
Copy link
Collaborator

Fixed by #898

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