Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectOAuthScopes ¶
CollectOAuthScopes returns all scopes referenced by security requirements in sorted order. It includes document-level and operation-level requirements.
Types ¶
type Endpoint ¶
type Endpoint struct {
Method string
Path string
OperationID string
Summary string
Description string
Tags []string
PathParams []Param
QueryParams []Param
HeaderParams []Param
CookieParams []Param
RequestBody *RequestBody
Security []string
Deprecated bool
Responses []ResponseInfo
SecurityInfo []SecurityInfo
SecurityRequirements []SecurityRequirement
ExternalDocs string
BaseURL string
Servers []ServerInfo
}
Endpoint represents a parsed API endpoint from the spec.
type MediaType ¶
type MediaType struct {
ContentType string
Schema map[string]any
Examples []any
Encoding map[string]Encoding
}
MediaType describes a concrete request or response media type.
type Param ¶
type Param struct {
Name string
Description string
Required bool
Type string
Default any
Enum []any
Format string
Minimum *float64
Maximum *float64
MinLength *uint64
MaxLength *uint64
Style string
Explode bool
AllowReserved bool
AllowEmptyValue bool
Deprecated bool
Schema map[string]any
ContentType string
Examples []any
}
Param describes an API parameter.
type RequestBody ¶
RequestBody describes the request body schema.
type ResponseHeader ¶
ResponseHeader describes a header returned in a response.
type ResponseInfo ¶
type ResponseInfo struct {
StatusCode string
Description string
Content []MediaType
Headers []ResponseHeader
}
ResponseInfo describes a single HTTP response from the spec.
type SecurityInfo ¶
type SecurityInfo struct {
Name string
Type string
In string
ParameterName string
Scheme string
BearerFormat string
Description string
OpenIDConnectURL string
Scopes []string
}
SecurityInfo describes a security scheme with its full details.
type SecurityRequirement ¶
type SecurityRequirement struct {
Schemes []SecurityInfo
}
SecurityRequirement describes a logical AND of security schemes. Multiple entries on Endpoint.SecurityRequirements are OR alternatives.
type ServerInfo ¶
ServerInfo describes a resolved server entry from the OpenAPI document.