Documentation
¶
Overview ¶
Package openapi builds an OpenAPI 3.0.x document from gateway route registrations (ADR 0045).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
Title string `json:"title"`
Version string `json:"version"`
Description string `json:"description,omitempty"`
}
Info is the OpenAPI top-level metadata block.
type Operation ¶
type Operation struct {
Summary string `json:"summary,omitempty"`
Tags []string `json:"tags,omitempty"`
Responses map[string]Response `json:"responses"`
}
Operation is one endpoint's summary + tags.
type PathItem ¶
type PathItem struct {
Get *Operation `json:"get,omitempty"`
Post *Operation `json:"post,omitempty"`
Put *Operation `json:"put,omitempty"`
Patch *Operation `json:"patch,omitempty"`
Delete *Operation `json:"delete,omitempty"`
}
PathItem holds the operations for one path.
type Response ¶
type Response struct {
Description string `json:"description"`
}
Response is a minimal default response entry; every operation advertises the standard JSON envelope.
type Spec ¶
type Spec struct {
// contains filtered or unexported fields
}
Spec accumulates route registrations and renders an OpenAPI 3.0.x document.
func (*Spec) AddSecuritySchemes ¶
func (s *Spec) AddSecuritySchemes()
AddSecuritySchemes declares that the spec carries the bearer auth scheme (used by both user sessions and integration tokens).
func (*Spec) Register ¶
Register adds one operation to the spec; after mounted routes are loaded, it annotates only those operations.
func (*Spec) RegisterMountedRoutes ¶
RegisterMountedRoutes adds every method-bearing route collected from the HTTP gateway.
func (*Spec) SetTagDescription ¶
SetTagDescription annotates a tag shown in the Swagger UI grouping.