mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
- Updated GetOpenAPI function to improve clarity by storing the Fizz instance in a variable. - Added security middleware to FizzWrapper for API token authentication, enhancing security measures. - Configured sorting of tags in the OpenAPI generator to maintain consistency in API documentation. - Improved comments for better understanding of the changes made in the OpenAPI wrapper.
20 lines
343 B
Go
20 lines
343 B
Go
package controllers
|
|
|
|
import (
|
|
"github.com/crawlab-team/fizz/openapi"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func GetOpenAPI(c *gin.Context) {
|
|
f := globalWrapper.GetFizz()
|
|
|
|
info := &openapi.Info{
|
|
Title: "Crawlab API",
|
|
Description: "REST API for Crawlab",
|
|
Version: "0.7.0",
|
|
}
|
|
|
|
handleFunc := f.OpenAPI(info, "json")
|
|
handleFunc(c)
|
|
}
|