(router *gin.Engine)
| 179 | } |
| 180 | |
| 181 | func registerExtraOpenApiSpecs(router *gin.Engine) { |
| 182 | for name, pluginMeta := range plugin.AllPlugins() { |
| 183 | if pluginOpenApiSpec, ok := pluginMeta.(plugin.PluginOpenApiSpec); ok { |
| 184 | spec := &swag.Spec{ |
| 185 | InfoInstanceName: name, |
| 186 | SwaggerTemplate: pluginOpenApiSpec.OpenApiSpec(), |
| 187 | } |
| 188 | swag.Register(name, spec) |
| 189 | router.GET( |
| 190 | fmt.Sprintf("/plugins/swagger/%s/*any", name), |
| 191 | ginSwagger.CustomWrapHandler( |
| 192 | &ginSwagger.Config{ |
| 193 | URL: "doc.json", |
| 194 | DocExpansion: "list", |
| 195 | InstanceName: name, |
| 196 | Title: fmt.Sprintf("%s API", name), |
| 197 | DefaultModelsExpandDepth: 1, |
| 198 | DeepLinking: true, |
| 199 | PersistAuthorization: false, |
| 200 | }, |
| 201 | swaggerFiles.Handler, |
| 202 | ), |
| 203 | ) |
| 204 | } |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | type bodyTamper struct { |
| 209 | gin.ResponseWriter |
no test coverage detected