Documentation
¶
Index ¶
- func Delete[TInput any, TOutput any, TError any](router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], ...)
- func Get[TInput any, TOutput any, TError any](router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], ...)
- func Head[TInput any, TOutput any, TError any](router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], ...)
- func Method[TInput any, TOutput any, TError any](router OApiRouter, m string, path string, ...)
- func Patch[TInput any, TOutput any, TError any](router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], ...)
- func Post[TInput any, TOutput any, TError any](router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], ...)
- func Put[TInput any, TOutput any, TError any](router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], ...)
- type Config
- type DocConfig
- type HandlerFunc
- type OApiApp
- func (o *OApiApp) Config() Config
- func (o *OApiApp) GenerateOpenAPISpec() map[string]interface{}
- func (o *OApiApp) GetApp() *OApiApp
- func (o *OApiApp) GetOperations() []OpenAPIOperation
- func (o *OApiApp) GetPrefix() string
- func (app *OApiApp) Group(prefix string, handlers ...fiber.Handler) *OApiGroup
- func (o *OApiApp) SetupDocs(config ...DocConfig)
- type OApiGroup
- type OApiRouter
- type OpenAPIOperation
- type OpenAPIOptions
- type OpenAPIParameter
- type OpenAPIRequestBody
- type OpenAPIResponse
- type PathInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶ added in v1.2.0
func Delete[TInput any, TOutput any, TError any]( router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], options OpenAPIOptions, )
Delete defines a DELETE operation for the OpenAPI documentation
func Get ¶ added in v1.2.0
func Get[TInput any, TOutput any, TError any]( router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], options OpenAPIOptions, )
Get defines a GET operation for the OpenAPI documentation
func Head ¶ added in v1.2.0
func Head[TInput any, TOutput any, TError any]( router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], options OpenAPIOptions, )
Head defines a HEAD operation for the OpenAPI documentation
func Method ¶ added in v1.2.0
func Method[TInput any, TOutput any, TError any]( router OApiRouter, m string, path string, handler HandlerFunc[TInput, TOutput, TError], options OpenAPIOptions, )
Method defines a generic method for registering HTTP operations with OpenAPI documentation
func Patch ¶ added in v1.2.0
func Patch[TInput any, TOutput any, TError any]( router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], options OpenAPIOptions, )
Patch defines a PATCH operation for the OpenAPI documentation
func Post ¶ added in v1.2.0
func Post[TInput any, TOutput any, TError any]( router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], options OpenAPIOptions, )
Post defines a POST operation for the OpenAPI documentation
func Put ¶ added in v1.2.0
func Put[TInput any, TOutput any, TError any]( router OApiRouter, path string, handler HandlerFunc[TInput, TOutput, TError], options OpenAPIOptions, )
Put defines a PUT operation for the OpenAPI documentation
Types ¶
type Config ¶
type Config struct {
EnableValidation bool // Enable request validation (default: true)
EnableOpenAPIDocs bool // Enable automatic docs setup (default: true)
OpenAPIDocsPath string // Path for documentation UI (default: "/docs")
OpenAPIJSONPath string // Path for OpenAPI JSON spec (default: "/openapi.json")
}
Config represents configuration for the OApi wrapper
type DocConfig ¶
type DocConfig struct {
Title string
Description string
Version string
DocsPath string // Path where docs will be served, default: "/docs"
JSONPath string // Path where OpenAPI JSON will be served, default: "/openapi.json"
}
DocConfig contains configuration for the documentation
func DefaultDocConfig ¶
func DefaultDocConfig() DocConfig
DefaultDocConfig returns default documentation configuration
type HandlerFunc ¶
type HandlerFunc[TInput any, TOutput any, TError any] func(c *fiber.Ctx, input TInput) (TOutput, TError)
HandlerFunc represents a handler function with typed input and output
type OApiApp ¶
type OApiApp struct {
// contains filtered or unexported fields
}
OApiApp wraps fiber.App with OpenAPI capabilities
func (*OApiApp) GenerateOpenAPISpec ¶
GenerateOpenAPISpec generates a complete OpenAPI 3.0 specification
func (*OApiApp) GetOperations ¶
func (o *OApiApp) GetOperations() []OpenAPIOperation
GetOperations returns all registered operations (useful for testing and documentation generation)
type OApiGroup ¶ added in v1.2.0
type OApiGroup struct {
fiber.Router // Embedded fiber.Router (includes all standard Fiber methods)
// contains filtered or unexported fields
}
OApiGroup wraps a fiber.Router and adds OpenAPI methods
func Group ¶ added in v1.2.0
func Group(router OApiRouter, prefix string, handlers ...fiber.Handler) *OApiGroup
Group creates a new group from an OApiRouter (app or group)
type OApiRouter ¶ added in v1.2.0
OApiRouter interface that both OApiApp and OApiGroup implement
type OpenAPIOperation ¶
type OpenAPIOperation struct {
Method string
Path string
Options OpenAPIOptions
InputType reflect.Type
OutputType reflect.Type
ErrorType reflect.Type
}
OpenAPIOperation represents a registered operation
type OpenAPIOptions ¶
type OpenAPIOptions struct {
OperationID string `json:"operationId,omitempty"`
Tags []string `json:"tags,omitempty"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Parameters []map[string]interface{} `json:"parameters,omitempty"`
}
OpenAPIOptions represents options for OpenAPI operations