Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Components ¶ added in v0.1.1
type Components struct {
SecuritySchemes map[string]SecurityScheme `json:"securitySchemes" yaml:"securitySchemes"`
Schemas map[string]Schema `json:"schemas" yaml:"schemas"`
}
type Document ¶
type Document struct {
OpenAPI string `json:"openapi" yaml:"openapi"`
Info Info `json:"info" yaml:"info"`
Servers []Server `json:"servers" yaml:"servers"`
Paths map[string]PathItem `json:"paths" yaml:"paths"`
Components Components `json:"components" yaml:"components"`
Security []SecurityRequirement `json:"security" yaml:"security"`
SecuritySet bool `json:"-" yaml:"-"`
}
func LoadFileWithOptions ¶ added in v0.11.0
func LoadFileWithOptions(path string, options LoadOptions) (*Document, error)
LoadFileWithOptions loads an OpenAPI document with an explicit reference policy.
func (*Document) Operations ¶
func (d *Document) Operations() []OperationView
type LoadOptions ¶ added in v0.11.0
type LoadOptions struct {
ExternalRefRoot string
RemoteRefHosts []string
HTTPClient *http.Client
MaxReferenceBytes int64
}
LoadOptions controls how OpenAPI external references are resolved. Local references are restricted to ExternalRefRoot; remote references must match one of RemoteRefHosts.
type OAuth2Flow ¶ added in v0.10.0
type Operation ¶
type Operation struct {
OperationID string `json:"operationId" yaml:"operationId"`
Summary string `json:"summary" yaml:"summary"`
Description string `json:"description" yaml:"description"`
Parameters []Parameter `json:"parameters" yaml:"parameters"`
RequestBody *RequestBody `json:"requestBody" yaml:"requestBody"`
Responses map[string]Response `json:"responses" yaml:"responses"`
Security []SecurityRequirement `json:"security" yaml:"security"`
SecuritySet bool `json:"-" yaml:"-"`
}
type OperationView ¶
type Parameter ¶
type Parameter struct {
Name string `json:"name" yaml:"name"`
In string `json:"in" yaml:"in"`
Required bool `json:"required" yaml:"required"`
Style string `json:"style" yaml:"style"`
Explode *bool `json:"explode" yaml:"explode"`
AllowReserved bool `json:"allowReserved" yaml:"allowReserved"`
Schema Schema `json:"schema" yaml:"schema"`
}
type PathItem ¶
type PathItem struct {
Summary string `json:"summary" yaml:"summary"`
Description string `json:"description" yaml:"description"`
Parameters []Parameter `json:"parameters" yaml:"parameters"`
Get *Operation `json:"get" yaml:"get"`
Post *Operation `json:"post" yaml:"post"`
Put *Operation `json:"put" yaml:"put"`
Patch *Operation `json:"patch" yaml:"patch"`
Delete *Operation `json:"delete" yaml:"delete"`
}
type RequestBody ¶
type Schema ¶
type Schema struct {
Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
Type string `json:"type" yaml:"type"`
Format string `json:"format" yaml:"format"`
Description string `json:"description" yaml:"description"`
Required []string `json:"required" yaml:"required"`
Properties map[string]Schema `json:"properties" yaml:"properties"`
Items *Schema `json:"items" yaml:"items"`
OneOf []Schema `json:"oneOf,omitempty" yaml:"oneOf,omitempty"`
AnyOf []Schema `json:"anyOf,omitempty" yaml:"anyOf,omitempty"`
AllOf []Schema `json:"allOf,omitempty" yaml:"allOf,omitempty"`
Enum []any `json:"enum" yaml:"enum"`
AdditionalProperties any `json:"additionalProperties" yaml:"additionalProperties"`
}
type SecurityRequirement ¶ added in v0.4.0
type SecurityScheme ¶ added in v0.1.1
type SecurityScheme struct {
Type string `json:"type" yaml:"type"`
Name string `json:"name" yaml:"name"`
In string `json:"in" yaml:"in"`
Scheme string `json:"scheme" yaml:"scheme"`
BearerFormat string `json:"bearerFormat" yaml:"bearerFormat"`
Flows map[string]OAuth2Flow `json:"flows" yaml:"flows"`
}
Click to show internal directories.
Click to hide internal directories.