Skip to content

Commit

Permalink
Merge pull request #83 from vortex14/swagger
Browse files Browse the repository at this point in the history
updated swagger docs
  • Loading branch information
vortex14 authored Sep 4, 2023
2 parents 9185dff + 96a889a commit deb3a5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions extensions/servers/gin/domains/component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/vortex14/gotyphoon/log"
)


func Constructor(
name string,
labels *label.MetaInfo,
Expand All @@ -20,18 +19,16 @@ func Constructor(

) interfaces.ServerInterface {

componentServer := (
&gin.TyphoonGinServer{
TyphoonServer: &forms.TyphoonServer{
MetaInfo: labels,
Port: project.LoadConfig().GetComponentPort(name),
Level: project.GetLogLevel(),
componentServer := (&gin.TyphoonGinServer{
TyphoonServer: &forms.TyphoonServer{
MetaInfo: labels,
Port: project.LoadConfig().GetComponentPort(name),
Level: project.GetLogLevel(),

TracingOptions: tracingOptions,
SwaggerOptions: swaggerOptions,
LoggerOptions: loggerOptions,
},
}).
TracingOptions: tracingOptions,
LoggerOptions: loggerOptions,
},
}).
Init().
InitLogger().
InitTracer()
Expand Down
2 changes: 1 addition & 1 deletion extensions/servers/gin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (s *TyphoonGinServer) Init() interfaces.ServerInterface {

if s.ActiveSwagger {
s.server.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler,
ginSwagger.URL(fmt.Sprintf("%s://%s:%d/docs", s.Schema, s.Host, s.Port)),
ginSwagger.URL(fmt.Sprintf("%s://%s/docs", s.Schema, s.Host)),
ginSwagger.DefaultModelsExpandDepth(-1)))

s.server.GET("/docs", func(c *Gin.Context) {
Expand Down

0 comments on commit deb3a5d

Please sign in to comment.