MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / swagger

Method swagger

controller/service/iml.go:397–412  ·  view source on GitHub ↗
(ctx *gin.Context, id string)

Source from the content-addressed store, hash-verified

395)
396
397func (i *imlServiceController) swagger(ctx *gin.Context, id string) (*openapi3.T, error) {
398 doc, err := i.apiDocModule.GetDoc(ctx, id)
399 if err != nil {
400 return nil, err
401 }
402 tmp, err := loader.LoadFromData([]byte(doc.Content))
403 if err != nil {
404 return nil, err
405 }
406 cfg := i.settingModule.Get(ctx)
407
408 tmp.AddServer(&openapi3.Server{
409 URL: cfg.InvokeAddress,
410 })
411 return tmp, nil
412}
413
414func (i *imlServiceController) ExportSwagger(ctx *gin.Context) {
415 id, has := ctx.Params.Get("id")

Callers 2

ExportSwaggerMethod · 0.95
SwaggerMethod · 0.95

Calls 2

GetDocMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected