swaggo / gin-swagger

gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
3.76k stars 270 forks source link

Allows instance names to be configured #174

Closed writethesky closed 2 years ago

writethesky commented 2 years ago

Describe the PR Allows instance names to be configured

Relation issue swaggo/swag#1022

Additional context When there are multiple Swagger documents, you need to be able to specify the instance name. e. g.
swag.Register("v1", &s{})

r.GET("/swagger/v1/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, func(c *ginSwagger.Config) {
    c.InstanceName = "v1"
}))