Files
crawlab/core/controllers/openapi.go
Marvin Zhang d6badb533d feat: enhance API routing and OpenAPI documentation support
- Introduced a new OpenAPI wrapper using Fizz for improved API documentation
- Refactored base controller to support more flexible route handling
- Added dynamic route registration with OpenAPI metadata
- Implemented generic response types for consistent API responses
- Updated router initialization to support OpenAPI documentation endpoint
- Improved route and resource naming utilities
- Migrated existing controllers to use new routing and response mechanisms
2025-03-11 23:45:06 +08:00

17 lines
325 B
Go

package controllers
import (
"github.com/gin-gonic/gin"
"github.com/wI2L/fizz/openapi"
)
func GetOpenAPI(c *gin.Context) {
info := &openapi.Info{
Title: "Crawlab API",
Description: "REST API for Crawlab",
Version: "0.7.0",
}
handleFunc := globalWrapper.GetFizz().OpenAPI(info, "json")
handleFunc(c)
}