gin-swagger icon indicating copy to clipboard operation
gin-swagger copied to clipboard

Update multiple API example

Open fzdy1914 opened this issue 2 years ago • 2 comments

Describe the PR Update the example to use NewHandler()

Relation issue https://github.com/swaggo/gin-swagger/issues/197 https://github.com/swaggo/gin-swagger/issues/223

Additional context Reason for the fix: swaggerFiles.Handler is one single instance and patching the Prefix twice will end up making the request from first prefix invalid.

fzdy1914 avatar Aug 03 '22 03:08 fzdy1914

Would you mind adding a unit test proving that CSS files are accessible after accessing the second API endpoint?

ubogdan avatar Aug 03 '22 05:08 ubogdan

Codecov Report

Merging #224 (791e433) into master (b9e926c) will not change coverage. The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #224   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           98        98           
=========================================
  Hits            98        98           

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 b9e926c...791e433. Read the comment docs.

codecov[bot] avatar Aug 03 '22 05:08 codecov[bot]