openapi3

package
v0.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSessionContext

func NewSessionContext(ctx context.Context) context.Context

NewSessionContext creates a session context

Types

type Callback

type Callback map[string]*PathItem

type CallbackRef

type CallbackRef struct {
	Ref      string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Callback `yaml:",inline"`
}

func (*CallbackRef) UnmarshalYAML

func (s *CallbackRef) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Callbacks

type Callbacks map[string]*CallbackRef

type Components

type Components struct {
	Extension       `json:",omitempty" yaml:",inline"`
	Schemas         Schemas         `json:"schemas,omitempty" yaml:"schemas,omitempty"`
	Parameters      ParametersMap   `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	Headers         Headers         `json:"headers,omitempty" yaml:"headers,omitempty"`
	RequestBodies   RequestBodies   `json:"requestBodies,omitempty" yaml:"requestBodies,omitempty"`
	Responses       Responses       `json:"responses,omitempty" yaml:"responses,omitempty"`
	SecuritySchemes SecuritySchemes `json:"securitySchemes,omitempty" yaml:"securitySchemes,omitempty"`
	Examples        Examples        `json:"examples,omitempty" yaml:"examples,omitempty"`
	Links           Links           `json:"links,omitempty" yaml:"links,omitempty"`
	Callbacks       Callbacks       `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
}

Components is specified by OpenAPI/Swagger standard version 3.0.

func (*Components) MarshalJSON

func (c *Components) MarshalJSON() ([]byte, error)

func (*Components) UnmarshalJSON

func (c *Components) UnmarshalJSON(b []byte) error

func (*Components) UnmarshalYAML

func (s *Components) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Contact

type Contact struct {
	Extension `json:",omitempty" yaml:",inline"`
	Name      string `json:"name,omitempty" yaml:"name,omitempty"`
	URL       string `json:"url,omitempty" yaml:"url,omitempty"`
	Email     string `json:"email,omitempty" yaml:"email,omitempty"`
}

Info represents document info

func (*Contact) MarshalJSON

func (c *Contact) MarshalJSON() ([]byte, error)

func (*Contact) UnmarshalJSON

func (c *Contact) UnmarshalJSON(b []byte) error

func (*Contact) UnmarshalYAML

func (c *Contact) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Content

type Content map[string]*MediaType

Content is specified by OpenAPI/Swagger 3.0 standard.

type CustomExtension

type CustomExtension Extension

CustomExtension represents custom extension

func (*CustomExtension) UnmarshalYAML

func (p *CustomExtension) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Discriminator

type Discriminator struct {
	PropertyName string            `json:"propertyName" yaml:"propertyName"`
	Mapping      map[string]string `json:"mapping,omitempty" yaml:"mapping,omitempty"`
}

type Encoding

type Encoding struct {
	Extension     `json:",omitempty" yaml:",inline"`
	ContentType   string  `json:"contentType,omitempty" yaml:"contentType,omitempty"`
	Headers       Headers `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 is specified by OpenAPI/Swagger 3.0 standard.

func (*Encoding) MarshalJSON

func (e *Encoding) MarshalJSON() ([]byte, error)

func (*Encoding) UnmarshalJSON

func (e *Encoding) UnmarshalJSON(b []byte) error

func (*Encoding) UnmarshalYAML

func (e *Encoding) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Example

type Example struct {
	Extension     `json:",omitempty" yaml:",inline"`
	Ref           string      `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	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"`
}

func (*Example) MarshalJSON

func (e *Example) MarshalJSON() ([]byte, error)

func (*Example) UnmarshalJSON

func (e *Example) UnmarshalJSON(b []byte) error

func (*Example) UnmarshalYAML

func (e *Example) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Examples

type Examples map[string]*Example

type Extension

type Extension map[string]interface{}

func (*Extension) UnmarshalJSON

func (e *Extension) UnmarshalJSON(b []byte) error

type ExternalDocumentation

type ExternalDocumentation struct {
	Extension   `json:",omitempty" yaml:",inline"`
	Description string `json:"description,omitempty"`
	URL         string `json:"url,omitempty"`
}

func (*ExternalDocumentation) MarshalJSON

func (e *ExternalDocumentation) MarshalJSON() ([]byte, error)

func (*ExternalDocumentation) UnmarshalJSON

func (e *ExternalDocumentation) UnmarshalJSON(b []byte) error

func (*ExternalDocumentation) UnmarshalYAML

func (e *ExternalDocumentation) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Headers

type Headers map[string]*Parameter

type Info

type Info struct {
	Extension      `json:",omitempty" yaml:",inline"`
	Title          string   `json:"title" yaml:"title"` // Required
	Description    string   `json:"description,omitempty" yaml:"description,omitempty"`
	TermsOfService string   `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty"`
	Contact        *Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
	License        *License `json:"license,omitempty" yaml:"license,omitempty"`
	Version        string   `json:"version" yaml:"version"` // Required
}

Info represents document info

func (*Info) MarshalJSON

func (i *Info) MarshalJSON() ([]byte, error)

func (*Info) UnmarshalJSON

func (i *Info) UnmarshalJSON(b []byte) error

func (*Info) UnmarshalYAML

func (i *Info) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type License

type License struct {
	Extension `json:",omitempty" yaml:",inline"`
	Name      string `json:"name" yaml:"name"` // Required
	URL       string `json:"url,omitempty" yaml:"url,omitempty"`
}

Info represents document info

func (*License) MarshalJSON

func (l *License) MarshalJSON() ([]byte, error)

func (*License) UnmarshalJSON

func (l *License) UnmarshalJSON(b []byte) error

func (*License) UnmarshalYAML

func (l *License) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error
type Link struct {
	Extension    `json:",omitempty" yaml:",inline"`
	Ref          string                 `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	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"`
}

func (*Link) MarshalJSON

func (l *Link) MarshalJSON() ([]byte, error)

func (*Link) UnmarshalJSON

func (l *Link) UnmarshalJSON(b []byte) error

func (*Link) UnmarshalYAML

func (s *Link) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error
type Links map[string]*Link

type MediaType

type MediaType struct {
	Extension `json:",omitempty" yaml:",inline"`
	Schema    *Schema              `json:"schema,omitempty" yaml:"schema,omitempty"`
	Example   interface{}          `json:"example,omitempty" yaml:"example,omitempty"`
	Examples  Examples             `json:"examples,omitempty" yaml:"examples,omitempty"`
	Encoding  map[string]*Encoding `json:"encoding,omitempty" yaml:"encoding,omitempty"`
}

MediaType is specified by OpenAPI/Swagger 3.0 standard.

func (*MediaType) MarshalJSON

func (m *MediaType) MarshalJSON() ([]byte, error)

func (*MediaType) UnmarshalJSON

func (m *MediaType) UnmarshalJSON(b []byte) error

func (*MediaType) UnmarshalYAML

func (s *MediaType) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type OAuthFlow

type OAuthFlow struct {
	Extension        `json:",omitempty" yaml:",inline"`
	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"`
}

func (*OAuthFlow) MarshalJSON

func (o *OAuthFlow) MarshalJSON() ([]byte, error)

func (*OAuthFlow) UnmarshalJSON

func (o *OAuthFlow) UnmarshalJSON(b []byte) error

func (*OAuthFlow) UnmarshalYAML

func (s *OAuthFlow) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type OAuthFlows

type OAuthFlows struct {
	Extension         `json:",omitempty" yaml:",inline"`
	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"`
}

func (*OAuthFlows) MarshalJSON

func (o *OAuthFlows) MarshalJSON() ([]byte, error)

func (*OAuthFlows) UnmarshalJSON

func (o *OAuthFlows) UnmarshalJSON(b []byte) error

func (*OAuthFlows) UnmarshalYAML

func (s *OAuthFlows) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type OpenAPI

type OpenAPI struct {
	OpenAPI      string                 `json:"openapi" yaml:"openapi"` // Required
	Components   Components             `json:"components,omitempty" yaml:"components,omitempty"`
	Info         *Info                  `json:"info" yaml:"info"`   // Required
	Paths        Paths                  `json:"paths" yaml:"paths"` // Required
	Security     SecurityRequirements   `json:"security,omitempty" yaml:"security,omitempty"`
	Servers      Servers                `json:"servers,omitempty" yaml:"servers,omitempty"`
	Tags         Tags                   `json:"tags,omitempty" yaml:"tags,omitempty"`
	ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}

OpenAPI represents OpenAPI 3.0 document

type Operation

type Operation struct {
	Extension `json:",omitempty" yaml:",inline"`

	// Optional tags for documentation.
	Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`

	// Optional short summary.
	Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`

	// Optional description. Should use CommonMark syntax.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	// Optional operation ID.
	OperationID string `json:"operationId,omitempty" yaml:"operationId,omitempty"`

	// Optional parameters.
	Parameters Parameters `json:"parameters,omitempty" yaml:"parameters,omitempty"`

	// Optional body parameter.
	RequestBody *RequestBody `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`

	// Responses.
	Responses Responses `json:"responses" yaml:"responses"` // Required

	// Optional callbacks
	Callbacks Callbacks `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`

	Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`

	// Optional security requirements that overrides top-level security.
	Security *SecurityRequirements `json:"security,omitempty" yaml:"security,omitempty"`

	// Optional servers that overrides top-level servers.
	Servers *Servers `json:"servers,omitempty" yaml:"servers,omitempty"`

	ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}

func (*Operation) MarshalJSON

func (o *Operation) MarshalJSON() ([]byte, error)

func (*Operation) UnmarshalJSON

func (o *Operation) UnmarshalJSON(b []byte) error

func (*Operation) UnmarshalYAML

func (o *Operation) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Parameter

type Parameter struct {
	Extension       `json:",omitempty" yaml:",inline"`
	Ref             string      `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	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          *Schema     `json:"schema,omitempty" yaml:"schema,omitempty"`
	Example         interface{} `json:"example,omitempty" yaml:"example,omitempty"`
	Examples        Examples    `json:"examples,omitempty" yaml:"examples,omitempty"`
	Content         Content     `json:"content,omitempty" yaml:"content,omitempty"`
}

func (*Parameter) MarshalJSON

func (p *Parameter) MarshalJSON() ([]byte, error)

func (*Parameter) UnmarshalJSON

func (p *Parameter) UnmarshalJSON(b []byte) error

func (*Parameter) UnmarshalYAML

func (p *Parameter) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Parameters

type Parameters []*Parameter

type ParametersMap

type ParametersMap map[string]*Parameter

type PathItem

type PathItem struct {
	Extension   `json:",omitempty" yaml:",inline"`
	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"`
}

Paths represents a path defined by OpenAPI/Swagger standard version 3.0.

func (*PathItem) MarshalJSON

func (p *PathItem) MarshalJSON() ([]byte, error)

func (*PathItem) UnmarshalJSON

func (p *PathItem) UnmarshalJSON(b []byte) error

func (*PathItem) UnmarshalYAML

func (s *PathItem) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Paths

type Paths map[string]*PathItem

Paths represents a path defined by OpenAPI/Swagger standard version 3.0.

type RequestBodies

type RequestBodies map[string]*RequestBody

type RequestBody

type RequestBody struct {
	Extension   `json:",omitempty" yaml:",inline"`
	Ref         string  `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	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 is specified by OpenAPI/Swagger 3.0 standard.

func (*RequestBody) MarshalJSON

func (r *RequestBody) MarshalJSON() ([]byte, error)

func (*RequestBody) UnmarshalJSON

func (r *RequestBody) UnmarshalJSON(b []byte) error

func (*RequestBody) UnmarshalYAML

func (s *RequestBody) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Response

type Response struct {
	Extension   `json:",omitempty" yaml:",inline"`
	Ref         string  `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Description *string `json:"description,omitempty" yaml:"description,omitempty"`
	Headers     Headers `json:"headers,omitempty" yaml:"headers,omitempty"`
	Content     Content `json:"content,omitempty" yaml:"content,omitempty"`
	Links       Links   `json:"links,omitempty" yaml:"links,omitempty"`
}

Response is specified by OpenAPI/Swagger 3.0 standard.

func (*Response) MarshalJSON

func (r *Response) MarshalJSON() ([]byte, error)

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(b []byte) error

func (*Response) UnmarshalYAML

func (s *Response) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Responses

type Responses map[interface{}]*Response

Responses is specified by OpenAPI/Swagger 3.0 standard.

type Schema

type Schema struct {
	Extension `json:",omitempty" yaml:",inline"`

	Ref   string     `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Type  string     `json:"type,omitempty" yaml:"type,omitempty"`
	AllOf SchemaList `json:"allOf,omitempty" yaml:"allOf,omitempty"`
	OneOf SchemaList `json:"oneOf,omitempty" yaml:"oneOf,omitempty"`
	AnyOf SchemaList `json:"anyOf,omitempty" yaml:"anyOf,omitempty"`

	Not   *Schema `json:"not,omitempty" yaml:"not,omitempty"`
	Items *Schema `json:"items,omitempty" yaml:"items,omitempty"`

	Properties                  Schemas     `json:"properties,omitempty" yaml:"properties,omitempty"`
	AdditionalPropertiesAllowed *bool       `multijson:"additionalProperties,omitempty" json:"-" yaml:"-"` // In this order...
	AdditionalProperties        *Schema     `multijson:"additionalProperties,omitempty" json:"-" yaml:"-"` // ...for multijson
	Description                 string      `json:"description,omitempty" yaml:"description,omitempty"`
	Format                      string      `json:"format,omitempty" yaml:"format,omitempty"`
	Default                     interface{} `json:"default,omitempty" yaml:"default,omitempty"`

	// Properties
	Nullable      bool           `json:"nullable,omitempty" yaml:"nullable,omitempty"`
	Discriminator *Discriminator `json:"discriminator,omitempty" yaml:"discriminator,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"`
	ExternalDocs    *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	Deprecated      bool                   `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	Example         interface{}            `json:"example,omitempty" yaml:"example,omitempty"`

	Title      string   `json:"title,omitempty" yaml:"title,omitempty"`
	MultipleOf *float64 `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"`

	Max          *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty"`
	ExclusiveMax bool     `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"`
	Min          *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty"`
	ExclusiveMin bool     `json:"exclusiveMinimum,omitempty" yaml:"exclusiveMinimum,omitempty"`

	MaxLength *uint64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`
	MinLength uint64  `json:"minLength,omitempty" yaml:"minLength,omitempty"`
	Pattern   string  `json:"pattern,omitempty" yaml:"pattern,omitempty"`

	MaxItems    *uint64 `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
	MinItems    uint64  `json:"minItems,omitempty" yaml:"minItems,omitempty"`
	UniqueItems bool    `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"`

	MaxProps *uint64       `json:"maxProperties,omitempty" yaml:"maxProperties,omitempty"`
	MinProps uint64        `json:"minProperties,omitempty" yaml:"minProperties,omitempty"`
	Required []string      `json:"required,omitempty" yaml:"required,omitempty"`
	Enum     []interface{} `json:"enum,omitempty" yaml:"enum,omitempty"`
}

func (*Schema) MarshalJSON

func (s *Schema) MarshalJSON() ([]byte, error)

func (*Schema) UnmarshalJSON

func (s *Schema) UnmarshalJSON(b []byte) error

func (*Schema) UnmarshalYAML

func (s *Schema) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type SchemaList

type SchemaList []*Schema

type Schemas

type Schemas map[string]*Schema

type SecurityRequirement

type SecurityRequirement map[string][]string

type SecurityRequirements

type SecurityRequirements []SecurityRequirement

type SecurityScheme

type SecurityScheme struct {
	Extension        `json:",omitempty" yaml:",inline"`
	Ref              string      `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	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"`
}

func (*SecurityScheme) MarshalJSON

func (s *SecurityScheme) MarshalJSON() ([]byte, error)

func (*SecurityScheme) UnmarshalJSON

func (s *SecurityScheme) UnmarshalJSON(b []byte) error

func (*SecurityScheme) UnmarshalYAML

func (s *SecurityScheme) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type SecuritySchemes

type SecuritySchemes map[string]*SecurityScheme

type Server

type Server struct {
	Extension   `json:",omitempty" yaml:",inline"`
	URL         string                    `json:"url" yaml:"url"`
	Description string                    `json:"description,omitempty" yaml:"description,omitempty"`
	Variables   map[string]ServerVariable `json:"variables,omitempty" yaml:"variables,omitempty"`
}

Server represents a server node defined is specified by OpenAPI/Swagger standard version 3.0.

func (*Server) MarshalJSON

func (s *Server) MarshalJSON() ([]byte, error)

func (*Server) UnmarshalJSON

func (s *Server) UnmarshalJSON(b []byte) error

func (*Server) UnmarshalYAML

func (s *Server) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type ServerVariable

type ServerVariable struct {
	Extension   `json:",omitempty" yaml:",inline"`
	Enum        []string `json:"enum,omitempty" yaml:"enum,omitempty"`
	Default     string   `json:"default,omitempty" yaml:"default,omitempty"`
	Description string   `json:"description,omitempty" yaml:"description,omitempty"`
}

ServerVariable represents server variables defined by OpenAPI/Swagger standard version 3.0.

func (*ServerVariable) MarshalJSON

func (s *ServerVariable) MarshalJSON() ([]byte, error)

func (*ServerVariable) UnmarshalJSON

func (s *ServerVariable) UnmarshalJSON(b []byte) error

func (*ServerVariable) UnmarshalYAML

func (s *ServerVariable) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Servers

type Servers []Server

Server represents a server node defined is specified by OpenAPI/Swagger standard version 3.0.

type Session

type Session struct {
	Location string
	// contains filtered or unexported fields
}

func LookupSession

func LookupSession(ctx context.Context) *Session

LookupSession lookup session

func NewSession

func NewSession() *Session

func (*Session) AddDefer

func (s *Session) AddDefer(fn func() error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) LookupCallback

func (s *Session) LookupCallback(location string, ref string) (*CallbackRef, error)

LookupLink lookup callback

func (*Session) LookupExample

func (s *Session) LookupExample(location string, ref string) (*Example, error)

LookupExample lookup example

func (*Session) LookupHeaders

func (s *Session) LookupHeaders(location string, ref string) (*Parameter, error)

LookupHeaders lookup headers

func (s *Session) LookupLink(location string, ref string) (*Link, error)

LookupLink lookup link

func (*Session) LookupParameter

func (s *Session) LookupParameter(location string, ref string) (*Parameter, error)

LookupParameter lookup parameters

func (*Session) LookupRequestBody

func (s *Session) LookupRequestBody(location string, ref string) (*RequestBody, error)

LookupRequestBody lookup request body

func (*Session) LookupResponse

func (s *Session) LookupResponse(location string, ref string) (*Response, error)

LookupResponse lookup response

func (*Session) LookupSchema

func (s *Session) LookupSchema(location string, ref string) (*Schema, error)

LookupSchema lookups schema

func (*Session) LookupSecurityScheme

func (s *Session) LookupSecurityScheme(location string, ref string) (*SecurityScheme, error)

LookupSecurityScheme lookup security scheme

func (*Session) RegisterComponents

func (s *Session) RegisterComponents(location string, components *Components)

RegisterComponents returns location components

type Tag

type Tag struct {
	Extension    `json:",omitempty" yaml:",inline"`
	Name         string                 `json:"name,omitempty" yaml:"name,omitempty"`
	Description  string                 `json:"description,omitempty" yaml:"description,omitempty"`
	ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}

func (*Tag) MarshalJSON

func (t *Tag) MarshalJSON() ([]byte, error)

func (*Tag) UnmarshalJSON

func (t *Tag) UnmarshalJSON(b []byte) error

func (*Tag) UnmarshalYAML

func (s *Tag) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

type Tags

type Tags []*Tag

type XML

type XML struct {
	Extension `json:",omitempty" yaml:",inline"`
	Name      string `json:"name,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	Prefix    string `json:"prefix,omitempty"`
	Attribute bool   `json:"attribute,omitempty"`
	Wrapped   bool   `json:"wrapped,omitempty"`
}

func (*XML) MarshalJSON

func (s *XML) MarshalJSON() ([]byte, error)

func (*XML) UnmarshalJSON

func (s *XML) UnmarshalJSON(b []byte) error

func (*XML) UnmarshalYAML

func (s *XML) UnmarshalYAML(ctx context.Context, fn func(dest interface{}) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL