Documentation
¶
Index ¶
- Variables
- func MarshalYAML(v interface{}) ([]byte, error)
- func MatchAll(_ string) bool
- func MatchExtension(key string) bool
- func MatchNonEmptyKeys(key string) bool
- func NOPNormalizer(s string) string
- func UnmarshalYAML(data []byte, v interface{}) error
- type Callback
- func (s *Callback) ForEach(fn func(string, *PathItem) error) error
- func (s *Callback) Get(key string) *PathItem
- func (s *Callback) GetOK(key string) (*PathItem, bool)
- func (s *Callback) Keys() []string
- func (s Callback) MarshalEasyJSON(w *jwriter.Writer)
- func (s Callback) MarshalJSON() ([]byte, error)
- func (s *Callback) Set(key string, val *PathItem) bool
- func (s *Callback) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (s *Callback) UnmarshalJSON(data []byte) error
- type Components
- type Contact
- type Discriminator
- type Encoding
- type Example
- type Extensions
- func (e *Extensions) Add(key string, value interface{})
- func (e *Extensions) Get(key string) interface{}
- func (e *Extensions) GetBool(key string) (bool, bool)
- func (e *Extensions) GetInt(key string) (int, bool)
- func (e *Extensions) GetInt32(key string) (int32, bool)
- func (e *Extensions) GetInt64(key string) (int64, bool)
- func (e *Extensions) GetOK(key string) (interface{}, bool)
- func (e *Extensions) GetString(key string) (string, bool)
- func (e *Extensions) GetStringSlice(key string) ([]string, bool)
- func (e Extensions) MarshalEasyJSON(w *jwriter.Writer)
- func (e Extensions) MarshalJSON() ([]byte, error)
- func (e *Extensions) Set(key string, value interface{}) bool
- func (e *Extensions) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (e *Extensions) UnmarshalJSON(data []byte) error
- type ExternalDocumentation
- type Filter
- type Header
- type Info
- type License
- type Link
- type MapEntry
- type MediaType
- type Normalizer
- type OAuthFlow
- type OAuthFlows
- type OpenAPI
- type Operation
- type OrderedCallbacks
- type OrderedEncodings
- type OrderedExamples
- func (s *OrderedExamples) ForEach(fn func(string, *Example) error) error
- func (s *OrderedExamples) Get(key string) *Example
- func (s *OrderedExamples) GetOK(key string) (*Example, bool)
- func (s *OrderedExamples) Keys() []string
- func (s OrderedExamples) MarshalJSON() ([]byte, error)
- func (s *OrderedExamples) Set(key string, val *Example) bool
- func (s *OrderedExamples) UnmarshalJSON(data []byte) error
- type OrderedHeaders
- func (s *OrderedHeaders) ForEach(fn func(string, *Header) error) error
- func (s *OrderedHeaders) Get(key string) *Header
- func (s *OrderedHeaders) GetOK(key string) (*Header, bool)
- func (s *OrderedHeaders) Keys() []string
- func (s OrderedHeaders) MarshalJSON() ([]byte, error)
- func (s *OrderedHeaders) Set(key string, val *Header) bool
- type OrderedLinks
- func (s *OrderedLinks) ForEach(fn func(string, *Link) error) error
- func (s *OrderedLinks) Get(key string) *Link
- func (s *OrderedLinks) GetOK(key string) (*Link, bool)
- func (s *OrderedLinks) Keys() []string
- func (s OrderedLinks) MarshalJSON() ([]byte, error)
- func (s *OrderedLinks) Set(key string, val *Link) bool
- type OrderedMap
- func (s *OrderedMap) Delete(k string) bool
- func (s *OrderedMap) Entries() []MapEntry
- func (s *OrderedMap) ForEach(fn func(string, interface{}) error) error
- func (s *OrderedMap) Get(key string) interface{}
- func (s *OrderedMap) GetOK(key string) (interface{}, bool)
- func (s *OrderedMap) Keys() []string
- func (s *OrderedMap) Len() int
- func (s OrderedMap) MarshalEasyJSON(w *jwriter.Writer)
- func (s OrderedMap) MarshalJSON() ([]byte, error)
- func (s *OrderedMap) Set(key string, value interface{}) bool
- func (s OrderedMap) String() string
- func (s *OrderedMap) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (s *OrderedMap) UnmarshalJSON(data []byte) error
- func (s *OrderedMap) Values() []interface{}
- type OrderedMediaTypes
- func (s *OrderedMediaTypes) ForEach(fn func(string, *MediaType) error) error
- func (s *OrderedMediaTypes) Get(key string) *MediaType
- func (s *OrderedMediaTypes) GetOK(key string) (*MediaType, bool)
- func (s *OrderedMediaTypes) Keys() []string
- func (s OrderedMediaTypes) MarshalJSON() ([]byte, error)
- func (s *OrderedMediaTypes) Set(key string, val *MediaType) bool
- func (s *OrderedMediaTypes) UnmarshalJSON(data []byte) error
- type OrderedOperations
- func (s *OrderedOperations) ForEach(fn func(string, *Operation) error) error
- func (s *OrderedOperations) Get(key string) *Operation
- func (s *OrderedOperations) GetOK(key string) (*Operation, bool)
- func (s *OrderedOperations) Keys() []string
- func (s *OrderedOperations) Set(key string, val *Operation) bool
- type OrderedParameters
- func (s *OrderedParameters) ForEach(fn func(string, *Parameter) error) error
- func (s *OrderedParameters) Get(key string) *Parameter
- func (s *OrderedParameters) GetOK(key string) (*Parameter, bool)
- func (s *OrderedParameters) Keys() []string
- func (s OrderedParameters) MarshalJSON() ([]byte, error)
- func (s *OrderedParameters) Set(key string, val *Parameter) bool
- type OrderedPathItems
- func (s *OrderedPathItems) Get(key string) *PathItem
- func (s *OrderedPathItems) GetOK(key string) (*PathItem, bool)
- func (s *OrderedPathItems) Keys() []string
- func (s OrderedPathItems) MarshalEasyJSON(w *jwriter.Writer)
- func (s OrderedPathItems) MarshalJSON() ([]byte, error)
- func (s *OrderedPathItems) Set(key string, val *PathItem) bool
- func (s *OrderedPathItems) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (s *OrderedPathItems) UnmarshalJSON(data []byte) error
- type OrderedRequestBodies
- func (s *OrderedRequestBodies) ForEach(fn func(string, *RequestBody) error) error
- func (s *OrderedRequestBodies) Get(key string) *RequestBody
- func (s *OrderedRequestBodies) GetOK(key string) (*RequestBody, bool)
- func (s *OrderedRequestBodies) Keys() []string
- func (s OrderedRequestBodies) MarshalJSON() ([]byte, error)
- func (s *OrderedRequestBodies) Set(key string, val *RequestBody) bool
- type OrderedResponses
- func (s *OrderedResponses) ForEach(fn func(string, *Response) error) error
- func (s *OrderedResponses) Get(key string) *Response
- func (s *OrderedResponses) GetOK(key string) (*Response, bool)
- func (s *OrderedResponses) Keys() []string
- func (s OrderedResponses) MarshalEasyJSON(w *jwriter.Writer)
- func (s OrderedResponses) MarshalJSON() ([]byte, error)
- func (s *OrderedResponses) Set(key string, val *Response) bool
- func (s *OrderedResponses) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (s *OrderedResponses) UnmarshalJSON(data []byte) error
- type OrderedSchemas
- func (s *OrderedSchemas) ForEach(fn func(string, *Schema) error) error
- func (s *OrderedSchemas) Get(key string) *Schema
- func (s *OrderedSchemas) GetOK(key string) (*Schema, bool)
- func (s *OrderedSchemas) Keys() []string
- func (s OrderedSchemas) MarshalJSON() ([]byte, error)
- func (s *OrderedSchemas) Set(key string, val *Schema) bool
- func (s *OrderedSchemas) UnmarshalJSON(data []byte) error
- type OrderedSecuritySchemes
- func (s *OrderedSecuritySchemes) ForEach(fn func(string, *SecurityScheme) error) error
- func (s *OrderedSecuritySchemes) Get(key string) *SecurityScheme
- func (s *OrderedSecuritySchemes) GetOK(key string) (*SecurityScheme, bool)
- func (s *OrderedSecuritySchemes) Keys() []string
- func (s OrderedSecuritySchemes) MarshalJSON() ([]byte, error)
- func (s *OrderedSecuritySchemes) Set(key string, val *SecurityScheme) bool
- func (s *OrderedSecuritySchemes) UnmarshalJSON(data []byte) error
- type OrderedStrings
- func (s *OrderedStrings) ForEach(fn func(string, *string) error) error
- func (s *OrderedStrings) Get(key string) *string
- func (s *OrderedStrings) GetOK(key string) (*string, bool)
- func (s *OrderedStrings) Keys() []string
- func (s OrderedStrings) MarshalJSON() ([]byte, error)
- func (s *OrderedStrings) Set(key string, val *string) bool
- func (s *OrderedStrings) UnmarshalJSON(data []byte) error
- type Parameter
- type ParameterIn
- type PathItem
- type Paths
- func (p *Paths) ForEach(fn func(string, *PathItem) error) error
- func (p *Paths) Get(path string) *PathItem
- func (p *Paths) GetOK(path string) (*PathItem, bool)
- func (p *Paths) Keys() []string
- func (p Paths) MarshalEasyJSON(w *jwriter.Writer)
- func (p Paths) MarshalJSON() ([]byte, error)
- func (p *Paths) Set(path string, item *PathItem) bool
- func (p *Paths) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (p *Paths) UnmarshalJSON(data []byte) error
- type Reference
- type RequestBody
- type Response
- type Schema
- type SecurityRequirement
- func (s *SecurityRequirement) ForEach(fn func(string, []string) error) error
- func (s *SecurityRequirement) Get(key string) []string
- func (s *SecurityRequirement) GetOK(key string) ([]string, bool)
- func (s *SecurityRequirement) Keys() []string
- func (s SecurityRequirement) MarshalEasyJSON(w *jwriter.Writer)
- func (s SecurityRequirement) MarshalJSON() ([]byte, error)
- func (s *SecurityRequirement) Set(key string, scopes ...string) bool
- func (s *SecurityRequirement) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (s *SecurityRequirement) UnmarshalJSON(data []byte) error
- type SecurityScheme
- type SecuritySchemeType
- type Server
- type ServerVariable
- type ServerVariables
- func (s *ServerVariables) ForEach(fn func(string, *ServerVariable) error) error
- func (s *ServerVariables) Get(key string) *ServerVariable
- func (s *ServerVariables) GetOK(key string) (*ServerVariable, bool)
- func (s *ServerVariables) Keys() []string
- func (v ServerVariables) MarshalEasyJSON(w *jwriter.Writer)
- func (v ServerVariables) MarshalJSON() ([]byte, error)
- func (s *ServerVariables) Set(key string, val *ServerVariable) bool
- func (v *ServerVariables) UnmarshalEasyJSON(l *jlexer.Lexer)
- func (v *ServerVariables) UnmarshalJSON(data []byte) error
- type Style
- type Tag
- type VendorExtensible
- type XML
Constants ¶
This section is empty.
Variables ¶
var LowerCaseKeys = strings.ToLower
LowerCaseKeys lowercases keys when looking up in the map
Functions ¶
func MarshalYAML ¶
MarshalYAML serializes v to YAML. It first marshals v to JSON (honouring all custom MarshalJSON implementations and `json` struct tags), converts the JSON-decoded value to a YAML node, and emits YAML bytes.
func MatchExtension ¶
MatchExtension is used as filter for vendor extensions
func MatchNonEmptyKeys ¶
MatchNonEmptyKeys keys, is used to allow only non empty strings
func NOPNormalizer ¶
NOPNormalizer passes the key through, used as default
func UnmarshalYAML ¶
UnmarshalYAML parses YAML data into v. It first decodes the YAML into a generic structure, converts it to JSON, and then unmarshals the JSON into v, so all custom UnmarshalJSON implementations and `json` struct tags are respected.
Types ¶
type Callback ¶
type Callback struct {
// contains filtered or unexported fields
}
Callback is a map of possible out-of-band callbacks. Key is an expression, value is a Path Item Object. See https://spec.openapis.org/oas/v3.2.0.html#callback-object Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
func NewCallback ¶
func NewCallback() Callback
NewCallback creates a new instance of Callback with correct filter
func (Callback) MarshalEasyJSON ¶
MarshalEasyJSON implements easyjson.Marshaler.
func (Callback) MarshalJSON ¶
MarshalJSON implements json.Marshaler.
func (*Callback) UnmarshalEasyJSON ¶
UnmarshalEasyJSON implements easyjson.Unmarshaler.
func (*Callback) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler.
type Components ¶
type Components struct {
VendorExtensible
Schemas OrderedSchemas `json:"schemas,omitempty"`
Responses OrderedResponses `json:"responses,omitempty"`
Parameters OrderedParameters `json:"parameters,omitempty"`
Examples OrderedExamples `json:"examples,omitempty"`
RequestBodies OrderedRequestBodies `json:"requestBodies,omitempty"`
Headers OrderedHeaders `json:"headers,omitempty"`
SecuritySchemes OrderedSecuritySchemes `json:"securitySchemes,omitempty"`
Links OrderedLinks `json:"links,omitempty"`
Callbacks OrderedCallbacks `json:"callbacks,omitempty"`
// PathItems (OAS 3.1) holds reusable Path Item Objects. Keys MUST match ^[a-zA-Z0-9.\-_]+$
PathItems *OrderedPathItems `json:"pathItems,omitempty"`
// MediaTypes (OAS 3.2) holds reusable Media Type Objects. Keys MUST match ^[a-zA-Z0-9.\-_]+$
MediaTypes *OrderedMediaTypes `json:"mediaTypes,omitempty"`
}
Components holds a set of reusable objects for different aspects of the OAS. See https://spec.openapis.org/oas/v3.2.0.html#components-object
func (*Components) MarshalJSON ¶
func (c *Components) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler so Components serializes all fields (not only VendorExtensible).
type Contact ¶
type Contact struct {
VendorExtensible
Name string `json:"name,omitempty"`
URL string `json:"url,omitempty"` // MUST be a URL.
Email string `json:"email,omitempty"` // MUST be an email address.
}
Contact contains information for the exposed API. See https://spec.openapis.org/oas/v3.2.0.html#contact-object
func (Contact) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Contact) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Contact) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Contact) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Discriminator ¶
type Discriminator struct {
PropertyName string `json:"propertyName"`
Mapping OrderedStrings `json:"mapping,omitempty"`
// DefaultMapping (OAS 3.2) specifies the schema used when the discriminating property
// is absent or has no explicit/implicit mapping. Required when propertyName is optional.
DefaultMapping string `json:"defaultMapping,omitempty"`
}
Discriminator When request bodies or response payloads may be one of a number of different schemas, a discriminator object can be used to aid in serialization, deserialization, and validation. The discriminator is a specific object in a schema which is used to inform the consumer of the specification of an alternative schema based on the value associated with it.
type Encoding ¶
type Encoding struct {
VendorExtensible
ContentType string `json:"contentType,omitempty"`
Headers OrderedHeaders `json:"headers,omitempty"`
Style string `json:"style,omitempty"`
Explode bool `json:"explode,omitempty"`
AllowReserved bool `json:"allowReserved,omitempty"`
Encoding *OrderedEncodings `json:"encoding,omitempty"`
PrefixEncoding []Encoding `json:"prefixEncoding,omitempty"`
ItemEncoding *Encoding `json:"itemEncoding,omitempty"`
}
Encoding definition applied to a single schema property.
type Example ¶
type Example struct {
VendorExtensible
Reference
Summary *string `json:"summary,omitempty"`
Description *string `json:"description,omitempty"`
// DataValue (OAS 3.2) holds the schema-ready data form of the example.
// Mutually exclusive with Value and SerializedValue.
DataValue interface{} `json:"dataValue,omitempty"`
// SerializedValue (OAS 3.2) holds the serialized (wire) form of the example value.
// SHOULD NOT be used if the serialization format is JSON.
// Mutually exclusive with Value and ExternalValue.
SerializedValue string `json:"serializedValue,omitempty"`
// ExternalValue identifies the serialized example in a separate document.
// Mutually exclusive with SerializedValue and Value.
ExternalValue string `json:"externalValue,omitempty"`
// Value is the embedded literal example.
// Deprecated for non-JSON serialization targets: use DataValue / SerializedValue instead.
Value interface{} `json:"value,omitempty"`
}
Example https://spec.openapis.org/oas/v3.2.0.html#example-object
func (*Example) MarshalJSON ¶
MarshalJSON implements json.Marshaler for Example.
type Extensions ¶
type Extensions struct {
// contains filtered or unexported fields
}
Extensions vendor specific extensions
func (*Extensions) Add ¶
func (e *Extensions) Add(key string, value interface{})
Add adds a value to these extensions.
func (*Extensions) Get ¶
func (e *Extensions) Get(key string) interface{}
func (*Extensions) GetBool ¶
func (e *Extensions) GetBool(key string) (bool, bool)
GetBool gets a boolean value from the extensions
func (*Extensions) GetInt ¶
func (e *Extensions) GetInt(key string) (int, bool)
GetInt gets an int value from the extensions
func (*Extensions) GetInt32 ¶
func (e *Extensions) GetInt32(key string) (int32, bool)
GetInt32 gets an int32 value from the extensions
func (*Extensions) GetInt64 ¶
func (e *Extensions) GetInt64(key string) (int64, bool)
GetInt64 gets an int64 value from the extensions
func (*Extensions) GetOK ¶
func (e *Extensions) GetOK(key string) (interface{}, bool)
func (*Extensions) GetString ¶
func (e *Extensions) GetString(key string) (string, bool)
GetString gets a string value from the extensions
func (*Extensions) GetStringSlice ¶
func (e *Extensions) GetStringSlice(key string) ([]string, bool)
GetStringSlice gets a string slice value from the extensions
func (Extensions) MarshalEasyJSON ¶
func (e Extensions) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (Extensions) MarshalJSON ¶
func (e Extensions) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*Extensions) Set ¶
func (e *Extensions) Set(key string, value interface{}) bool
Set adds or updates a vendor extension. Key must begin with "x-". Uses pointer receiver so mutations persist in the caller's Extensions field.
func (*Extensions) UnmarshalEasyJSON ¶
func (e *Extensions) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Extensions) UnmarshalJSON ¶
func (e *Extensions) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ExternalDocumentation ¶
type ExternalDocumentation struct {
VendorExtensible
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"` // MUST be a URL.
}
ExternalDocumentation allows referencing an external resource for extended documentation. See https://spec.openapis.org/oas/v3.2.0.html#external-documentation-object
easyjson:json
func (ExternalDocumentation) MarshalEasyJSON ¶
func (v ExternalDocumentation) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ExternalDocumentation) MarshalJSON ¶
func (v ExternalDocumentation) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ExternalDocumentation) UnmarshalEasyJSON ¶
func (v *ExternalDocumentation) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ExternalDocumentation) UnmarshalJSON ¶
func (v *ExternalDocumentation) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Info ¶
type Info struct {
VendorExtensible
Title string `json:"title"` // REQUIRED.
Summary string `json:"summary,omitempty"` // OAS 3.1: short summary.
Description string `json:"description,omitempty"` // CommonMark allowed.
TermsOfService string `json:"termsOfService,omitempty"` // MUST be a URL.
Contact *Contact `json:"contact,omitempty"`
License *License `json:"license,omitempty"`
Version string `json:"version"` // REQUIRED. Document version (distinct from OAS version).
}
Info provides metadata about the API. See https://spec.openapis.org/oas/v3.2.0.html#info-object
easyjson:json
func (Info) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Info) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Info) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Info) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type License ¶
type License struct {
VendorExtensible
Name string `json:"name"` // REQUIRED.
Identifier string `json:"identifier,omitempty"` // OAS 3.1: SPDX expression; mutually exclusive with url.
URL string `json:"url,omitempty"` // Mutually exclusive with identifier.
}
License contains information for the exposed API. See https://spec.openapis.org/oas/v3.2.0.html#license-object
easyjson:json
func (License) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (License) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*License) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*License) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Link ¶
type Link struct {
VendorExtensible
Reference
OperationRef string `json:"operationRef,omitempty"`
OperationID string `json:"operationId,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
RequestBody interface{} `json:"requestBody,omitempty"`
Description *string `json:"description,omitempty"`
Server Server `json:"server,omitempty"`
}
Link represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.
type MapEntry ¶
type MapEntry struct {
Key string
Value interface{}
}
MapEntry represents a key value pair
type MediaType ¶
type MediaType struct {
VendorExtensible
Reference
Schema *Schema `json:"schema,omitempty"`
ItemSchema *Schema `json:"itemSchema,omitempty"`
Example interface{} `json:"example,omitempty"`
Examples OrderedExamples `json:"examples,omitempty"`
Encoding OrderedEncodings `json:"encoding,omitempty"`
PrefixEncoding []Encoding `json:"prefixEncoding,omitempty"`
// ItemEncoding (OAS 3.2) single Encoding Object for streaming multipart content (itemEncoding field).
ItemEncoding *Encoding `json:"itemEncoding,omitempty"`
}
MediaType provides schema and examples for the media type identified by its key.
func (*MediaType) MarshalJSON ¶
MarshalJSON implements json.Marshaler. Emits {"$ref":"..."} when a ref is set, otherwise emits all non-empty fields as a JSON object. Ensures MediaType never serializes as null even when all fields are zero-valued.
type Normalizer ¶
Normalizer is used to normalize keys when writing to a map
type OAuthFlow ¶
type OAuthFlow struct {
VendorExtensible
AuthorizationURL string `json:"authorizationUrl,omitempty"`
// DeviceAuthorizationURL (OAS 3.2) is required for the deviceAuthorization flow.
DeviceAuthorizationURL string `json:"deviceAuthorizationUrl,omitempty"`
TokenURL string `json:"tokenUrl,omitempty"`
RefreshURL string `json:"refreshUrl,omitempty"`
Scopes OrderedStrings `json:"scopes,omitempty"`
}
OAuthFlow configuration details for a supported OAuth Flow
func (OAuthFlow) MarshalJSON ¶
MarshalJSON implements json.Marshaler for OAuthFlow.
type OAuthFlows ¶
type OAuthFlows struct {
VendorExtensible
Implicit OAuthFlow `json:"implicit,omitempty"`
Password OAuthFlow `json:"password,omitempty"`
ClientCredentials OAuthFlow `json:"clientCredentials,omitempty"`
AuthorizationCode OAuthFlow `json:"authorizationCode,omitempty"`
DeviceAuthorization OAuthFlow `json:"deviceAuthorization,omitempty"` // OAS 3.2
}
OAuthFlows allows configuration of the supported OAuth Flows.
func (OAuthFlows) MarshalJSON ¶
func (f OAuthFlows) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OAuthFlows.
type OpenAPI ¶
type OpenAPI struct {
VendorExtensible
Components *Components `json:"components,omitempty"`
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
Info *Info `json:"info,omitempty"`
/* REQUIRED.
This string MUST be the version number of the OpenAPI Specification that the OpenAPI document uses.
The openapi field SHOULD be used by tooling to interpret the OpenAPI document.
This is not related to the info.version string, which describes the OpenAPI document’s version.
*/
OpenAPI string `json:"openapi"`
Self string `json:"$self,omitempty"` // OAS 3.2: self-assigned URI of this document.
JsonSchemaDialect string `json:"jsonSchemaDialect,omitempty"` // OAS 3.1+: default $schema for Schema Objects.
Servers []Server `json:"servers,omitempty"`
Paths *Paths `json:"paths,omitempty"`
Webhooks *OrderedPathItems `json:"webhooks,omitempty"` // OAS 3.1+
Security []SecurityRequirement `json:"security,omitempty"`
Tags []Tag `json:"tags,omitempty"`
}
OpenAPI is the root document object of the OpenAPI document
func (*OpenAPI) MarshalJSON ¶
MarshalJSON implements json.Marshaler so the root document serializes all fields. Without this, the embedded VendorExtensible.MarshalJSON would be used and only extensions would be emitted.
func (*OpenAPI) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It decodes both the regular OpenAPI fields and any vendor extensions from the same JSON object.
type Operation ¶
type Operation struct {
VendorExtensible
Tags []string `json:"tags,omitempty"`
Summary *string `json:"summary,omitempty"`
Description *string `json:"description,omitempty"`
ExternalDocs ExternalDocumentation `json:"externalDocs,omitempty"`
/*
Unique string used to identify the operation. The id MUST be unique among all operations
described in the API. The operationId value is case-sensitive.
Tools and libraries MAY use the operationId to uniquely identify an operation, therefore,
it is RECOMMENDED to follow common programming naming conventions.
*/
OperationID string `json:"operationId,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
RequestBody RequestBody `json:"requestBody,omitempty"`
Responses OrderedResponses `json:"responses,omitempty"`
// Callbacks is a map of callback name → Callback Object (each Callback is itself a map of
// runtime expression → Path Item Object). Type was previously *Callback which is incorrect
// per the spec: the Operation field is Map[string, Callback | Reference], not a single Callback.
Callbacks *OrderedCallbacks `json:"callbacks,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
Security []SecurityRequirement `json:"security,omitempty"`
Servers []Server `json:"servers,omitempty"`
}
Operation describes a single API operation on a path.
func (*Operation) MarshalJSON ¶
MarshalJSON implements json.Marshaler so the operation serializes all fields (not only VendorExtensible).
type OrderedCallbacks ¶
type OrderedCallbacks struct {
// contains filtered or unexported fields
}
OrderedCallbacks is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedCallbacks ¶
func NewOrderedCallbacks() OrderedCallbacks
NewOrderedCallbacks creates a new instance of OrderedCallbacks with correct filter
func (*OrderedCallbacks) ForEach ¶
func (s *OrderedCallbacks) ForEach(fn func(string, *Callback) error) error
ForEach executes the function for each security requirement
func (*OrderedCallbacks) Get ¶
func (s *OrderedCallbacks) Get(key string) *Callback
Get gets the security requirement by key
func (*OrderedCallbacks) GetOK ¶
func (s *OrderedCallbacks) GetOK(key string) (*Callback, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedCallbacks) Keys ¶
func (s *OrderedCallbacks) Keys() []string
Keys gets the list of keys
type OrderedEncodings ¶
type OrderedEncodings struct {
// contains filtered or unexported fields
}
OrderedEncodings is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedEncodings ¶
func NewOrderedEncodings() OrderedEncodings
NewOrderedEncodings creates a new instance of OrderedEncodings with correct filter
func (*OrderedEncodings) ForEach ¶
func (s *OrderedEncodings) ForEach(fn func(string, *Encoding) error) error
ForEach executes the function for each security requirement
func (*OrderedEncodings) Get ¶
func (s *OrderedEncodings) Get(key string) *Encoding
Get gets the security requirement by key
func (*OrderedEncodings) GetOK ¶
func (s *OrderedEncodings) GetOK(key string) (*Encoding, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedEncodings) Keys ¶
func (s *OrderedEncodings) Keys() []string
Keys gets the list of keys
type OrderedExamples ¶
type OrderedExamples struct {
// contains filtered or unexported fields
}
OrderedExamples is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedExamples ¶
func NewOrderedExamples() OrderedExamples
NewOrderedExamples creates a new instance of OrderedExamples with correct filter
func (*OrderedExamples) ForEach ¶
func (s *OrderedExamples) ForEach(fn func(string, *Example) error) error
ForEach executes the function for each security requirement
func (*OrderedExamples) Get ¶
func (s *OrderedExamples) Get(key string) *Example
Get gets the security requirement by key
func (*OrderedExamples) GetOK ¶
func (s *OrderedExamples) GetOK(key string) (*Example, bool)
GetOK checks if the key exists in the security requirement
func (OrderedExamples) MarshalJSON ¶
func (s OrderedExamples) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedExamples.
func (*OrderedExamples) Set ¶
func (s *OrderedExamples) Set(key string, val *Example) bool
Set sets the value to the security requirement
func (*OrderedExamples) UnmarshalJSON ¶
func (s *OrderedExamples) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler for OrderedExamples.
type OrderedHeaders ¶
type OrderedHeaders struct {
// contains filtered or unexported fields
}
OrderedHeaders is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedHeaders ¶
func NewOrderedHeaders() OrderedHeaders
NewOrderedHeaders creates a new instance of OrderedHeaders with correct filter
func (*OrderedHeaders) ForEach ¶
func (s *OrderedHeaders) ForEach(fn func(string, *Header) error) error
ForEach executes the function for each security requirement
func (*OrderedHeaders) Get ¶
func (s *OrderedHeaders) Get(key string) *Header
Get gets the security requirement by key
func (*OrderedHeaders) GetOK ¶
func (s *OrderedHeaders) GetOK(key string) (*Header, bool)
GetOK checks if the key exists in the security requirement
func (OrderedHeaders) MarshalJSON ¶
func (s OrderedHeaders) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedHeaders.
type OrderedLinks ¶
type OrderedLinks struct {
// contains filtered or unexported fields
}
OrderedLinks is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedLinks ¶
func NewOrderedLinks() OrderedLinks
NewOrderedLinks creates a new instance of OrderedLinks with correct filter
func (*OrderedLinks) ForEach ¶
func (s *OrderedLinks) ForEach(fn func(string, *Link) error) error
ForEach executes the function for each security requirement
func (*OrderedLinks) Get ¶
func (s *OrderedLinks) Get(key string) *Link
Get gets the security requirement by key
func (*OrderedLinks) GetOK ¶
func (s *OrderedLinks) GetOK(key string) (*Link, bool)
GetOK checks if the key exists in the security requirement
func (OrderedLinks) MarshalJSON ¶
func (s OrderedLinks) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedLinks.
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
OrderedMap is a map that preserves insertion order Allows extensions to the OpenAPI Schema. The field name MUST begin with x-, for example, x-internal-id. Field names beginning x-oai- and x-oas- are reserved for uses defined by the OpenAPI Initiative. The value can be any valid JSON value (null, a primitive, an array, or an object.)
func (*OrderedMap) Entries ¶
func (s *OrderedMap) Entries() []MapEntry
Entries in the order of addition to the map
func (*OrderedMap) ForEach ¶
func (s *OrderedMap) ForEach(fn func(string, interface{}) error) error
ForEach executes a function for each value in the map
func (*OrderedMap) Get ¶
func (s *OrderedMap) Get(key string) interface{}
Get get a value for the specified key
func (*OrderedMap) GetOK ¶
func (s *OrderedMap) GetOK(key string) (interface{}, bool)
GetOK get a value for the specified key, the boolean result indicates if the value was found or not
func (*OrderedMap) Keys ¶
func (s *OrderedMap) Keys() []string
Keys in the order of addition to the map. The returned slice shares the underlying array; do not append to or modify it.
func (OrderedMap) MarshalEasyJSON ¶
func (s OrderedMap) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderedMap) MarshalJSON ¶
func (s OrderedMap) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderedMap) Set ¶
func (s *OrderedMap) Set(key string, value interface{}) bool
Set a value in the map. Returns true when key is new, false when updating an existing key.
func (OrderedMap) String ¶
func (s OrderedMap) String() string
func (*OrderedMap) UnmarshalEasyJSON ¶
func (s *OrderedMap) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderedMap) UnmarshalJSON ¶
func (s *OrderedMap) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*OrderedMap) Values ¶
func (s *OrderedMap) Values() []interface{}
Values in the order of addition to the map
type OrderedMediaTypes ¶
type OrderedMediaTypes struct {
// contains filtered or unexported fields
}
OrderedMediaTypes is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedMediaTypes ¶
func NewOrderedMediaTypes() OrderedMediaTypes
NewOrderedMediaTypes creates a new instance of OrderedMediaTypes with correct filter
func (*OrderedMediaTypes) ForEach ¶
func (s *OrderedMediaTypes) ForEach(fn func(string, *MediaType) error) error
ForEach executes the function for each security requirement
func (*OrderedMediaTypes) Get ¶
func (s *OrderedMediaTypes) Get(key string) *MediaType
Get gets the security requirement by key
func (*OrderedMediaTypes) GetOK ¶
func (s *OrderedMediaTypes) GetOK(key string) (*MediaType, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedMediaTypes) Keys ¶
func (s *OrderedMediaTypes) Keys() []string
Keys gets the list of keys
func (OrderedMediaTypes) MarshalJSON ¶
func (s OrderedMediaTypes) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedMediaTypes.
func (*OrderedMediaTypes) Set ¶
func (s *OrderedMediaTypes) Set(key string, val *MediaType) bool
Set sets the value to the security requirement
func (*OrderedMediaTypes) UnmarshalJSON ¶
func (s *OrderedMediaTypes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler for OrderedMediaTypes.
type OrderedOperations ¶
type OrderedOperations struct {
// contains filtered or unexported fields
}
OrderedOperations represents a collection of API operations in a specific order.
func NewOrderedOperations ¶
func NewOrderedOperations() OrderedOperations
NewOrderedOperations creates a new instance of OrderedOperations with correct filter
func (*OrderedOperations) ForEach ¶
func (s *OrderedOperations) ForEach(fn func(string, *Operation) error) error
ForEach executes the function for each security requirement
func (*OrderedOperations) Get ¶
func (s *OrderedOperations) Get(key string) *Operation
Get gets the security requirement by key
func (*OrderedOperations) GetOK ¶
func (s *OrderedOperations) GetOK(key string) (*Operation, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedOperations) Keys ¶
func (s *OrderedOperations) Keys() []string
Keys gets the list of keys
type OrderedParameters ¶
type OrderedParameters struct {
// contains filtered or unexported fields
}
func NewOrderedParameters ¶
func NewOrderedParameters() OrderedParameters
func (*OrderedParameters) ForEach ¶
func (s *OrderedParameters) ForEach(fn func(string, *Parameter) error) error
ForEach executes the function for each security requirement
func (*OrderedParameters) Get ¶
func (s *OrderedParameters) Get(key string) *Parameter
Get gets the security requirement by key
func (*OrderedParameters) GetOK ¶
func (s *OrderedParameters) GetOK(key string) (*Parameter, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedParameters) Keys ¶
func (s *OrderedParameters) Keys() []string
Keys gets the list of keys
func (OrderedParameters) MarshalJSON ¶
func (s OrderedParameters) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedParameters.
type OrderedPathItems ¶
type OrderedPathItems struct {
// contains filtered or unexported fields
}
OrderedPathItems is a map of string to Path Item Object (or $ref). Used for webhooks (OAS 3.1) and components.pathItems (OAS 3.1).
func NewOrderedPathItems ¶
func NewOrderedPathItems() OrderedPathItems
NewOrderedPathItems returns a new OrderedPathItems.
func (*OrderedPathItems) Get ¶
func (s *OrderedPathItems) Get(key string) *PathItem
Get returns the PathItem for key, or nil.
func (*OrderedPathItems) GetOK ¶
func (s *OrderedPathItems) GetOK(key string) (*PathItem, bool)
GetOK returns the PathItem and true if key exists.
func (*OrderedPathItems) Keys ¶
func (s *OrderedPathItems) Keys() []string
Keys returns the keys in order.
func (OrderedPathItems) MarshalEasyJSON ¶
func (s OrderedPathItems) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON implements easyjson.Marshaler.
func (OrderedPathItems) MarshalJSON ¶
func (s OrderedPathItems) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler.
func (*OrderedPathItems) Set ¶
func (s *OrderedPathItems) Set(key string, val *PathItem) bool
Set sets the PathItem for key. Returns false if key was filtered out.
func (*OrderedPathItems) UnmarshalEasyJSON ¶
func (s *OrderedPathItems) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON implements easyjson.Unmarshaler.
func (*OrderedPathItems) UnmarshalJSON ¶
func (s *OrderedPathItems) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler.
type OrderedRequestBodies ¶
type OrderedRequestBodies struct {
// contains filtered or unexported fields
}
OrderedRequestBodies is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedRequestBodies ¶
func NewOrderedRequestBodies() OrderedRequestBodies
NewOrderedRequestBodies creates a new instance of OrderedRequestBodies with correct filter
func (*OrderedRequestBodies) ForEach ¶
func (s *OrderedRequestBodies) ForEach(fn func(string, *RequestBody) error) error
ForEach executes the function for each security requirement
func (*OrderedRequestBodies) Get ¶
func (s *OrderedRequestBodies) Get(key string) *RequestBody
Get gets the security requirement by key
func (*OrderedRequestBodies) GetOK ¶
func (s *OrderedRequestBodies) GetOK(key string) (*RequestBody, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedRequestBodies) Keys ¶
func (s *OrderedRequestBodies) Keys() []string
Keys gets the list of keys
func (OrderedRequestBodies) MarshalJSON ¶
func (s OrderedRequestBodies) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedRequestBodies.
func (*OrderedRequestBodies) Set ¶
func (s *OrderedRequestBodies) Set(key string, val *RequestBody) bool
Set sets the value to the security requirement
type OrderedResponses ¶
type OrderedResponses struct {
// contains filtered or unexported fields
}
OrderedResponses is a container for the expected responses of an operation. The container maps a HTTP response code to the expected response.
func NewOrderedResponses ¶
func NewOrderedResponses() OrderedResponses
NewOrderedResponses creates the new instance of the OrderedResponses with correct key-filter
func (*OrderedResponses) ForEach ¶
func (s *OrderedResponses) ForEach(fn func(string, *Response) error) error
ForEach executes the function for each security requirement
func (*OrderedResponses) Get ¶
func (s *OrderedResponses) Get(key string) *Response
Get gets the security requirement by key
func (*OrderedResponses) GetOK ¶
func (s *OrderedResponses) GetOK(key string) (*Response, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedResponses) Keys ¶
func (s *OrderedResponses) Keys() []string
Keys gets the list of keys
func (OrderedResponses) MarshalEasyJSON ¶
func (s OrderedResponses) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (OrderedResponses) MarshalJSON ¶
func (s OrderedResponses) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*OrderedResponses) Set ¶
func (s *OrderedResponses) Set(key string, val *Response) bool
Set sets the value to the security requirement
func (*OrderedResponses) UnmarshalEasyJSON ¶
func (s *OrderedResponses) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*OrderedResponses) UnmarshalJSON ¶
func (s *OrderedResponses) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type OrderedSchemas ¶
type OrderedSchemas struct {
// contains filtered or unexported fields
}
OrderedSchemas is an ordered map of schema name → Schema.
func NewOrderedSchemas ¶
func NewOrderedSchemas() OrderedSchemas
NewOrderedSchemas creates a new instance of OrderedSchemas with correct filter
func (*OrderedSchemas) ForEach ¶
func (s *OrderedSchemas) ForEach(fn func(string, *Schema) error) error
ForEach executes the function for each security requirement
func (*OrderedSchemas) Get ¶
func (s *OrderedSchemas) Get(key string) *Schema
Get gets the security requirement by key
func (*OrderedSchemas) GetOK ¶
func (s *OrderedSchemas) GetOK(key string) (*Schema, bool)
GetOK checks if the key exists in the security requirement
func (OrderedSchemas) MarshalJSON ¶
func (s OrderedSchemas) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedSchemas.
func (*OrderedSchemas) Set ¶
func (s *OrderedSchemas) Set(key string, val *Schema) bool
Set sets the value to the security requirement
func (*OrderedSchemas) UnmarshalJSON ¶
func (s *OrderedSchemas) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler for OrderedSchemas.
type OrderedSecuritySchemes ¶
type OrderedSecuritySchemes struct {
// contains filtered or unexported fields
}
OrderedSecuritySchemes is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedSecuritySchemes ¶
func NewOrderedSecuritySchemes() OrderedSecuritySchemes
NewOrderedSecuritySchemes creates a new instance of OrderedSecuritySchemes with correct filter
func (*OrderedSecuritySchemes) ForEach ¶
func (s *OrderedSecuritySchemes) ForEach(fn func(string, *SecurityScheme) error) error
ForEach executes the function for each security requirement
func (*OrderedSecuritySchemes) Get ¶
func (s *OrderedSecuritySchemes) Get(key string) *SecurityScheme
Get gets the security requirement by key
func (*OrderedSecuritySchemes) GetOK ¶
func (s *OrderedSecuritySchemes) GetOK(key string) (*SecurityScheme, bool)
GetOK checks if the key exists in the security requirement
func (*OrderedSecuritySchemes) Keys ¶
func (s *OrderedSecuritySchemes) Keys() []string
Keys gets the list of keys
func (OrderedSecuritySchemes) MarshalJSON ¶
func (s OrderedSecuritySchemes) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedSecuritySchemes.
func (*OrderedSecuritySchemes) Set ¶
func (s *OrderedSecuritySchemes) Set(key string, val *SecurityScheme) bool
Set sets the value to the security requirement
func (*OrderedSecuritySchemes) UnmarshalJSON ¶
func (s *OrderedSecuritySchemes) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler for OrderedSecuritySchemes.
type OrderedStrings ¶
type OrderedStrings struct {
// contains filtered or unexported fields
}
OrderedStrings is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewOrderedStrings ¶
func NewOrderedStrings() OrderedStrings
NewOrderedStrings creates a new instance of OrderedStrings with correct filter
func (*OrderedStrings) ForEach ¶
func (s *OrderedStrings) ForEach(fn func(string, *string) error) error
ForEach executes the function for each security requirement
func (*OrderedStrings) Get ¶
func (s *OrderedStrings) Get(key string) *string
Get gets the security requirement by key
func (*OrderedStrings) GetOK ¶
func (s *OrderedStrings) GetOK(key string) (*string, bool)
GetOK checks if the key exists in the security requirement
func (OrderedStrings) MarshalJSON ¶
func (s OrderedStrings) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for OrderedStrings.
func (*OrderedStrings) Set ¶
func (s *OrderedStrings) Set(key string, val *string) bool
Set sets the value to the security requirement
func (*OrderedStrings) UnmarshalJSON ¶
func (s *OrderedStrings) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler for OrderedStrings.
type Parameter ¶
type Parameter struct {
VendorExtensible
Reference
Name string `json:"name"`
In string `json:"in"` // see ParameterIn constants
Description *string `json:"description"`
Required bool `json:"required"`
Deprecated bool `json:"deprecated"`
AllowEmptyValue bool `json:"allowEmptyValue"`
// style,explode,allowReserved used with schema
Style Style `json:"style"`
Explode bool `json:"explode"`
AllowReserved bool `json:"allowReserved"`
Schema Schema `json:"schema"`
Example interface{} `json:"example"`
Examples OrderedExamples `json:"examples"`
Content OrderedMediaTypes `json:"content"`
}
Parameter describes a single operation parameter. A unique parameter is defined by a combination of a name and location. Valid In values: "path", "query", "querystring" (OAS 3.2), "header", "cookie". See ParameterIn constants and https://spec.openapis.org/oas/v3.2.0.html#parameter-object
func (*Parameter) MarshalJSON ¶
MarshalJSON implements json.Marshaler so the parameter serializes all fields (not only VendorExtensible). When the parameter is a $ref, only {"$ref": "..."} is emitted.
type ParameterIn ¶
type ParameterIn string
ParameterIn represents the location of a parameter. See https://spec.openapis.org/oas/v3.2.0.html#parameter-locations
const ( ParameterInPath ParameterIn = "path" ParameterInQuery ParameterIn = "query" ParameterInQueryString ParameterIn = "querystring" // OAS 3.2: entire query string as a single value. ParameterInHeader ParameterIn = "header" ParameterInCookie ParameterIn = "cookie" )
type PathItem ¶
type PathItem struct {
Reference
Summary *string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Get *Operation `json:"get,omitempty"`
Put *Operation `json:"put,omitempty"`
Post *Operation `json:"post,omitempty"`
Delete *Operation `json:"delete,omitempty"`
Options *Operation `json:"options,omitempty"`
Head *Operation `json:"head,omitempty"`
Patch *Operation `json:"patch,omitempty"`
Trace *Operation `json:"trace,omitempty"`
Query *Operation `json:"query,omitempty"` // OAS 3.2: QUERY HTTP method.
AdditionalOperations map[string]*Operation `json:"additionalOperations,omitempty"` // OAS 3.2: non-standard HTTP methods.
Servers []Server `json:"servers,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
}
PathItem describes the operations available on a single path. See https://spec.openapis.org/oas/v3.2.0.html#path-item-object Operation fields are pointers so nil is omitted when serializing (omitempty).
func (*PathItem) MarshalJSON ¶
MarshalJSON implements json.Marshaler. Emits {"$ref":"..."} when a ref is set, otherwise marshals all PathItem fields.
type Paths ¶
type Paths struct {
// contains filtered or unexported fields
}
Paths holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object in order to construct the full URL. The Paths MAY be empty, due to ACL constraints.
func (Paths) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Paths) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Paths) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Paths) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type Reference ¶
type Reference struct {
// Ref holds the $ref string value (e.g. "#/components/schemas/Pet").
// It is intentionally untagged: each embedding struct's MarshalJSON handles
// emitting {"$ref":"..."} and populating this field on unmarshal.
Ref string `json:"-"`
}
Reference is a simple object to allow referencing other components in the specification, internally and externally. See https://spec.openapis.org/oas/v3.2.0.html#reference-object
type RequestBody ¶
type RequestBody struct {
VendorExtensible
Reference
Description *string `json:"description,omitempty"`
Content OrderedMediaTypes `json:"content"`
Required bool `json:"required"`
}
RequestBody describes a single request body.
func (*RequestBody) MarshalJSON ¶
func (r *RequestBody) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler so RequestBody serializes all fields (not only VendorExtensible). When the request body is a $ref, only {"$ref": "..."} is emitted.
type Response ¶
type Response struct {
VendorExtensible
Reference
Description *string `json:"description,omitempty"`
Summary *string `json:"summary,omitempty"`
Headers *OrderedHeaders `json:"headers,omitempty"`
Content *OrderedMediaTypes `json:"content,omitempty"`
Links *OrderedLinks `json:"links,omitempty"`
}
Response describes a single response from an API Operation, including design-time, static links to operations based on the response. Headers, Content, Links are pointers so nil is omitted when serializing (omitempty).
func (*Response) MarshalJSON ¶
MarshalJSON implements json.Marshaler so the response serializes all fields (not only VendorExtensible). When the response is a $ref, only {"$ref": "..."} is emitted.
type Schema ¶
type Schema struct {
VendorExtensible
Reference
// Metadata
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
// Type is the JSON Schema type. In OAS 3.2 this may also be an array of strings.
Type string `json:"type,omitempty"`
Format string `json:"format,omitempty"`
// Validation — numbers
Minimum *float64 `json:"minimum,omitempty"`
Maximum *float64 `json:"maximum,omitempty"`
ExclusiveMinimum interface{} `json:"exclusiveMinimum,omitempty"` // bool (3.0) or number (3.1+)
ExclusiveMaximum interface{} `json:"exclusiveMaximum,omitempty"`
MultipleOf *float64 `json:"multipleOf,omitempty"`
// Validation — strings
MinLength *int64 `json:"minLength,omitempty"`
MaxLength *int64 `json:"maxLength,omitempty"`
Pattern string `json:"pattern,omitempty"`
// Validation — arrays
Items *Schema `json:"items,omitempty"`
MinItems *int64 `json:"minItems,omitempty"`
MaxItems *int64 `json:"maxItems,omitempty"`
UniqueItems bool `json:"uniqueItems,omitempty"`
// PrefixItems is OAS 3.2 / JSON Schema 2020-12.
PrefixItems []*Schema `json:"prefixItems,omitempty"`
// Validation — objects
Required []string `json:"required,omitempty"`
Properties *OrderedSchemas `json:"properties,omitempty"`
// AdditionalProperties accepts either a *Schema or a bool.
AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
MinProperties *int64 `json:"minProperties,omitempty"`
MaxProperties *int64 `json:"maxProperties,omitempty"`
// Composition
AllOf []*Schema `json:"allOf,omitempty"`
AnyOf []*Schema `json:"anyOf,omitempty"`
OneOf []*Schema `json:"oneOf,omitempty"`
Not *Schema `json:"not,omitempty"`
// Enum / const / default / example
Enum []interface{} `json:"enum,omitempty"`
Default interface{} `json:"default,omitempty"`
Example interface{} `json:"example,omitempty"`
// Annotations
ReadOnly bool `json:"readOnly,omitempty"`
WriteOnly bool `json:"writeOnly,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
// Nullable is OAS 3.0 only; in OAS 3.1+ use type arrays instead.
Nullable bool `json:"nullable,omitempty"`
// Linked objects
XML *XML `json:"xml,omitempty"`
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
Discriminator *Discriminator `json:"discriminator,omitempty"`
}
Schema object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. https://spec.openapis.org/oas/v3.2.0.html#schema-object
func (*Schema) MarshalJSON ¶
MarshalJSON implements json.Marshaler. When $ref is set, emits {"$ref":"..."} only. Otherwise marshals all fields and merges vendor extensions.
type SecurityRequirement ¶
type SecurityRequirement struct {
// contains filtered or unexported fields
}
SecurityRequirement lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object.
func (*SecurityRequirement) ForEach ¶
func (s *SecurityRequirement) ForEach(fn func(string, []string) error) error
ForEach executes the function for each security requirement
func (*SecurityRequirement) Get ¶
func (s *SecurityRequirement) Get(key string) []string
Get gets the security requirement by key
func (*SecurityRequirement) GetOK ¶
func (s *SecurityRequirement) GetOK(key string) ([]string, bool)
GetOK checks if the key exists in the security requirement
func (*SecurityRequirement) Keys ¶
func (s *SecurityRequirement) Keys() []string
Keys gets the list of keys
func (SecurityRequirement) MarshalEasyJSON ¶
func (s SecurityRequirement) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SecurityRequirement) MarshalJSON ¶
func (s SecurityRequirement) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SecurityRequirement) Set ¶
func (s *SecurityRequirement) Set(key string, scopes ...string) bool
Set sets the value to the security requirement
func (*SecurityRequirement) UnmarshalEasyJSON ¶
func (s *SecurityRequirement) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SecurityRequirement) UnmarshalJSON ¶
func (s *SecurityRequirement) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SecurityScheme ¶
type SecurityScheme struct {
VendorExtensible
Reference
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name,omitempty"`
In string `json:"in,omitempty"`
Scheme string `json:"scheme,omitempty"`
BearerFormat string `json:"bearerFormat,omitempty"`
Flows OAuthFlows `json:"flows,omitempty"`
OpenIDConnectURL string `json:"openIdConnectUrl,omitempty"`
// OAuth2MetadataURL (OAS 3.2) URL to the OAuth2 authorization server metadata (RFC 8414). TLS required.
OAuth2MetadataURL string `json:"oauth2MetadataUrl,omitempty"`
// Deprecated (OAS 3.2) declares this security scheme as deprecated.
Deprecated bool `json:"deprecated,omitempty"`
}
SecurityScheme defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows (implicit, password, application and access code) as defined in RFC6749, and OpenID Connect Discovery.
func (*SecurityScheme) MarshalJSON ¶
func (s *SecurityScheme) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler for SecurityScheme.
type SecuritySchemeType ¶
type SecuritySchemeType string
SecuritySchemeType represents the type of a Security Scheme Object. See https://spec.openapis.org/oas/v3.2.0.html#security-scheme-object
const ( SecuritySchemeTypeAPIKey SecuritySchemeType = "apiKey" SecuritySchemeTypeHTTP SecuritySchemeType = "http" SecuritySchemeTypeMutualTLS SecuritySchemeType = "mutualTLS" // OAS 3.2 SecuritySchemeTypeOAuth2 SecuritySchemeType = "oauth2" SecuritySchemeTypeOpenIDConnect SecuritySchemeType = "openIdConnect" )
type Server ¶
type Server struct {
VendorExtensible
URL string `json:"url"` // REQUIRED. May contain {variables}.
Name *string `json:"name,omitempty"` // Optional (extension/common).
Description string `json:"description,omitempty"` // Keep string for easyjson compatibility.
Variables ServerVariables `json:"variables,omitempty"`
}
Server represents a server. See https://spec.openapis.org/oas/v3.2.0.html#server-object
easyjson:json
func (Server) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Server) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Server) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Server) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type ServerVariable ¶
type ServerVariable struct {
VendorExtensible
/*
An enumeration of string values to be used if the substitution options are from a limited set.
The array MUST NOT be empty.
*/
Enum []string `json:"enum,omitempty"`
/*
REQUIRED. The default value to use for substitution,
which SHALL be sent if an alternate value is not supplied.
If the enum is defined, the value MUST exist in the enum’s values.
Note that this behavior is different from the Schema Object’s default keyword,
which documents the receiver’s behavior rather than inserting the value into the data.
*/
Default string `json:"default"`
Description string `json:"description,omitempty"`
}
ServerVariable object representing a Server Variable for server URL template substitution.
func (ServerVariable) MarshalEasyJSON ¶
func (v ServerVariable) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ServerVariable) MarshalJSON ¶
func (v ServerVariable) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ServerVariable) UnmarshalEasyJSON ¶
func (v *ServerVariable) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ServerVariable) UnmarshalJSON ¶
func (v *ServerVariable) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type ServerVariables ¶
type ServerVariables struct {
// contains filtered or unexported fields
}
ServerVariables is a map between a variable name and its value. The value is used for substitution in the server's URL template.
func NewServerVariables ¶
func NewServerVariables() ServerVariables
NewServerVariables creates a new instance of ServerVariables with correct filter
func (*ServerVariables) ForEach ¶
func (s *ServerVariables) ForEach(fn func(string, *ServerVariable) error) error
ForEach executes the function for each security requirement
func (*ServerVariables) Get ¶
func (s *ServerVariables) Get(key string) *ServerVariable
Get gets the security requirement by key
func (*ServerVariables) GetOK ¶
func (s *ServerVariables) GetOK(key string) (*ServerVariable, bool)
GetOK checks if the key exists in the security requirement
func (ServerVariables) MarshalEasyJSON ¶
func (v ServerVariables) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ServerVariables) MarshalJSON ¶
func (v ServerVariables) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ServerVariables) Set ¶
func (s *ServerVariables) Set(key string, val *ServerVariable) bool
Set sets the value to the security requirement
func (*ServerVariables) UnmarshalEasyJSON ¶
func (v *ServerVariables) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ServerVariables) UnmarshalJSON ¶
func (v *ServerVariables) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type Style ¶
type Style string
Style represents how a parameter value will be serialized depending on the type of the parameter value. See https://spec.openapis.org/oas/v3.2.0.html#style-values
const ( StyleMatrix Style = "matrix" StyleLabel Style = "label" StyleSimple Style = "simple" StyleForm Style = "form" StyleSpaceDelimited Style = "spaceDelimited" StylePipeDelimited Style = "pipeDelimited" StyleDeepObject Style = "deepObject" // StyleCookie is used with in: "cookie" parameters (analogous to form, following RFC 6265). StyleCookie Style = "cookie" )
type Tag ¶
type Tag struct {
VendorExtensible
Name string `json:"name"` // REQUIRED.
Summary string `json:"summary,omitempty"` // OAS 3.2: short summary for display.
Description string `json:"description,omitempty"` // CommonMark allowed.
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
Parent string `json:"parent,omitempty"` // OAS 3.2: name of a parent tag (must exist).
Kind string `json:"kind,omitempty"` // OAS 3.2: e.g. "nav", "badge", "audience".
}
Tag adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances. easyjson:json
func (Tag) MarshalEasyJSON ¶
MarshalEasyJSON supports easyjson.Marshaler interface
func (Tag) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (*Tag) UnmarshalEasyJSON ¶
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*Tag) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
type VendorExtensible ¶
type VendorExtensible struct {
Extensions Extensions
}
VendorExtensible composition block.
func (*VendorExtensible) AddExtension ¶
func (v *VendorExtensible) AddExtension(key string, value interface{})
AddExtension adds an extension to this extensible object.
func (VendorExtensible) MarshalJSON ¶
func (v VendorExtensible) MarshalJSON() ([]byte, error)
MarshalJSON marshals the extensions to json
func (*VendorExtensible) UnmarshalJSON ¶
func (v *VendorExtensible) UnmarshalJSON(data []byte) error
UnmarshalJSON for this extensible object
type XML ¶
type XML struct {
VendorExtensible
// NodeType (OAS 3.2) specifies the XML DOM node type: "element", "attribute", "text", "cdata", or "none".
// Replaces the deprecated Attribute and Wrapped fields.
NodeType string `json:"nodeType,omitempty"`
Name string `json:"name,omitempty"`
Namespace string `json:"namespace,omitempty"`
Prefix string `json:"prefix,omitempty"`
// Deprecated: Use NodeType: "attribute" instead. Kept for OAS 3.0/3.1 compatibility.
Attribute bool `json:"attribute,omitempty"`
// Deprecated: Use NodeType: "element" instead. Kept for OAS 3.0/3.1 compatibility.
Wrapped bool `json:"wrapped,omitempty"`
}
XML a metadata object that allows for more fine-tuned XML model definitions.
func (XML) MarshalJSON ¶
MarshalJSON implements json.Marshaler for XML.
Source Files
¶
- callback.go
- components.go
- cons.go
- contact.go
- contact_easyjson.go
- discriminator.go
- doc.go
- encoding.go
- example.go
- extensions.go
- external_documentation.go
- external_documentation_easyjson.go
- header.go
- info.go
- info_easyjson.go
- license.go
- license_easyjson.go
- link.go
- media_type.go
- oauth_flows.go
- openapi.go
- operation.go
- orderedmap.go
- parameter.go
- path_item.go
- paths.go
- reference.go
- request_body.go
- responses.go
- schema.go
- security_requirement.go
- security_scheme.go
- server.go
- server_easyjson.go
- tag.go
- tag_easyjson.go
- xml.go
- yaml.go