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 quotes and tabs in general API description #743

Merged
merged 14 commits into from
Aug 3, 2021

Conversation

j0s
Copy link
Contributor

@j0s j0s commented Jul 6, 2020

Describe the PR
Handle quotes and tabs in general API description. The two-stage application of templates when generating docs.go, and then applying a template in ReadDoc(), resulted in escaping of quotation mark getting lost. This PR re-adds adds those quotations using a less than beautiful workaround, but at least it works on my test cases.
It also adds a test that compiles the generated file docs.go, runs the ReadDoc() method, and compares the output to a template.

Related issue
#738

Additional context
I stumbled upon this when expanding my documentation using markdown. When writing long descriptions, supporting quotation marks and tabs would be very useful.

j0s added 2 commits July 6, 2020 13:37
Re-add escaping of quotes when applying template in ReadDoc()
Add test for verifying output of ReadDoc()
sdghchj
sdghchj previously approved these changes Jul 9, 2020
Copy link
Member

@sdghchj sdghchj left a comment

Choose a reason for hiding this comment

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

LGTM

@easonlin404
Copy link
Member

@j0s sorry, because ci check had some issue there before. could you help retry the build again? eg: some minor changes

@codecov
Copy link

codecov bot commented Jul 11, 2020

Codecov Report

Merging #743 (a98eccc) into master (19e5237) will decrease coverage by 2.74%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #743      +/-   ##
==========================================
- Coverage   84.83%   82.09%   -2.75%     
==========================================
  Files           8        8              
  Lines        1649     1737      +88     
==========================================
+ Hits         1399     1426      +27     
- Misses        145      193      +48     
- Partials      105      118      +13     
Impacted Files Coverage Δ
gen/gen.go 95.41% <100.00%> (+0.14%) ⬆️
schema.go 86.74% <0.00%> (-11.98%) ⬇️
parser.go 76.94% <0.00%> (-5.07%) ⬇️
types.go 100.00% <0.00%> (ø)
swagger.go 100.00% <0.00%> (ø)
operation.go 88.46% <0.00%> (+0.79%) ⬆️
packages.go 73.33% <0.00%> (+2.85%) ⬆️
debug.go 50.00% <0.00%> (+30.00%) ⬆️

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 19e5237...949c0d0. Read the comment docs.

@j0s
Copy link
Contributor Author

j0s commented Jul 11, 2020

Ok, so I fixed a linting error. But the coverage must be caused by codecov not being run for a while right? It's complaining that coverage of parser.go has decreased, but I haven't touched that file?

@j0s
Copy link
Contributor Author

j0s commented Aug 17, 2020

Is there anything blocking this from being merged, except for the travis job that does not seem to run?

@j0s
Copy link
Contributor Author

j0s commented Sep 8, 2020

I would still like this to be merged if it looks good to you.

@jecolasurdo
Copy link

Any movement on this?

@sdghchj sdghchj merged commit 6f2abdd into swaggo:master Aug 3, 2021
@ubogdan ubogdan mentioned this pull request Aug 3, 2021
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.

5 participants