wI2L / fizz

:lemon: Gin wrapper with OpenAPI 3 spec generation
https://pkg.go.dev/github.com/wI2L/fizz
MIT License
214 stars 52 forks source link

Copy consolidated path for openapi spec #30

Closed Inozuma closed 5 years ago

Inozuma commented 5 years ago

There is currently an issue when using a router group and a tonic handler together. The path is consolidated for the openapi spec operation (but only in case there is a tonic handler), but overrides the path which is later used to declare the route on the underlying gin router.

For example:

r := fizz.New()
g := r.Group("/test", "test", "test group")
g.GET("", tonic.Handler(func (c *gin.Context, in *Input) error {
  ...
}))

This example will declare a route in gin as /test/test instead of just /test.

codecov[bot] commented 5 years ago

Codecov Report

Merging #30 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #30   +/-   ##
======================================
  Coverage    96.7%   96.7%           
======================================
  Files           7       7           
  Lines         942     942           
======================================
  Hits          911     911           
  Misses         18      18           
  Partials       13      13
Impacted Files Coverage Δ
fizz.go 98.8% <100%> (ø) :arrow_up:

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 bf1cff4...81245c5. Read the comment docs.