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

897 fixing problem while generating swagger documentation for enum messages #898

Merged
merged 3 commits into from
Mar 7, 2019

Conversation

fahernandez
Copy link
Contributor

No description provided.

@fahernandez
Copy link
Contributor Author

This pull request will fix issue #897

@codecov-io
Copy link

Codecov Report

Merging #898 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #898      +/-   ##
=========================================
+ Coverage   53.69%   53.7%   +0.01%     
=========================================
  Files          39      39              
  Lines        3926    3927       +1     
=========================================
+ Hits         2108    2109       +1     
  Misses       1621    1621              
  Partials      197     197
Impacted Files Coverage Δ
protoc-gen-swagger/genswagger/template.go 56.33% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be12715...e89df15. Read the comment docs.

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.

Firstly, I don't understand what this fixes. Why does the applied change fix a comment that ends in a dot?

Could we add some tests for this case as well?

Thanks

@fahernandez
Copy link
Contributor Author

It's a very strange behavior but if you look line protoc-gen-swagger/genswagger/template.go:1246 you will see a condition to avoid executing a particular flow if the comment has a dot at the end. So when the support for enum and objects annotation was added I forget to take into consideration this case causing in this particular case to fallback to condition protoc-gen-swagger/genswagger/template.go:1275. So basically I'm only changing condition protoc-gen-swagger/genswagger/template.go:1268 to the default fallback that existe before the changes but keeping the code needed to support the comments override behavior.

I don't have a clear idea how to make a test to test particular condition thats why I added an example case on examples/proto/examplepb/a_bit_of_everything.proto:166 to be sure that the problem was fixed but keeping past changes.

Firstly, I don't understand what this fixes. Why does the applied change fix a comment that ends in a dot?

Could we add some tests for this case as well?

Thanks

@johanbrandhorst johanbrandhorst merged commit c0317cd into grpc-ecosystem:master Mar 7, 2019
@johanbrandhorst
Copy link
Collaborator

Thanks for your contribution :)

@fahernandez fahernandez deleted the 897 branch March 7, 2019 16:20
adasari pushed a commit to adasari/grpc-gateway that referenced this pull request Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants