Documentation
¶
Index ¶
- func MarshalRef(value string, otherwise interface{}) ([]byte, error)
- type Callback
- type CallbackRef
- type Components
- type Contact
- type Content
- type Discriminator
- type Encoding
- type Example
- type ExampleRef
- type ExtensionProps
- type ExternalDocs
- type Header
- type HeaderRef
- type Info
- type License
- type Link
- type LinkRef
- type MediaType
- type OAuthFlow
- type OAuthFlows
- type OpenAPI
- type Operation
- type Parameter
- type ParameterRef
- type Parameters
- type PathItem
- type Paths
- type RequestBody
- type RequestBodyRef
- type Response
- type ResponseRef
- type Responses
- type Schema
- type SchemaRef
- type SecurityRequirement
- type SecurityRequirements
- type SecurityScheme
- type SecuritySchemeRef
- type Server
- type ServerVariable
- type Servers
- type Tag
- type Tags
- type XML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalRef ¶
////////////////////////////////////////////////////////////////////////////////////////
Types ¶
type Callback ¶
Callback : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#callback-object
type CallbackRef ¶
CallbackRef
func (*CallbackRef) MarshalYAML ¶
func (value *CallbackRef) MarshalYAML() ([]byte, error)
func (*CallbackRef) UnMarshalYAML ¶
func (value *CallbackRef) UnMarshalYAML(data []byte) error
type Components ¶
type Components struct {
Schemas map[string]*SchemaRef `json:"schemas,omitempty" yaml:"schemas,omitempty"`
Parameters map[string]*ParameterRef `json:"parameters,omitempty" yaml:"parameters,omitempty"`
Headers map[string]*HeaderRef `json:"headers,omitempty" yaml:"headers,omitempty"`
RequestBodies map[string]*RequestBodyRef `json:"requestBodies,omitempty" yaml:"requestBodies,omitempty"`
Responses map[string]*ResponseRef `json:"responses,omitempty" yaml:"responses,omitempty"`
SecuritySchemes map[string]*SecuritySchemeRef `json:"securitySchemes,omitempty" yaml:"securitySchemes,omitempty"`
Examples map[string]*ExampleRef `json:"examples,omitempty" yaml:"examples,omitempty"`
Links map[string]*LinkRef `json:"links,omitempty" yaml:"links,omitempty"`
Callbacks map[string]*CallbackRef `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
ExtensionProps
}
Components : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#components-object
type Contact ¶
type Contact struct {
// The identifying name of the contact person/organization.
Name string `json:"name,omitempty" yaml:"name,omitempty"`
// The URL pointing to the contact information. MUST be in the format of a URL.
URL string `json:"url,omitempty" yaml:"url,omitempty" validate:"url"`
// The email address of the contact person/organization. MUST be in the format of an email address.
Email string `json:"email,omitempty" yaml:"email,omitempty" validate:"email"`
// This object MAY be extended with Specification Extensions.
ExtensionProps
}
Contact information for the exposed API. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#contact-object
type Discriminator ¶
type Discriminator struct {
ExtensionProps
PropertyName string `json:"propertyName" yaml:"propertyName"`
Mapping map[string]string `json:"mapping,omitempty" yaml:"mapping,omitempty"`
}
Discriminator : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#discriminator-object
type Encoding ¶
type Encoding struct {
ExtensionProps
ContentType string `json:"contentType,omitempty" yaml:"contentType,omitempty"`
Headers map[string]*HeaderRef `json:"headers,omitempty" yaml:"headers,omitempty"`
Style string `json:"style,omitempty" yaml:"style,omitempty"`
Explode *bool `json:"explode,omitempty" yaml:"explode,omitempty"`
AllowReserved bool `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
}
Encoding : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#encoding-object
type Example ¶
type Example struct {
ExtensionProps
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Value interface{} `json:"value,omitempty" yaml:"value,omitempty"`
ExternalValue string `json:"externalValue,omitempty" yaml:"externalValue,omitempty"`
}
Example : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#example-object
type ExampleRef ¶
ExampleRef
func (*ExampleRef) MarshalYAML ¶
func (value *ExampleRef) MarshalYAML() ([]byte, error)
func (*ExampleRef) UnMarshalYAML ¶
func (value *ExampleRef) UnMarshalYAML(data []byte) error
type ExtensionProps ¶
type ExtensionProps struct {
Extensions map[string]interface{} `json:"-" yaml:"-"`
}
type ExternalDocs ¶
type ExternalDocs struct {
ExtensionProps
Description string `json:"description,omitempty" yaml:"description,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
}
ExternalDocumentation : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#external-documentation-object
type Header ¶
type Header struct {
ExtensionProps
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Schema *SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
Example interface{} `json:"example,omitempty" yaml:"example,omitempty"`
Examples map[string]*ExampleRef `json:"examples,omitempty" yaml:"examples,omitempty"`
Content Content `json:"content,omitempty" yaml:"content,omitempty"`
}
type Info ¶
type Info struct {
// REQUIRED. The title of the API.
Title string `json:"title" yaml:"title"`
// A short summary of the API.
Summary string `json:"summary" yaml:"summary"`
// A short description of the API. CommonMark syntax MAY be used for rich text representation.
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// A URL to the Terms of Service for the API. MUST be in the format of a URL.
TermsOfService string `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty" validate:"url"`
// The contact information for the exposed API.
Contact *Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
// The license information for the exposed API.
License *License `json:"license,omitempty" yaml:"license,omitempty"`
// REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification version or the API implementation version).
Version string `json:"version" yaml:"version" validate:"required"`
// This object MAY be extended with Specification Extensions.
ExtensionProps
}
Info is the object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#infoObject
type License ¶
type License struct {
// REQUIRED. The license name used for the API.
Name string `json:"name" yaml:"name" validate:"required"`
// An SPDX license expression for the API. The identifier field is mutually exclusive of the url field.
Identifier string `json:"identifier" yaml:"identifier"`
// A URL to the license used for the API. MUST be in the format of a URL. The url field is mutually exclusive of the identifier field.
URL string `json:"url,omitempty" yaml:"url,omitempty" validate:"url"`
// This object MAY be extended with Specification Extensions.
ExtensionProps
}
License information for the exposed API. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#license-object
type Link ¶
type Link struct {
ExtensionProps
OperationID string `json:"operationId,omitempty" yaml:"operationId,omitempty"`
OperationRef string `json:"operationRef,omitempty" yaml:"operationRef,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty" yaml:"parameters,omitempty"`
Server *Server `json:"server,omitempty" yaml:"server,omitempty"`
RequestBody interface{} `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
}
Link Object.
type MediaType ¶
type MediaType struct {
ExtensionProps
Schema *SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
Example interface{} `json:"example,omitempty" yaml:"example,omitempty"`
Examples map[string]*ExampleRef `json:"examples,omitempty" yaml:"examples,omitempty"`
Encoding map[string]*Encoding `json:"encoding,omitempty" yaml:"encoding,omitempty"`
}
MediaType Object.
type OAuthFlow ¶
type OAuthFlow struct {
ExtensionProps
AuthorizationURL string `json:"authorizationUrl,omitempty" yaml:"authorizationUrl,omitempty"`
TokenURL string `json:"tokenUrl,omitempty" yaml:"tokenUrl,omitempty"`
RefreshURL string `json:"refreshUrl,omitempty" yaml:"refreshUrl,omitempty"`
Scopes map[string]string `json:"scopes" yaml:"scopes"`
}
OAuthFlow Object.
type OAuthFlows ¶
type OAuthFlows struct {
ExtensionProps
Implicit *OAuthFlow `json:"implicit,omitempty" yaml:"implicit,omitempty"`
Password *OAuthFlow `json:"password,omitempty" yaml:"password,omitempty"`
ClientCredentials *OAuthFlow `json:"clientCredentials,omitempty" yaml:"clientCredentials,omitempty"`
AuthorizationCode *OAuthFlow `json:"authorizationCode,omitempty" yaml:"authorizationCode,omitempty"`
}
OAuthFlows Object
type OpenAPI ¶
type OpenAPI struct {
// 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 API info.version string.
OpenAPI string `json:"openapi" yaml:"openapi" validate:"required"`
// REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.
Info *Info `json:"info" yaml:"info" validate:"required"`
// An array of Server Objects, which provide connectivity information to a target server. If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /.
Servers Servers `json:"servers,omitempty" yaml:"servers,omitempty"`
// The available paths and operations for the API.
Paths Paths `json:"paths" yaml:"paths"`
// webhooks
//
Security SecurityRequirements `json:"security,omitempty" yaml:"security,omitempty"`
Tags Tags `json:"tags,omitempty" yaml:"tags,omitempty"`
Components Components `json:"components,omitempty" yaml:"components,omitempty"`
ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
ExtensionProps
}
OpenAPI is the root object of the OpenAPI document. https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#openapi-object
func LoadWithValidation ¶
type Operation ¶
type Operation struct {
ExtensionProps
Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
OperationID string `json:"operationId,omitempty" yaml:"operationId,omitempty"`
Parameters Parameters `json:"parameters,omitempty" yaml:"parameters,omitempty"`
RequestBody *RequestBodyRef `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
Responses Responses `json:"responses" yaml:"responses"` // Required
Callbacks map[string]*CallbackRef `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
Security *SecurityRequirements `json:"security,omitempty" yaml:"security,omitempty"`
Servers *Servers `json:"servers,omitempty" yaml:"servers,omitempty"`
ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}
Operation Object.
type Parameter ¶
type Parameter struct {
ExtensionProps
Name string `json:"name,omitempty" yaml:"name,omitempty"`
In string `json:"in,omitempty" yaml:"in,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Style string `json:"style,omitempty" yaml:"style,omitempty"`
Explode *bool `json:"explode,omitempty" yaml:"explode,omitempty"`
AllowEmptyValue bool `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"`
AllowReserved bool `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Schema *SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
Example interface{} `json:"example,omitempty" yaml:"example,omitempty"`
Examples map[string]*ExampleRef `json:"examples,omitempty" yaml:"examples,omitempty"`
Content Content `json:"content,omitempty" yaml:"content,omitempty"`
}
Parameter Object.
type ParameterRef ¶
ParameterRef
func (*ParameterRef) MarshalYAML ¶
func (value *ParameterRef) MarshalYAML() ([]byte, error)
func (*ParameterRef) UnMarshalYAML ¶
func (value *ParameterRef) UnMarshalYAML(data []byte) error
type Parameters ¶
type Parameters []*ParameterRef
type PathItem ¶
type PathItem struct {
ExtensionProps
Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Connect *Operation `json:"connect,omitempty" yaml:"connect,omitempty"`
Delete *Operation `json:"delete,omitempty" yaml:"delete,omitempty"`
Get *Operation `json:"get,omitempty" yaml:"get,omitempty"`
Head *Operation `json:"head,omitempty" yaml:"head,omitempty"`
Options *Operation `json:"options,omitempty" yaml:"options,omitempty"`
Patch *Operation `json:"patch,omitempty" yaml:"patch,omitempty"`
Post *Operation `json:"post,omitempty" yaml:"post,omitempty"`
Put *Operation `json:"put,omitempty" yaml:"put,omitempty"`
Trace *Operation `json:"trace,omitempty" yaml:"trace,omitempty"`
Servers Servers `json:"servers,omitempty" yaml:"servers,omitempty"`
Parameters Parameters `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}
PathItem Object.
type RequestBody ¶
type RequestBody struct {
ExtensionProps
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Content Content `json:"content,omitempty" yaml:"content,omitempty"`
}
RequestBody Object.
type RequestBodyRef ¶
type RequestBodyRef struct {
Ref string
Value RequestBody
}
RequestBodyRef
func (*RequestBodyRef) MarshalYAML ¶
func (value *RequestBodyRef) MarshalYAML() ([]byte, error)
func (*RequestBodyRef) UnMarshalYAML ¶
func (value *RequestBodyRef) UnMarshalYAML(data []byte) error
type Response ¶
type Response struct {
ExtensionProps
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
Headers map[string]*HeaderRef `json:"headers,omitempty" yaml:"headers,omitempty"`
Content Content `json:"content,omitempty" yaml:"content,omitempty"`
Links map[string]*LinkRef `json:"links,omitempty" yaml:"links,omitempty"`
}
Response Object.
type ResponseRef ¶
ResponseRef
func (*ResponseRef) MarshalYAML ¶
func (value *ResponseRef) MarshalYAML() ([]byte, error)
func (*ResponseRef) UnmarshalYAML ¶
func (value *ResponseRef) UnmarshalYAML(data []byte) error
type Responses ¶
type Responses map[string]*ResponseRef
type Schema ¶
type Schema struct {
ExtensionProps
OneOf []*SchemaRef `json:"oneOf,omitempty" yaml:"oneOf,omitempty"`
AnyOf []*SchemaRef `json:"anyOf,omitempty" yaml:"anyOf,omitempty"`
AllOf []*SchemaRef `json:"allOf,omitempty" yaml:"allOf,omitempty"`
Not *SchemaRef `json:"not,omitempty" yaml:"not,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Title string `json:"title,omitempty" yaml:"title,omitempty"`
Format string `json:"format,omitempty" yaml:"format,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Enum []interface{} `json:"enum,omitempty" yaml:"enum,omitempty"`
Default interface{} `json:"default,omitempty" yaml:"default,omitempty"`
Example interface{} `json:"example,omitempty" yaml:"example,omitempty"`
ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
// Object-related, here for struct compactness
AdditionalPropertiesAllowed *bool `json:"-" multijson:"additionalProperties,omitempty" yaml:"-"`
// Array-related, here for struct compactness
UniqueItems bool `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"`
// Number-related, here for struct compactness
ExclusiveMin bool `json:"exclusiveMinimum,omitempty" yaml:"exclusiveMinimum,omitempty"`
ExclusiveMax bool `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"`
// Properties
Nullable bool `json:"nullable,omitempty" yaml:"nullable,omitempty"`
ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
WriteOnly bool `json:"writeOnly,omitempty" yaml:"writeOnly,omitempty"`
AllowEmptyValue bool `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"`
XML *XML `json:"xml,omitempty" yaml:"xml,omitempty"`
Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
// Number
Min *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty"`
Max *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty"`
MultipleOf *float64 `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"`
// String
MinLength uint64 `json:"minLength,omitempty" yaml:"minLength,omitempty"`
MaxLength *uint64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`
Pattern string `json:"pattern,omitempty" yaml:"pattern,omitempty"`
// Array
MinItems uint64 `json:"minItems,omitempty" yaml:"minItems,omitempty"`
MaxItems *uint64 `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
Items *SchemaRef `json:"items,omitempty" yaml:"items,omitempty"`
// Object
Required []string `json:"required,omitempty" yaml:"required,omitempty"`
Properties map[string]*SchemaRef `json:"properties,omitempty" yaml:"properties,omitempty"`
MinProps uint64 `json:"minProperties,omitempty" yaml:"minProperties,omitempty"`
MaxProps *uint64 `json:"maxProperties,omitempty" yaml:"maxProperties,omitempty"`
AdditionalProperties *SchemaRef `json:"-" multijson:"additionalProperties,omitempty" yaml:"-"`
Discriminator *Discriminator `json:"discriminator,omitempty" yaml:"discriminator,omitempty"`
// contains filtered or unexported fields
}
type SecurityRequirement ¶
type SecurityRequirements ¶
type SecurityRequirements []SecurityRequirement
type SecurityScheme ¶
type SecurityScheme struct {
ExtensionProps
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Name string `json:"name,omitempty" yaml:"name,omitempty"`
In string `json:"in,omitempty" yaml:"in,omitempty"`
Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
BearerFormat string `json:"bearerFormat,omitempty" yaml:"bearerFormat,omitempty"`
Flows *OAuthFlows `json:"flows,omitempty" yaml:"flows,omitempty"`
OpenIDConnectURL string `json:"openIdConnectUrl,omitempty" yaml:"openIdConnectUrl,omitempty"`
}
SecurityScheme Object
type SecuritySchemeRef ¶
type SecuritySchemeRef struct {
Ref string
Value SecurityScheme
}
SecuritySchemeRef
func (*SecuritySchemeRef) MarshalYAML ¶
func (value *SecuritySchemeRef) MarshalYAML() ([]byte, error)
func (*SecuritySchemeRef) UnMarshalYAML ¶
func (value *SecuritySchemeRef) UnMarshalYAML(data []byte) error
type Server ¶
type Server struct {
URL string `json:"url,omitempty"`
Description string `json:"description,omitempty"`
Variables map[string]*ServerVariable `json:"variables,omitempty"`
}
Server : https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#fixed-fields-4
type ServerVariable ¶
type ServerVariable struct {
Enum []interface{} `json:"enum,omitempty" yaml:"enum,omitempty"`
Default interface{} `json:"default,omitempty" yaml:"default,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
}
ServerVariable Object.
type Tag ¶
type Tag struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}
Tag Object.
Source Files
¶
- callback.go
- components.go
- contact.go
- content.go
- discriminator.go
- encoding.go
- example.go
- extension.go
- external_docs.go
- gopenapi.go
- header.go
- info.go
- license.go
- link.go
- media_type.go
- oauth_flows.go
- oauthflow.go
- openapi.go
- operation.go
- parameter.go
- path_item.go
- paths.go
- refs.go
- request_body.go
- response.go
- schema.go
- security_requirement.go
- security_scheme.go
- server.go
- server_variable.go
- tag.go
- utils.go
- xml.go