Documentation
¶
Index ¶
- func Generate(outputPath string, title string, version string, routes []RouteInfo, ...) error
- func RegisterDocsRoutes(r *router.Router, openAPIFilePath string)
- type Components
- type Document
- type Info
- type MediaType
- type Operation
- type Parameter
- type PathItem
- type RequestBody
- type ResponseEntry
- type RouteInfo
- type Schema
- type SecurityRequirement
- type SecurityScheme
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDocsRoutes ¶
Types ¶
type Components ¶
type Components struct {
SecuritySchemes map[string]SecurityScheme `json:"securitySchemes,omitempty"`
}
Components holds reusable OpenAPI components.
type Operation ¶
type Operation struct {
OperationID string `json:"operationId,omitempty"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
RequestBody *RequestBody `json:"requestBody,omitempty"`
Responses map[string]ResponseEntry `json:"responses"`
Security []SecurityRequirement `json:"security,omitempty"`
}
type RequestBody ¶
type ResponseEntry ¶
type RouteInfo ¶
type RouteInfo struct {
Method string
Path string
OperationID string
OperationDescription string
TagName string
TagDescription string
Parameters []Parameter
RequestBody *RequestBody
ResponseSchema *Schema
Security []SecurityRequirement
}
type Schema ¶
type Schema struct {
Type string `json:"type,omitempty"`
Format string `json:"format,omitempty"`
Description string `json:"description,omitempty"`
Required []string `json:"required,omitempty"`
Enum []any `json:"enum,omitempty"`
Properties map[string]Schema `json:"properties,omitempty"`
Items *Schema `json:"items,omitempty"`
AdditionalProperties *Schema `json:"additionalProperties,omitempty"`
}
type SecurityRequirement ¶
SecurityRequirement maps a security scheme name to its scopes (empty for most cases).
type SecurityScheme ¶
type SecurityScheme struct {
Type string `json:"type"`
Scheme string `json:"scheme,omitempty"`
BearerFormat string `json:"bearerFormat,omitempty"`
In string `json:"in,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
}
SecurityScheme represents an OpenAPI security scheme definition.
Click to show internal directories.
Click to hide internal directories.