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

refactor: remove dependency on gin #800

Merged
merged 5 commits into from
Nov 22, 2020
Merged

Conversation

akojo
Copy link
Contributor

@akojo akojo commented Oct 3, 2020

Describe the PR
Since swag doesn't have a direct dependency on gin-gonic/gin, drop it as a dependency in the main module:

  • Add go.mod into examples so that they can be used stand-alone and pull in correct deps
  • Use http package for handlers instead of gin in tests
  • Use http in example/basic since tests depend on in
  • Clean up main go.mod

Relation issue
#796

@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

Merging #800 (0301453) into master (c9056f0) will increase coverage by 1.06%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #800      +/-   ##
==========================================
+ Coverage   83.82%   84.88%   +1.06%     
==========================================
  Files           8        8              
  Lines        1663     1654       -9     
==========================================
+ Hits         1394     1404      +10     
+ Misses        159      145      -14     
+ Partials      110      105       -5     
Impacted Files Coverage Δ
parser.go 82.01% <91.66%> (+2.16%) ⬆️

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 c9056f0...0301453. Read the comment docs.

@easonlin404
Copy link
Member

@akojo could you help rebase master and fix conflicts?

@akojo
Copy link
Contributor Author

akojo commented Oct 5, 2020

@akojo could you help rebase master and fix conflicts?

Ah, again master ran away 😃 . Rebased.

@touyu
Copy link

touyu commented Oct 16, 2020

Is this PR still working?

I'm using echo-swagger, I'm having trouble with swaggo/gin-swagger#128 because swag depends on gin-swagger.

@akojo
Copy link
Contributor Author

akojo commented Oct 28, 2020

Is there something I could help with to get this moving?

@ubogdan
Copy link
Contributor

ubogdan commented Oct 29, 2020

@akojo in order to review your PR we need to see CI tests passing.

@akojo
Copy link
Contributor Author

akojo commented Nov 5, 2020

Hmm, any idea why go1.13 tests fail? Running that specific test doesn't work on my fork since the paths don't match

@akojo
Copy link
Contributor Author

akojo commented Nov 13, 2020

Heh, silly me. Didn't realize that my changes to examples/ broke the build

@ubogdan
Copy link
Contributor

ubogdan commented Nov 13, 2020

For some reason, the coverage decreased by 0.25 and the checks are failing.
@easonlin404 I can't merge the PR due to this issue.

@akojo
Copy link
Contributor Author

akojo commented Nov 18, 2020

🤔 Looks like updating github.com/go-openapi/spec to v0.19.14 breaks the build by changing the formatting of output slightly

@akojo
Copy link
Contributor Author

akojo commented Nov 18, 2020

See #835

sdghchj
sdghchj previously approved these changes Nov 19, 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

@akojo
Copy link
Contributor Author

akojo commented Nov 20, 2020

That -0.13% coverage decrease seems to be bogus since parser test should never hit the line in question in the first place. Only duplicate @ID declaration in tests is in a POST annotation 🤔

Since tests only test parsing of go source and swaggo special comments,
an advanced router is not really necessary
Since testdata/nested doesn't point to outside packages anymore, this
caused nested parsing test to skip exercising one if-branch. Add more
nesting to nested2 to regain that.
Remove duplication in code that checks for duplicate operation ids
Also exercise rest of HTTP methods when testing for duplicate @id
detection
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

@sdghchj sdghchj merged commit 3d083d3 into swaggo:master Nov 22, 2020
@akojo akojo deleted the dont-depend-on-gin branch November 22, 2020 16:56
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.

None yet

5 participants