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

allow multiple Swagger documents (no breaking changes) #1022

Merged
merged 3 commits into from Oct 11, 2021

Conversation

h44z
Copy link
Contributor

@h44z h44z commented Oct 11, 2021

Describe the PR
Allow the registration of multiple Swagger documents with different names.
This PR does not contain any breaking changes as the method signature change is backwards compatible.
It basically solves the problems listed in #885.

Relation issue
To support multiple Swagger documents, the swagger router implementations have to be changed as well:

Additional context
The binary contains one optional extra parameter: swag init --registrationName=custom_name.
This parameter can be used to override the default registration name.

Copy link
Contributor

@ubogdan ubogdan left a comment

Choose a reason for hiding this comment

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

Goog job until now. Please update the code as requested and let's get this merged.

cmd/swag/main.go Outdated Show resolved Hide resolved
swagger.go Outdated Show resolved Hide resolved
gen/gen.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 11, 2021

Codecov Report

Merging #1022 (31380a2) into master (9fb19d0) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1022      +/-   ##
==========================================
+ Coverage   93.29%   93.34%   +0.04%     
==========================================
  Files           7        7              
  Lines        1954     1968      +14     
==========================================
+ Hits         1823     1837      +14     
  Misses         73       73              
  Partials       58       58              
Impacted Files Coverage Δ
gen/gen.go 95.68% <100.00%> (+0.12%) ⬆️
swagger.go 100.00% <100.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 9fb19d0...31380a2. Read the comment docs.

Copy link
Contributor

@ubogdan ubogdan left a comment

Choose a reason for hiding this comment

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

LGTM

@ubogdan ubogdan merged commit 18b2bd1 into swaggo:master Oct 11, 2021
@ubogdan
Copy link
Contributor

ubogdan commented Oct 11, 2021

@h44z Thanks for your contribution!

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

2 participants