Documentation
ยถ
Index ยถ
Constants ยถ
This section is empty.
Variables ยถ
This section is empty.
Functions ยถ
This section is empty.
Types ยถ
type Generator ยถ
type Generator interface {
Router
// Validate checks for errors at OpenAPI router initialization.
Validate() error
// ValidateReport validates the schema and returns all findings.
ValidateReport() error
// GenerateSchema generates the OpenAPI schema in the specified format.
GenerateSchema(format ...string) ([]byte, error)
// MarshalYAML marshals the OpenAPI schema to YAML format.
MarshalYAML() ([]byte, error)
// MarshalJSON marshals the OpenAPI schema to JSON format.
MarshalJSON() ([]byte, error)
// WriteSchemaTo writes the OpenAPI schema to a file.
WriteSchemaTo(filePath string) error
}
Generator defines the interface for generating OpenAPI schemas.
func NewGenerator ยถ
func NewGenerator(r fiber.Router, opts ...option.OpenAPIOption) Generator
NewGenerator creates a new OpenAPI generator with the specified Fiber v3 router and options.
It initializes the OpenAPI router and sets up the necessary routes for OpenAPI documentation.
type Route ยถ
type Route interface {
// With applies the given options to the route.
With(opts ...option.OperationOption) Route
}
Route represents a single route in the OpenAPI specification.
type Router ยถ
type Router interface {
// Use applies middleware to the router.
Use(args ...any) Router
// Get registers a GET route.
Get(path string, handler ...fiber.Handler) Route
// Head registers a HEAD route.
Head(path string, handler ...fiber.Handler) Route
// Post registers a POST route.
Post(path string, handler ...fiber.Handler) Route
// Put registers a PUT route.
Put(path string, handler ...fiber.Handler) Route
// Patch registers a PATCH route.
Patch(path string, handler ...fiber.Handler) Route
// Delete registers a DELETE route.
Delete(path string, handler ...fiber.Handler) Route
// Connect registers a CONNECT route.
// CONNECT operations are emitted only for OpenAPI 3.2.0.
Connect(path string, handler ...fiber.Handler) Route
// Options registers an OPTIONS route.
Options(path string, handler ...fiber.Handler) Route
// Trace registers a TRACE route.
Trace(path string, handler ...fiber.Handler) Route
// Add registers a route with the specified method and path.
Add(method, path string, handler ...fiber.Handler) Route
// Group creates a new sub-router with the specified prefix and handlers.
// The prefix is prepended to all routes in the sub-router.
Group(prefix string, handlers ...fiber.Handler) Router
// Route creates a new sub-router with the specified prefix and applies options.
Route(prefix string, fn func(router Router), opts ...option.GroupOption) Router
// With applies options to the router.
// This allows you to configure tags, security, and visibility for the routes.
With(opts ...option.GroupOption) Router
}
Router defines the interface for an OpenAPI router.
Click to show internal directories.
Click to hide internal directories.