openapi3

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: MIT Imports: 12 Imported by: 93

Documentation

Overview

Package openapi3 contains JSON mapping structures.

Index

Examples

Constants

View Source
const (
	ParameterInPath   = ParameterIn("path")
	ParameterInQuery  = ParameterIn("query")
	ParameterInHeader = ParameterIn("header")
	ParameterInCookie = ParameterIn("cookie")
)

ParameterIn values enumeration.

View Source
const (
	SchemaTypeArray   = SchemaType("array")
	SchemaTypeBoolean = SchemaType("boolean")
	SchemaTypeInteger = SchemaType("integer")
	SchemaTypeNumber  = SchemaType("number")
	SchemaTypeObject  = SchemaType("object")
	SchemaTypeString  = SchemaType("string")
)

SchemaType values enumeration.

View Source
const (
	EncodingStyleForm           = EncodingStyle("form")
	EncodingStyleSpaceDelimited = EncodingStyle("spaceDelimited")
	EncodingStylePipeDelimited  = EncodingStyle("pipeDelimited")
	EncodingStyleDeepObject     = EncodingStyle("deepObject")
)

EncodingStyle values enumeration.

View Source
const (
	PathParameterStyleMatrix = PathParameterStyle("matrix")
	PathParameterStyleLabel  = PathParameterStyle("label")
	PathParameterStyleSimple = PathParameterStyle("simple")
)

PathParameterStyle values enumeration.

View Source
const (
	QueryParameterStyleForm           = QueryParameterStyle("form")
	QueryParameterStyleSpaceDelimited = QueryParameterStyle("spaceDelimited")
	QueryParameterStylePipeDelimited  = QueryParameterStyle("pipeDelimited")
	QueryParameterStyleDeepObject     = QueryParameterStyle("deepObject")
)

QueryParameterStyle values enumeration.

View Source
const (
	APIKeySecuritySchemeInHeader = APIKeySecuritySchemeIn("header")
	APIKeySecuritySchemeInQuery  = APIKeySecuritySchemeIn("query")
	APIKeySecuritySchemeInCookie = APIKeySecuritySchemeIn("cookie")
)

APIKeySecuritySchemeIn values enumeration.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeySecurityScheme

type APIKeySecurityScheme struct {
	Name          string                 `json:"name"` // Required.
	In            APIKeySecuritySchemeIn `json:"in"`   // Required.
	Description   *string                `json:"description,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

APIKeySecurityScheme structure is generated from "#/definitions/APIKeySecurityScheme".

func (APIKeySecurityScheme) MarshalJSON

func (a APIKeySecurityScheme) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*APIKeySecurityScheme) UnmarshalJSON

func (a *APIKeySecurityScheme) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*APIKeySecurityScheme) WithDescription

func (a *APIKeySecurityScheme) WithDescription(val string) *APIKeySecurityScheme

WithDescription sets Description value.

func (*APIKeySecurityScheme) WithIn

WithIn sets In value.

func (*APIKeySecurityScheme) WithMapOfAnything

func (a *APIKeySecurityScheme) WithMapOfAnything(val map[string]interface{}) *APIKeySecurityScheme

WithMapOfAnything sets MapOfAnything value.

func (*APIKeySecurityScheme) WithMapOfAnythingItem

func (a *APIKeySecurityScheme) WithMapOfAnythingItem(key string, val interface{}) *APIKeySecurityScheme

WithMapOfAnythingItem sets MapOfAnything item value.

func (*APIKeySecurityScheme) WithName

WithName sets Name value.

type APIKeySecuritySchemeIn

type APIKeySecuritySchemeIn string

APIKeySecuritySchemeIn is an enum type.

func (APIKeySecuritySchemeIn) MarshalJSON

func (i APIKeySecuritySchemeIn) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*APIKeySecuritySchemeIn) UnmarshalJSON

func (i *APIKeySecuritySchemeIn) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type AuthorizationCodeOAuthFlow

type AuthorizationCodeOAuthFlow struct {
	// Format: uri-reference.
	// Required.
	AuthorizationURL string `json:"authorizationUrl"`
	// Format: uri-reference.
	// Required.
	TokenURL      string                 `json:"tokenUrl"`
	RefreshURL    *string                `json:"refreshUrl,omitempty"` // Format: uri-reference.
	Scopes        map[string]string      `json:"scopes,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

AuthorizationCodeOAuthFlow structure is generated from "#/definitions/AuthorizationCodeOAuthFlow".

func (AuthorizationCodeOAuthFlow) MarshalJSON

func (a AuthorizationCodeOAuthFlow) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*AuthorizationCodeOAuthFlow) UnmarshalJSON

func (a *AuthorizationCodeOAuthFlow) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*AuthorizationCodeOAuthFlow) WithAuthorizationURL

func (a *AuthorizationCodeOAuthFlow) WithAuthorizationURL(val string) *AuthorizationCodeOAuthFlow

WithAuthorizationURL sets AuthorizationURL value.

func (*AuthorizationCodeOAuthFlow) WithMapOfAnything

func (a *AuthorizationCodeOAuthFlow) WithMapOfAnything(val map[string]interface{}) *AuthorizationCodeOAuthFlow

WithMapOfAnything sets MapOfAnything value.

func (*AuthorizationCodeOAuthFlow) WithMapOfAnythingItem

func (a *AuthorizationCodeOAuthFlow) WithMapOfAnythingItem(key string, val interface{}) *AuthorizationCodeOAuthFlow

WithMapOfAnythingItem sets MapOfAnything item value.

func (*AuthorizationCodeOAuthFlow) WithRefreshURL

WithRefreshURL sets RefreshURL value.

func (*AuthorizationCodeOAuthFlow) WithScopes

WithScopes sets Scopes value.

func (*AuthorizationCodeOAuthFlow) WithScopesItem

WithScopesItem sets Scopes item value.

func (*AuthorizationCodeOAuthFlow) WithTokenURL

WithTokenURL sets TokenURL value.

type Bearer

type Bearer struct {
}

Bearer structure is generated from "#/definitions/HTTPSecurityScheme/oneOf/0".

Bearer.

Bearer.

func (Bearer) MarshalJSON

func (b Bearer) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*Bearer) UnmarshalJSON

func (b *Bearer) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type Callback

type Callback struct {
	MapOfAnything        map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
	AdditionalProperties map[string]PathItem    `json:"-"` // All unmatched properties.
}

Callback structure is generated from "#/definitions/Callback".

func (Callback) MarshalJSON

func (c Callback) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*Callback) UnmarshalJSON

func (c *Callback) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*Callback) WithAdditionalProperties

func (c *Callback) WithAdditionalProperties(val map[string]PathItem) *Callback

WithAdditionalProperties sets AdditionalProperties value.

func (*Callback) WithAdditionalPropertiesItem

func (c *Callback) WithAdditionalPropertiesItem(key string, val PathItem) *Callback

WithAdditionalPropertiesItem sets AdditionalProperties item value.

func (*Callback) WithMapOfAnything

func (c *Callback) WithMapOfAnything(val map[string]interface{}) *Callback

WithMapOfAnything sets MapOfAnything value.

func (*Callback) WithMapOfAnythingItem

func (c *Callback) WithMapOfAnythingItem(key string, val interface{}) *Callback

WithMapOfAnythingItem sets MapOfAnything item value.

type CallbackOrRef

type CallbackOrRef struct {
	CallbackReference *CallbackReference `json:"-"`
	Callback          *Callback          `json:"-"`
}

CallbackOrRef structure is generated from "#/definitions/CallbackOrRef".

func (*CallbackOrRef) CallbackEns added in v0.1.1

func (c *CallbackOrRef) CallbackEns() *Callback

CallbackEns ensures returned Callback is not nil.

func (*CallbackOrRef) CallbackReferenceEns added in v0.1.1

func (c *CallbackOrRef) CallbackReferenceEns() *CallbackReference

CallbackReferenceEns ensures returned CallbackReference is not nil.

func (CallbackOrRef) MarshalJSON

func (c CallbackOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*CallbackOrRef) UnmarshalJSON

func (c *CallbackOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*CallbackOrRef) WithCallback

func (c *CallbackOrRef) WithCallback(val Callback) *CallbackOrRef

WithCallback sets Callback value.

func (*CallbackOrRef) WithCallbackReference

func (c *CallbackOrRef) WithCallbackReference(val CallbackReference) *CallbackOrRef

WithCallbackReference sets CallbackReference value.

type CallbackReference

type CallbackReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

CallbackReference structure is generated from "#/definitions/CallbackReference".

func (CallbackReference) MarshalJSON

func (c CallbackReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*CallbackReference) UnmarshalJSON

func (c *CallbackReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*CallbackReference) WithRef

func (c *CallbackReference) WithRef(val string) *CallbackReference

WithRef sets Ref value.

type ClientCredentialsFlow

type ClientCredentialsFlow struct {
	// Format: uri-reference.
	// Required.
	TokenURL      string                 `json:"tokenUrl"`
	RefreshURL    *string                `json:"refreshUrl,omitempty"` // Format: uri-reference.
	Scopes        map[string]string      `json:"scopes,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

ClientCredentialsFlow structure is generated from "#/definitions/ClientCredentialsFlow".

func (ClientCredentialsFlow) MarshalJSON

func (c ClientCredentialsFlow) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ClientCredentialsFlow) UnmarshalJSON

func (c *ClientCredentialsFlow) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ClientCredentialsFlow) WithMapOfAnything

func (c *ClientCredentialsFlow) WithMapOfAnything(val map[string]interface{}) *ClientCredentialsFlow

WithMapOfAnything sets MapOfAnything value.

func (*ClientCredentialsFlow) WithMapOfAnythingItem

func (c *ClientCredentialsFlow) WithMapOfAnythingItem(key string, val interface{}) *ClientCredentialsFlow

WithMapOfAnythingItem sets MapOfAnything item value.

func (*ClientCredentialsFlow) WithRefreshURL

func (c *ClientCredentialsFlow) WithRefreshURL(val string) *ClientCredentialsFlow

WithRefreshURL sets RefreshURL value.

func (*ClientCredentialsFlow) WithScopes

func (c *ClientCredentialsFlow) WithScopes(val map[string]string) *ClientCredentialsFlow

WithScopes sets Scopes value.

func (*ClientCredentialsFlow) WithScopesItem

func (c *ClientCredentialsFlow) WithScopesItem(key string, val string) *ClientCredentialsFlow

WithScopesItem sets Scopes item value.

func (*ClientCredentialsFlow) WithTokenURL

func (c *ClientCredentialsFlow) WithTokenURL(val string) *ClientCredentialsFlow

WithTokenURL sets TokenURL value.

type Components

type Components struct {
	Schemas         *ComponentsSchemas         `json:"schemas,omitempty"`
	Responses       *ComponentsResponses       `json:"responses,omitempty"`
	Parameters      *ComponentsParameters      `json:"parameters,omitempty"`
	Examples        *ComponentsExamples        `json:"examples,omitempty"`
	RequestBodies   *ComponentsRequestBodies   `json:"requestBodies,omitempty"`
	Headers         *ComponentsHeaders         `json:"headers,omitempty"`
	SecuritySchemes *ComponentsSecuritySchemes `json:"securitySchemes,omitempty"`
	Links           *ComponentsLinks           `json:"links,omitempty"`
	Callbacks       *ComponentsCallbacks       `json:"callbacks,omitempty"`
	MapOfAnything   map[string]interface{}     `json:"-"` // Key must match pattern: `^x-`.
}

Components structure is generated from "#/definitions/Components".

func (*Components) CallbacksEns added in v0.1.1

func (c *Components) CallbacksEns() *ComponentsCallbacks

CallbacksEns ensures returned Callbacks is not nil.

func (*Components) ExamplesEns added in v0.1.1

func (c *Components) ExamplesEns() *ComponentsExamples

ExamplesEns ensures returned Examples is not nil.

func (*Components) HeadersEns added in v0.1.1

func (c *Components) HeadersEns() *ComponentsHeaders

HeadersEns ensures returned Headers is not nil.

func (*Components) LinksEns added in v0.1.1

func (c *Components) LinksEns() *ComponentsLinks

LinksEns ensures returned Links is not nil.

func (Components) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Components) ParametersEns added in v0.1.1

func (c *Components) ParametersEns() *ComponentsParameters

ParametersEns ensures returned Parameters is not nil.

func (*Components) RequestBodiesEns added in v0.1.1

func (c *Components) RequestBodiesEns() *ComponentsRequestBodies

RequestBodiesEns ensures returned RequestBodies is not nil.

func (*Components) ResponsesEns added in v0.1.1

func (c *Components) ResponsesEns() *ComponentsResponses

ResponsesEns ensures returned Responses is not nil.

func (*Components) SchemasEns added in v0.1.1

func (c *Components) SchemasEns() *ComponentsSchemas

SchemasEns ensures returned Schemas is not nil.

func (*Components) SecuritySchemesEns added in v0.1.1

func (c *Components) SecuritySchemesEns() *ComponentsSecuritySchemes

SecuritySchemesEns ensures returned SecuritySchemes is not nil.

func (*Components) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Components) WithCallbacks

func (c *Components) WithCallbacks(val ComponentsCallbacks) *Components

WithCallbacks sets Callbacks value.

func (*Components) WithExamples

func (c *Components) WithExamples(val ComponentsExamples) *Components

WithExamples sets Examples value.

func (*Components) WithHeaders

func (c *Components) WithHeaders(val ComponentsHeaders) *Components

WithHeaders sets Headers value.

func (c *Components) WithLinks(val ComponentsLinks) *Components

WithLinks sets Links value.

func (*Components) WithMapOfAnything

func (c *Components) WithMapOfAnything(val map[string]interface{}) *Components

WithMapOfAnything sets MapOfAnything value.

func (*Components) WithMapOfAnythingItem

func (c *Components) WithMapOfAnythingItem(key string, val interface{}) *Components

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Components) WithParameters

func (c *Components) WithParameters(val ComponentsParameters) *Components

WithParameters sets Parameters value.

func (*Components) WithRequestBodies

func (c *Components) WithRequestBodies(val ComponentsRequestBodies) *Components

WithRequestBodies sets RequestBodies value.

func (*Components) WithResponses

func (c *Components) WithResponses(val ComponentsResponses) *Components

WithResponses sets Responses value.

func (*Components) WithSchemas

func (c *Components) WithSchemas(val ComponentsSchemas) *Components

WithSchemas sets Schemas value.

func (*Components) WithSecuritySchemes

func (c *Components) WithSecuritySchemes(val ComponentsSecuritySchemes) *Components

WithSecuritySchemes sets SecuritySchemes value.

type ComponentsCallbacks

type ComponentsCallbacks struct {
	MapOfCallbackOrRefValues map[string]CallbackOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsCallbacks structure is generated from "#/definitions/Components->callbacks".

func (ComponentsCallbacks) MarshalJSON

func (c ComponentsCallbacks) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsCallbacks) UnmarshalJSON

func (c *ComponentsCallbacks) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsCallbacks) WithMapOfCallbackOrRefValues

func (c *ComponentsCallbacks) WithMapOfCallbackOrRefValues(val map[string]CallbackOrRef) *ComponentsCallbacks

WithMapOfCallbackOrRefValues sets MapOfCallbackOrRefValues value.

func (*ComponentsCallbacks) WithMapOfCallbackOrRefValuesItem

func (c *ComponentsCallbacks) WithMapOfCallbackOrRefValuesItem(key string, val CallbackOrRef) *ComponentsCallbacks

WithMapOfCallbackOrRefValuesItem sets MapOfCallbackOrRefValues item value.

type ComponentsExamples

type ComponentsExamples struct {
	MapOfExampleOrRefValues map[string]ExampleOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsExamples structure is generated from "#/definitions/Components->examples".

func (ComponentsExamples) MarshalJSON

func (c ComponentsExamples) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsExamples) UnmarshalJSON

func (c *ComponentsExamples) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsExamples) WithMapOfExampleOrRefValues

func (c *ComponentsExamples) WithMapOfExampleOrRefValues(val map[string]ExampleOrRef) *ComponentsExamples

WithMapOfExampleOrRefValues sets MapOfExampleOrRefValues value.

func (*ComponentsExamples) WithMapOfExampleOrRefValuesItem

func (c *ComponentsExamples) WithMapOfExampleOrRefValuesItem(key string, val ExampleOrRef) *ComponentsExamples

WithMapOfExampleOrRefValuesItem sets MapOfExampleOrRefValues item value.

type ComponentsHeaders

type ComponentsHeaders struct {
	MapOfHeaderOrRefValues map[string]HeaderOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsHeaders structure is generated from "#/definitions/Components->headers".

func (ComponentsHeaders) MarshalJSON

func (c ComponentsHeaders) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsHeaders) UnmarshalJSON

func (c *ComponentsHeaders) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsHeaders) WithMapOfHeaderOrRefValues

func (c *ComponentsHeaders) WithMapOfHeaderOrRefValues(val map[string]HeaderOrRef) *ComponentsHeaders

WithMapOfHeaderOrRefValues sets MapOfHeaderOrRefValues value.

func (*ComponentsHeaders) WithMapOfHeaderOrRefValuesItem

func (c *ComponentsHeaders) WithMapOfHeaderOrRefValuesItem(key string, val HeaderOrRef) *ComponentsHeaders

WithMapOfHeaderOrRefValuesItem sets MapOfHeaderOrRefValues item value.

type ComponentsLinks struct {
	MapOfLinkOrRefValues map[string]LinkOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsLinks structure is generated from "#/definitions/Components->links".

func (ComponentsLinks) MarshalJSON

func (c ComponentsLinks) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsLinks) UnmarshalJSON

func (c *ComponentsLinks) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsLinks) WithMapOfLinkOrRefValues

func (c *ComponentsLinks) WithMapOfLinkOrRefValues(val map[string]LinkOrRef) *ComponentsLinks

WithMapOfLinkOrRefValues sets MapOfLinkOrRefValues value.

func (*ComponentsLinks) WithMapOfLinkOrRefValuesItem

func (c *ComponentsLinks) WithMapOfLinkOrRefValuesItem(key string, val LinkOrRef) *ComponentsLinks

WithMapOfLinkOrRefValuesItem sets MapOfLinkOrRefValues item value.

type ComponentsParameters

type ComponentsParameters struct {
	MapOfParameterOrRefValues map[string]ParameterOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsParameters structure is generated from "#/definitions/Components->parameters".

func (ComponentsParameters) MarshalJSON

func (c ComponentsParameters) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsParameters) UnmarshalJSON

func (c *ComponentsParameters) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsParameters) WithMapOfParameterOrRefValues

func (c *ComponentsParameters) WithMapOfParameterOrRefValues(val map[string]ParameterOrRef) *ComponentsParameters

WithMapOfParameterOrRefValues sets MapOfParameterOrRefValues value.

func (*ComponentsParameters) WithMapOfParameterOrRefValuesItem

func (c *ComponentsParameters) WithMapOfParameterOrRefValuesItem(key string, val ParameterOrRef) *ComponentsParameters

WithMapOfParameterOrRefValuesItem sets MapOfParameterOrRefValues item value.

type ComponentsRequestBodies

type ComponentsRequestBodies struct {
	MapOfRequestBodyOrRefValues map[string]RequestBodyOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsRequestBodies structure is generated from "#/definitions/Components->requestBodies".

func (ComponentsRequestBodies) MarshalJSON

func (c ComponentsRequestBodies) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsRequestBodies) UnmarshalJSON

func (c *ComponentsRequestBodies) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsRequestBodies) WithMapOfRequestBodyOrRefValues

func (c *ComponentsRequestBodies) WithMapOfRequestBodyOrRefValues(val map[string]RequestBodyOrRef) *ComponentsRequestBodies

WithMapOfRequestBodyOrRefValues sets MapOfRequestBodyOrRefValues value.

func (*ComponentsRequestBodies) WithMapOfRequestBodyOrRefValuesItem

func (c *ComponentsRequestBodies) WithMapOfRequestBodyOrRefValuesItem(key string, val RequestBodyOrRef) *ComponentsRequestBodies

WithMapOfRequestBodyOrRefValuesItem sets MapOfRequestBodyOrRefValues item value.

type ComponentsResponses

type ComponentsResponses struct {
	MapOfResponseOrRefValues map[string]ResponseOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsResponses structure is generated from "#/definitions/Components->responses".

func (ComponentsResponses) MarshalJSON

func (c ComponentsResponses) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsResponses) UnmarshalJSON

func (c *ComponentsResponses) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsResponses) WithMapOfResponseOrRefValues

func (c *ComponentsResponses) WithMapOfResponseOrRefValues(val map[string]ResponseOrRef) *ComponentsResponses

WithMapOfResponseOrRefValues sets MapOfResponseOrRefValues value.

func (*ComponentsResponses) WithMapOfResponseOrRefValuesItem

func (c *ComponentsResponses) WithMapOfResponseOrRefValuesItem(key string, val ResponseOrRef) *ComponentsResponses

WithMapOfResponseOrRefValuesItem sets MapOfResponseOrRefValues item value.

type ComponentsSchemas

type ComponentsSchemas struct {
	MapOfSchemaOrRefValues map[string]SchemaOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsSchemas structure is generated from "#/definitions/Components->schemas".

func (ComponentsSchemas) MarshalJSON

func (c ComponentsSchemas) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsSchemas) UnmarshalJSON

func (c *ComponentsSchemas) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsSchemas) WithMapOfSchemaOrRefValues

func (c *ComponentsSchemas) WithMapOfSchemaOrRefValues(val map[string]SchemaOrRef) *ComponentsSchemas

WithMapOfSchemaOrRefValues sets MapOfSchemaOrRefValues value.

func (*ComponentsSchemas) WithMapOfSchemaOrRefValuesItem

func (c *ComponentsSchemas) WithMapOfSchemaOrRefValuesItem(key string, val SchemaOrRef) *ComponentsSchemas

WithMapOfSchemaOrRefValuesItem sets MapOfSchemaOrRefValues item value.

type ComponentsSecuritySchemes

type ComponentsSecuritySchemes struct {
	MapOfSecuritySchemeOrRefValues map[string]SecuritySchemeOrRef `json:"-"` // Key must match pattern: `^[a-zA-Z0-9\.\-_]+$`.
}

ComponentsSecuritySchemes structure is generated from "#/definitions/Components->securitySchemes".

func (ComponentsSecuritySchemes) MarshalJSON

func (c ComponentsSecuritySchemes) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ComponentsSecuritySchemes) UnmarshalJSON

func (c *ComponentsSecuritySchemes) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ComponentsSecuritySchemes) WithMapOfSecuritySchemeOrRefValues

func (c *ComponentsSecuritySchemes) WithMapOfSecuritySchemeOrRefValues(val map[string]SecuritySchemeOrRef) *ComponentsSecuritySchemes

WithMapOfSecuritySchemeOrRefValues sets MapOfSecuritySchemeOrRefValues value.

func (*ComponentsSecuritySchemes) WithMapOfSecuritySchemeOrRefValuesItem

func (c *ComponentsSecuritySchemes) WithMapOfSecuritySchemeOrRefValuesItem(key string, val SecuritySchemeOrRef) *ComponentsSecuritySchemes

WithMapOfSecuritySchemeOrRefValuesItem sets MapOfSecuritySchemeOrRefValues item value.

type Contact

type Contact struct {
	Name          *string                `json:"name,omitempty"`
	URL           *string                `json:"url,omitempty"`   // Format: uri-reference.
	Email         *string                `json:"email,omitempty"` // Format: email.
	MapOfAnything map[string]interface{} `json:"-"`               // Key must match pattern: `^x-`.
}

Contact structure is generated from "#/definitions/Contact".

func (Contact) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Contact) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Contact) WithEmail

func (c *Contact) WithEmail(val string) *Contact

WithEmail sets Email value.

func (*Contact) WithMapOfAnything

func (c *Contact) WithMapOfAnything(val map[string]interface{}) *Contact

WithMapOfAnything sets MapOfAnything value.

func (*Contact) WithMapOfAnythingItem

func (c *Contact) WithMapOfAnythingItem(key string, val interface{}) *Contact

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Contact) WithName

func (c *Contact) WithName(val string) *Contact

WithName sets Name value.

func (*Contact) WithURL

func (c *Contact) WithURL(val string) *Contact

WithURL sets URL value.

type CookieParameter

type CookieParameter struct {
}

CookieParameter structure is generated from "#/definitions/ParameterLocation/oneOf/3".

Cookie Parameter.

Parameter in cookie.

func (CookieParameter) MarshalJSON

func (c CookieParameter) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*CookieParameter) UnmarshalJSON

func (c *CookieParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type Discriminator

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

Discriminator structure is generated from "#/definitions/Discriminator".

func (Discriminator) MarshalJSON

func (d Discriminator) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*Discriminator) UnmarshalJSON

func (d *Discriminator) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*Discriminator) WithMapping

func (d *Discriminator) WithMapping(val map[string]string) *Discriminator

WithMapping sets Mapping value.

func (*Discriminator) WithMappingItem

func (d *Discriminator) WithMappingItem(key string, val string) *Discriminator

WithMappingItem sets Mapping item value.

func (*Discriminator) WithPropertyName

func (d *Discriminator) WithPropertyName(val string) *Discriminator

WithPropertyName sets PropertyName value.

type Encoding

type Encoding struct {
	ContentType   *string           `json:"contentType,omitempty"`
	Headers       map[string]Header `json:"headers,omitempty"`
	Style         *EncodingStyle    `json:"style,omitempty"`
	Explode       *bool             `json:"explode,omitempty"`
	AllowReserved *bool             `json:"allowReserved,omitempty"`
}

Encoding structure is generated from "#/definitions/Encoding".

func (Encoding) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Encoding) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Encoding) WithAllowReserved

func (e *Encoding) WithAllowReserved(val bool) *Encoding

WithAllowReserved sets AllowReserved value.

func (*Encoding) WithContentType

func (e *Encoding) WithContentType(val string) *Encoding

WithContentType sets ContentType value.

func (*Encoding) WithExplode

func (e *Encoding) WithExplode(val bool) *Encoding

WithExplode sets Explode value.

func (*Encoding) WithHeaders

func (e *Encoding) WithHeaders(val map[string]Header) *Encoding

WithHeaders sets Headers value.

func (*Encoding) WithHeadersItem

func (e *Encoding) WithHeadersItem(key string, val Header) *Encoding

WithHeadersItem sets Headers item value.

func (*Encoding) WithStyle

func (e *Encoding) WithStyle(val EncodingStyle) *Encoding

WithStyle sets Style value.

type EncodingStyle

type EncodingStyle string

EncodingStyle is an enum type.

func (EncodingStyle) MarshalJSON

func (i EncodingStyle) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*EncodingStyle) UnmarshalJSON

func (i *EncodingStyle) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type Example

type Example struct {
	Summary       *string                `json:"summary,omitempty"`
	Description   *string                `json:"description,omitempty"`
	Value         *interface{}           `json:"value,omitempty"`
	ExternalValue *string                `json:"externalValue,omitempty"` // Format: uri-reference.
	MapOfAnything map[string]interface{} `json:"-"`                       // Key must match pattern: `^x-`.
}

Example structure is generated from "#/definitions/Example".

func (Example) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Example) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Example) WithDescription

func (e *Example) WithDescription(val string) *Example

WithDescription sets Description value.

func (*Example) WithExternalValue

func (e *Example) WithExternalValue(val string) *Example

WithExternalValue sets ExternalValue value.

func (*Example) WithMapOfAnything

func (e *Example) WithMapOfAnything(val map[string]interface{}) *Example

WithMapOfAnything sets MapOfAnything value.

func (*Example) WithMapOfAnythingItem

func (e *Example) WithMapOfAnythingItem(key string, val interface{}) *Example

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Example) WithSummary

func (e *Example) WithSummary(val string) *Example

WithSummary sets Summary value.

func (*Example) WithValue

func (e *Example) WithValue(val interface{}) *Example

WithValue sets Value value.

type ExampleOrRef

type ExampleOrRef struct {
	ExampleReference *ExampleReference `json:"-"`
	Example          *Example          `json:"-"`
}

ExampleOrRef structure is generated from "#/definitions/ExampleOrRef".

func (*ExampleOrRef) ExampleEns added in v0.1.1

func (e *ExampleOrRef) ExampleEns() *Example

ExampleEns ensures returned Example is not nil.

func (*ExampleOrRef) ExampleReferenceEns added in v0.1.1

func (e *ExampleOrRef) ExampleReferenceEns() *ExampleReference

ExampleReferenceEns ensures returned ExampleReference is not nil.

func (ExampleOrRef) MarshalJSON

func (e ExampleOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ExampleOrRef) UnmarshalJSON

func (e *ExampleOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ExampleOrRef) WithExample

func (e *ExampleOrRef) WithExample(val Example) *ExampleOrRef

WithExample sets Example value.

func (*ExampleOrRef) WithExampleReference

func (e *ExampleOrRef) WithExampleReference(val ExampleReference) *ExampleOrRef

WithExampleReference sets ExampleReference value.

type ExampleReference

type ExampleReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

ExampleReference structure is generated from "#/definitions/ExampleReference".

func (ExampleReference) MarshalJSON

func (e ExampleReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ExampleReference) UnmarshalJSON

func (e *ExampleReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ExampleReference) WithRef

func (e *ExampleReference) WithRef(val string) *ExampleReference

WithRef sets Ref value.

type ExternalDocumentation

type ExternalDocumentation struct {
	Description *string `json:"description,omitempty"`
	// Format: uri-reference.
	// Required.
	URL           string                 `json:"url"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

ExternalDocumentation structure is generated from "#/definitions/ExternalDocumentation".

func (ExternalDocumentation) MarshalJSON

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

MarshalJSON encodes JSON.

func (*ExternalDocumentation) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*ExternalDocumentation) WithDescription

func (e *ExternalDocumentation) WithDescription(val string) *ExternalDocumentation

WithDescription sets Description value.

func (*ExternalDocumentation) WithMapOfAnything

func (e *ExternalDocumentation) WithMapOfAnything(val map[string]interface{}) *ExternalDocumentation

WithMapOfAnything sets MapOfAnything value.

func (*ExternalDocumentation) WithMapOfAnythingItem

func (e *ExternalDocumentation) WithMapOfAnythingItem(key string, val interface{}) *ExternalDocumentation

WithMapOfAnythingItem sets MapOfAnything item value.

func (*ExternalDocumentation) WithURL

WithURL sets URL value.

type HTTPSecurityScheme

type HTTPSecurityScheme struct {
	Scheme        string                 `json:"scheme"` // Required.
	BearerFormat  *string                `json:"bearerFormat,omitempty"`
	Description   *string                `json:"description,omitempty"`
	Bearer        *Bearer                `json:"-"`
	NonBearer     *NonBearer             `json:"-"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

HTTPSecurityScheme structure is generated from "#/definitions/HTTPSecurityScheme".

func (*HTTPSecurityScheme) BearerEns added in v0.1.1

func (h *HTTPSecurityScheme) BearerEns() *Bearer

BearerEns ensures returned Bearer is not nil.

func (HTTPSecurityScheme) MarshalJSON

func (h HTTPSecurityScheme) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*HTTPSecurityScheme) NonBearerEns added in v0.1.1

func (h *HTTPSecurityScheme) NonBearerEns() *NonBearer

NonBearerEns ensures returned NonBearer is not nil.

func (*HTTPSecurityScheme) UnmarshalJSON

func (h *HTTPSecurityScheme) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*HTTPSecurityScheme) WithBearer

func (h *HTTPSecurityScheme) WithBearer(val Bearer) *HTTPSecurityScheme

WithBearer sets Bearer value.

func (*HTTPSecurityScheme) WithBearerFormat

func (h *HTTPSecurityScheme) WithBearerFormat(val string) *HTTPSecurityScheme

WithBearerFormat sets BearerFormat value.

func (*HTTPSecurityScheme) WithDescription

func (h *HTTPSecurityScheme) WithDescription(val string) *HTTPSecurityScheme

WithDescription sets Description value.

func (*HTTPSecurityScheme) WithMapOfAnything

func (h *HTTPSecurityScheme) WithMapOfAnything(val map[string]interface{}) *HTTPSecurityScheme

WithMapOfAnything sets MapOfAnything value.

func (*HTTPSecurityScheme) WithMapOfAnythingItem

func (h *HTTPSecurityScheme) WithMapOfAnythingItem(key string, val interface{}) *HTTPSecurityScheme

WithMapOfAnythingItem sets MapOfAnything item value.

func (*HTTPSecurityScheme) WithNonBearer

func (h *HTTPSecurityScheme) WithNonBearer(val NonBearer) *HTTPSecurityScheme

WithNonBearer sets NonBearer value.

func (*HTTPSecurityScheme) WithScheme

func (h *HTTPSecurityScheme) WithScheme(val string) *HTTPSecurityScheme

WithScheme sets Scheme value.

type HasContent

type HasContent struct {
}

HasContent structure is generated from "#/definitions/SchemaXORContent/oneOf/1".

Has Content.

Some properties are not allowed if content is present.

func (HasContent) MarshalJSON

func (h HasContent) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*HasContent) UnmarshalJSON

func (h *HasContent) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type Header struct {
	Description     *string                 `json:"description,omitempty"`
	Required        *bool                   `json:"required,omitempty"`
	Deprecated      *bool                   `json:"deprecated,omitempty"`
	AllowEmptyValue *bool                   `json:"allowEmptyValue,omitempty"`
	Explode         *bool                   `json:"explode,omitempty"`
	AllowReserved   *bool                   `json:"allowReserved,omitempty"`
	Schema          *SchemaOrRef            `json:"schema,omitempty"`
	Content         map[string]MediaType    `json:"content,omitempty"`
	Example         *interface{}            `json:"example,omitempty"`
	Examples        map[string]ExampleOrRef `json:"examples,omitempty"`
	MapOfAnything   map[string]interface{}  `json:"-"` // Key must match pattern: `^x-`.
}

Header structure is generated from "#/definitions/Header".

func (Header) MarshalJSON

func (h Header) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*Header) SchemaEns added in v0.1.1

func (h *Header) SchemaEns() *SchemaOrRef

SchemaEns ensures returned Schema is not nil.

func (*Header) UnmarshalJSON

func (h *Header) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*Header) WithAllowEmptyValue

func (h *Header) WithAllowEmptyValue(val bool) *Header

WithAllowEmptyValue sets AllowEmptyValue value.

func (*Header) WithAllowReserved

func (h *Header) WithAllowReserved(val bool) *Header

WithAllowReserved sets AllowReserved value.

func (*Header) WithContent

func (h *Header) WithContent(val map[string]MediaType) *Header

WithContent sets Content value.

func (*Header) WithContentItem

func (h *Header) WithContentItem(key string, val MediaType) *Header

WithContentItem sets Content item value.

func (*Header) WithDeprecated

func (h *Header) WithDeprecated(val bool) *Header

WithDeprecated sets Deprecated value.

func (*Header) WithDescription

func (h *Header) WithDescription(val string) *Header

WithDescription sets Description value.

func (*Header) WithExample

func (h *Header) WithExample(val interface{}) *Header

WithExample sets Example value.

func (*Header) WithExamples

func (h *Header) WithExamples(val map[string]ExampleOrRef) *Header

WithExamples sets Examples value.

func (*Header) WithExamplesItem

func (h *Header) WithExamplesItem(key string, val ExampleOrRef) *Header

WithExamplesItem sets Examples item value.

func (*Header) WithExplode

func (h *Header) WithExplode(val bool) *Header

WithExplode sets Explode value.

func (*Header) WithMapOfAnything

func (h *Header) WithMapOfAnything(val map[string]interface{}) *Header

WithMapOfAnything sets MapOfAnything value.

func (*Header) WithMapOfAnythingItem

func (h *Header) WithMapOfAnythingItem(key string, val interface{}) *Header

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Header) WithRequired

func (h *Header) WithRequired(val bool) *Header

WithRequired sets Required value.

func (*Header) WithSchema

func (h *Header) WithSchema(val SchemaOrRef) *Header

WithSchema sets Schema value.

type HeaderOrRef

type HeaderOrRef struct {
	HeaderReference *HeaderReference `json:"-"`
	Header          *Header          `json:"-"`
}

HeaderOrRef structure is generated from "#/definitions/HeaderOrRef".

func (*HeaderOrRef) HeaderEns added in v0.1.1

func (h *HeaderOrRef) HeaderEns() *Header

HeaderEns ensures returned Header is not nil.

func (*HeaderOrRef) HeaderReferenceEns added in v0.1.1

func (h *HeaderOrRef) HeaderReferenceEns() *HeaderReference

HeaderReferenceEns ensures returned HeaderReference is not nil.

func (HeaderOrRef) MarshalJSON

func (h HeaderOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*HeaderOrRef) UnmarshalJSON

func (h *HeaderOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*HeaderOrRef) WithHeader

func (h *HeaderOrRef) WithHeader(val Header) *HeaderOrRef

WithHeader sets Header value.

func (*HeaderOrRef) WithHeaderReference

func (h *HeaderOrRef) WithHeaderReference(val HeaderReference) *HeaderOrRef

WithHeaderReference sets HeaderReference value.

type HeaderParameter

type HeaderParameter struct {
}

HeaderParameter structure is generated from "#/definitions/ParameterLocation/oneOf/2".

Header Parameter.

Parameter in header.

func (HeaderParameter) MarshalJSON

func (h HeaderParameter) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*HeaderParameter) UnmarshalJSON

func (h *HeaderParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type HeaderReference

type HeaderReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

HeaderReference structure is generated from "#/definitions/HeaderReference".

func (HeaderReference) MarshalJSON

func (h HeaderReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*HeaderReference) UnmarshalJSON

func (h *HeaderReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*HeaderReference) WithRef

func (h *HeaderReference) WithRef(val string) *HeaderReference

WithRef sets Ref value.

type ImplicitOAuthFlow

type ImplicitOAuthFlow struct {
	// Format: uri-reference.
	// Required.
	AuthorizationURL string                 `json:"authorizationUrl"`
	RefreshURL       *string                `json:"refreshUrl,omitempty"` // Format: uri-reference.
	Scopes           map[string]string      `json:"scopes"`               // Required.
	MapOfAnything    map[string]interface{} `json:"-"`                    // Key must match pattern: `^x-`.
}

ImplicitOAuthFlow structure is generated from "#/definitions/ImplicitOAuthFlow".

func (ImplicitOAuthFlow) MarshalJSON

func (i ImplicitOAuthFlow) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ImplicitOAuthFlow) UnmarshalJSON

func (i *ImplicitOAuthFlow) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ImplicitOAuthFlow) WithAuthorizationURL

func (i *ImplicitOAuthFlow) WithAuthorizationURL(val string) *ImplicitOAuthFlow

WithAuthorizationURL sets AuthorizationURL value.

func (*ImplicitOAuthFlow) WithMapOfAnything

func (i *ImplicitOAuthFlow) WithMapOfAnything(val map[string]interface{}) *ImplicitOAuthFlow

WithMapOfAnything sets MapOfAnything value.

func (*ImplicitOAuthFlow) WithMapOfAnythingItem

func (i *ImplicitOAuthFlow) WithMapOfAnythingItem(key string, val interface{}) *ImplicitOAuthFlow

WithMapOfAnythingItem sets MapOfAnything item value.

func (*ImplicitOAuthFlow) WithRefreshURL

func (i *ImplicitOAuthFlow) WithRefreshURL(val string) *ImplicitOAuthFlow

WithRefreshURL sets RefreshURL value.

func (*ImplicitOAuthFlow) WithScopes

func (i *ImplicitOAuthFlow) WithScopes(val map[string]string) *ImplicitOAuthFlow

WithScopes sets Scopes value.

func (*ImplicitOAuthFlow) WithScopesItem

func (i *ImplicitOAuthFlow) WithScopesItem(key string, val string) *ImplicitOAuthFlow

WithScopesItem sets Scopes item value.

type Info

type Info struct {
	Title          string                 `json:"title"` // Required.
	Description    *string                `json:"description,omitempty"`
	TermsOfService *string                `json:"termsOfService,omitempty"` // Format: uri-reference.
	Contact        *Contact               `json:"contact,omitempty"`
	License        *License               `json:"license,omitempty"`
	Version        string                 `json:"version"` // Required.
	MapOfAnything  map[string]interface{} `json:"-"`       // Key must match pattern: `^x-`.
}

Info structure is generated from "#/definitions/Info".

func (*Info) ContactEns added in v0.1.1

func (i *Info) ContactEns() *Contact

ContactEns ensures returned Contact is not nil.

func (*Info) LicenseEns added in v0.1.1

func (i *Info) LicenseEns() *License

LicenseEns ensures returned License is not nil.

func (Info) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Info) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Info) WithContact

func (i *Info) WithContact(val Contact) *Info

WithContact sets Contact value.

func (*Info) WithDescription

func (i *Info) WithDescription(val string) *Info

WithDescription sets Description value.

func (*Info) WithLicense

func (i *Info) WithLicense(val License) *Info

WithLicense sets License value.

func (*Info) WithMapOfAnything

func (i *Info) WithMapOfAnything(val map[string]interface{}) *Info

WithMapOfAnything sets MapOfAnything value.

func (*Info) WithMapOfAnythingItem

func (i *Info) WithMapOfAnythingItem(key string, val interface{}) *Info

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Info) WithTermsOfService

func (i *Info) WithTermsOfService(val string) *Info

WithTermsOfService sets TermsOfService value.

func (*Info) WithTitle

func (i *Info) WithTitle(val string) *Info

WithTitle sets Title value.

func (*Info) WithVersion

func (i *Info) WithVersion(val string) *Info

WithVersion sets Version value.

type License

type License struct {
	Name          string                 `json:"name"`          // Required.
	URL           *string                `json:"url,omitempty"` // Format: uri-reference.
	MapOfAnything map[string]interface{} `json:"-"`             // Key must match pattern: `^x-`.
}

License structure is generated from "#/definitions/License".

func (License) MarshalJSON

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

MarshalJSON encodes JSON.

func (*License) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*License) WithMapOfAnything

func (l *License) WithMapOfAnything(val map[string]interface{}) *License

WithMapOfAnything sets MapOfAnything value.

func (*License) WithMapOfAnythingItem

func (l *License) WithMapOfAnythingItem(key string, val interface{}) *License

WithMapOfAnythingItem sets MapOfAnything item value.

func (*License) WithName

func (l *License) WithName(val string) *License

WithName sets Name value.

func (*License) WithURL

func (l *License) WithURL(val string) *License

WithURL sets URL value.

type Link struct {
	OperationID   *string                `json:"operationId,omitempty"`
	OperationRef  *string                `json:"operationRef,omitempty"` // Format: uri-reference.
	Parameters    map[string]interface{} `json:"parameters,omitempty"`
	RequestBody   *interface{}           `json:"requestBody,omitempty"`
	Description   *string                `json:"description,omitempty"`
	Server        *Server                `json:"server,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

Link structure is generated from "#/definitions/Link".

func (Link) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Link) ServerEns added in v0.1.1

func (l *Link) ServerEns() *Server

ServerEns ensures returned Server is not nil.

func (*Link) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Link) WithDescription

func (l *Link) WithDescription(val string) *Link

WithDescription sets Description value.

func (*Link) WithMapOfAnything

func (l *Link) WithMapOfAnything(val map[string]interface{}) *Link

WithMapOfAnything sets MapOfAnything value.

func (*Link) WithMapOfAnythingItem

func (l *Link) WithMapOfAnythingItem(key string, val interface{}) *Link

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Link) WithOperationID

func (l *Link) WithOperationID(val string) *Link

WithOperationID sets OperationID value.

func (*Link) WithOperationRef

func (l *Link) WithOperationRef(val string) *Link

WithOperationRef sets OperationRef value.

func (*Link) WithParameters

func (l *Link) WithParameters(val map[string]interface{}) *Link

WithParameters sets Parameters value.

func (*Link) WithParametersItem

func (l *Link) WithParametersItem(key string, val interface{}) *Link

WithParametersItem sets Parameters item value.

func (*Link) WithRequestBody

func (l *Link) WithRequestBody(val interface{}) *Link

WithRequestBody sets RequestBody value.

func (*Link) WithServer

func (l *Link) WithServer(val Server) *Link

WithServer sets Server value.

type LinkOrRef

type LinkOrRef struct {
	LinkReference *LinkReference `json:"-"`
	Link          *Link          `json:"-"`
}

LinkOrRef structure is generated from "#/definitions/LinkOrRef".

func (*LinkOrRef) LinkEns added in v0.1.1

func (l *LinkOrRef) LinkEns() *Link

LinkEns ensures returned Link is not nil.

func (*LinkOrRef) LinkReferenceEns added in v0.1.1

func (l *LinkOrRef) LinkReferenceEns() *LinkReference

LinkReferenceEns ensures returned LinkReference is not nil.

func (LinkOrRef) MarshalJSON

func (l LinkOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*LinkOrRef) UnmarshalJSON

func (l *LinkOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (l *LinkOrRef) WithLink(val Link) *LinkOrRef

WithLink sets Link value.

func (*LinkOrRef) WithLinkReference

func (l *LinkOrRef) WithLinkReference(val LinkReference) *LinkOrRef

WithLinkReference sets LinkReference value.

type LinkReference

type LinkReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

LinkReference structure is generated from "#/definitions/LinkReference".

func (LinkReference) MarshalJSON

func (l LinkReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*LinkReference) UnmarshalJSON

func (l *LinkReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*LinkReference) WithRef

func (l *LinkReference) WithRef(val string) *LinkReference

WithRef sets Ref value.

type MediaType

type MediaType struct {
	Schema        *SchemaOrRef            `json:"schema,omitempty"`
	Example       *interface{}            `json:"example,omitempty"`
	Examples      map[string]ExampleOrRef `json:"examples,omitempty"`
	Encoding      map[string]Encoding     `json:"encoding,omitempty"`
	MapOfAnything map[string]interface{}  `json:"-"` // Key must match pattern: `^x-`.
}

MediaType structure is generated from "#/definitions/MediaType".

func (MediaType) MarshalJSON

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

MarshalJSON encodes JSON.

func (*MediaType) SchemaEns added in v0.1.1

func (m *MediaType) SchemaEns() *SchemaOrRef

SchemaEns ensures returned Schema is not nil.

func (*MediaType) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*MediaType) WithEncoding

func (m *MediaType) WithEncoding(val map[string]Encoding) *MediaType

WithEncoding sets Encoding value.

func (*MediaType) WithEncodingItem

func (m *MediaType) WithEncodingItem(key string, val Encoding) *MediaType

WithEncodingItem sets Encoding item value.

func (*MediaType) WithExample

func (m *MediaType) WithExample(val interface{}) *MediaType

WithExample sets Example value.

func (*MediaType) WithExamples

func (m *MediaType) WithExamples(val map[string]ExampleOrRef) *MediaType

WithExamples sets Examples value.

func (*MediaType) WithExamplesItem

func (m *MediaType) WithExamplesItem(key string, val ExampleOrRef) *MediaType

WithExamplesItem sets Examples item value.

func (*MediaType) WithMapOfAnything

func (m *MediaType) WithMapOfAnything(val map[string]interface{}) *MediaType

WithMapOfAnything sets MapOfAnything value.

func (*MediaType) WithMapOfAnythingItem

func (m *MediaType) WithMapOfAnythingItem(key string, val interface{}) *MediaType

WithMapOfAnythingItem sets MapOfAnything item value.

func (*MediaType) WithSchema

func (m *MediaType) WithSchema(val SchemaOrRef) *MediaType

WithSchema sets Schema value.

type NonBearer

type NonBearer struct {
	Scheme *interface{} `json:"scheme,omitempty"`
}

NonBearer structure is generated from "#/definitions/HTTPSecurityScheme/oneOf/1".

Non Bearer.

Non Bearer.

func (*NonBearer) WithScheme

func (n *NonBearer) WithScheme(val interface{}) *NonBearer

WithScheme sets Scheme value.

type OAuth2SecurityScheme

type OAuth2SecurityScheme struct {
	Flows         OAuthFlows             `json:"flows"` // Required.
	Description   *string                `json:"description,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

OAuth2SecurityScheme structure is generated from "#/definitions/OAuth2SecurityScheme".

func (OAuth2SecurityScheme) MarshalJSON

func (o OAuth2SecurityScheme) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*OAuth2SecurityScheme) UnmarshalJSON

func (o *OAuth2SecurityScheme) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*OAuth2SecurityScheme) WithDescription

func (o *OAuth2SecurityScheme) WithDescription(val string) *OAuth2SecurityScheme

WithDescription sets Description value.

func (*OAuth2SecurityScheme) WithFlows

WithFlows sets Flows value.

func (*OAuth2SecurityScheme) WithMapOfAnything

func (o *OAuth2SecurityScheme) WithMapOfAnything(val map[string]interface{}) *OAuth2SecurityScheme

WithMapOfAnything sets MapOfAnything value.

func (*OAuth2SecurityScheme) WithMapOfAnythingItem

func (o *OAuth2SecurityScheme) WithMapOfAnythingItem(key string, val interface{}) *OAuth2SecurityScheme

WithMapOfAnythingItem sets MapOfAnything item value.

type OAuthFlows

type OAuthFlows struct {
	Implicit          *ImplicitOAuthFlow          `json:"implicit,omitempty"`
	Password          *PasswordOAuthFlow          `json:"password,omitempty"`
	ClientCredentials *ClientCredentialsFlow      `json:"clientCredentials,omitempty"`
	AuthorizationCode *AuthorizationCodeOAuthFlow `json:"authorizationCode,omitempty"`
	MapOfAnything     map[string]interface{}      `json:"-"` // Key must match pattern: `^x-`.
}

OAuthFlows structure is generated from "#/definitions/OAuthFlows".

func (*OAuthFlows) AuthorizationCodeEns added in v0.1.1

func (o *OAuthFlows) AuthorizationCodeEns() *AuthorizationCodeOAuthFlow

AuthorizationCodeEns ensures returned AuthorizationCode is not nil.

func (*OAuthFlows) ClientCredentialsEns added in v0.1.1

func (o *OAuthFlows) ClientCredentialsEns() *ClientCredentialsFlow

ClientCredentialsEns ensures returned ClientCredentials is not nil.

func (*OAuthFlows) ImplicitEns added in v0.1.1

func (o *OAuthFlows) ImplicitEns() *ImplicitOAuthFlow

ImplicitEns ensures returned Implicit is not nil.

func (OAuthFlows) MarshalJSON

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

MarshalJSON encodes JSON.

func (*OAuthFlows) PasswordEns added in v0.1.1

func (o *OAuthFlows) PasswordEns() *PasswordOAuthFlow

PasswordEns ensures returned Password is not nil.

func (*OAuthFlows) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*OAuthFlows) WithAuthorizationCode

func (o *OAuthFlows) WithAuthorizationCode(val AuthorizationCodeOAuthFlow) *OAuthFlows

WithAuthorizationCode sets AuthorizationCode value.

func (*OAuthFlows) WithClientCredentials

func (o *OAuthFlows) WithClientCredentials(val ClientCredentialsFlow) *OAuthFlows

WithClientCredentials sets ClientCredentials value.

func (*OAuthFlows) WithImplicit

func (o *OAuthFlows) WithImplicit(val ImplicitOAuthFlow) *OAuthFlows

WithImplicit sets Implicit value.

func (*OAuthFlows) WithMapOfAnything

func (o *OAuthFlows) WithMapOfAnything(val map[string]interface{}) *OAuthFlows

WithMapOfAnything sets MapOfAnything value.

func (*OAuthFlows) WithMapOfAnythingItem

func (o *OAuthFlows) WithMapOfAnythingItem(key string, val interface{}) *OAuthFlows

WithMapOfAnythingItem sets MapOfAnything item value.

func (*OAuthFlows) WithPassword

func (o *OAuthFlows) WithPassword(val PasswordOAuthFlow) *OAuthFlows

WithPassword sets Password value.

type OpenIDConnectSecurityScheme

type OpenIDConnectSecurityScheme struct {
	// Format: uri-reference.
	// Required.
	OpenIDConnectURL string                 `json:"openIdConnectUrl"`
	Description      *string                `json:"description,omitempty"`
	MapOfAnything    map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

OpenIDConnectSecurityScheme structure is generated from "#/definitions/OpenIdConnectSecurityScheme".

func (OpenIDConnectSecurityScheme) MarshalJSON

func (o OpenIDConnectSecurityScheme) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*OpenIDConnectSecurityScheme) UnmarshalJSON

func (o *OpenIDConnectSecurityScheme) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*OpenIDConnectSecurityScheme) WithDescription

WithDescription sets Description value.

func (*OpenIDConnectSecurityScheme) WithMapOfAnything

func (o *OpenIDConnectSecurityScheme) WithMapOfAnything(val map[string]interface{}) *OpenIDConnectSecurityScheme

WithMapOfAnything sets MapOfAnything value.

func (*OpenIDConnectSecurityScheme) WithMapOfAnythingItem

func (o *OpenIDConnectSecurityScheme) WithMapOfAnythingItem(key string, val interface{}) *OpenIDConnectSecurityScheme

WithMapOfAnythingItem sets MapOfAnything item value.

func (*OpenIDConnectSecurityScheme) WithOpenIDConnectURL

func (o *OpenIDConnectSecurityScheme) WithOpenIDConnectURL(val string) *OpenIDConnectSecurityScheme

WithOpenIDConnectURL sets OpenIDConnectURL value.

type Operation

type Operation struct {
	Tags          []string                 `json:"tags,omitempty"`
	Summary       *string                  `json:"summary,omitempty"`
	Description   *string                  `json:"description,omitempty"`
	ExternalDocs  *ExternalDocumentation   `json:"externalDocs,omitempty"`
	ID            *string                  `json:"operationId,omitempty"`
	Parameters    []ParameterOrRef         `json:"parameters,omitempty"`
	RequestBody   *RequestBodyOrRef        `json:"requestBody,omitempty"`
	Responses     Responses                `json:"responses"` // Required.
	Callbacks     map[string]CallbackOrRef `json:"callbacks,omitempty"`
	Deprecated    *bool                    `json:"deprecated,omitempty"`
	Security      []map[string][]string    `json:"security,omitempty"`
	Servers       []Server                 `json:"servers,omitempty"`
	MapOfAnything map[string]interface{}   `json:"-"` // Key must match pattern: `^x-`.
}

Operation structure is generated from "#/definitions/Operation".

func (*Operation) ExternalDocsEns added in v0.1.1

func (o *Operation) ExternalDocsEns() *ExternalDocumentation

ExternalDocsEns ensures returned ExternalDocs is not nil.

func (Operation) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Operation) RequestBodyEns added in v0.1.1

func (o *Operation) RequestBodyEns() *RequestBodyOrRef

RequestBodyEns ensures returned RequestBody is not nil.

func (*Operation) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Operation) WithCallbacks

func (o *Operation) WithCallbacks(val map[string]CallbackOrRef) *Operation

WithCallbacks sets Callbacks value.

func (*Operation) WithCallbacksItem

func (o *Operation) WithCallbacksItem(key string, val CallbackOrRef) *Operation

WithCallbacksItem sets Callbacks item value.

func (*Operation) WithDeprecated

func (o *Operation) WithDeprecated(val bool) *Operation

WithDeprecated sets Deprecated value.

func (*Operation) WithDescription

func (o *Operation) WithDescription(val string) *Operation

WithDescription sets Description value.

func (*Operation) WithExternalDocs

func (o *Operation) WithExternalDocs(val ExternalDocumentation) *Operation

WithExternalDocs sets ExternalDocs value.

func (*Operation) WithID

func (o *Operation) WithID(val string) *Operation

WithID sets ID value.

func (*Operation) WithMapOfAnything

func (o *Operation) WithMapOfAnything(val map[string]interface{}) *Operation

WithMapOfAnything sets MapOfAnything value.

func (*Operation) WithMapOfAnythingItem

func (o *Operation) WithMapOfAnythingItem(key string, val interface{}) *Operation

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Operation) WithParameters

func (o *Operation) WithParameters(val ...ParameterOrRef) *Operation

WithParameters sets Parameters value.

func (*Operation) WithRequestBody

func (o *Operation) WithRequestBody(val RequestBodyOrRef) *Operation

WithRequestBody sets RequestBody value.

func (*Operation) WithResponses

func (o *Operation) WithResponses(val Responses) *Operation

WithResponses sets Responses value.

func (*Operation) WithSecurity

func (o *Operation) WithSecurity(val ...map[string][]string) *Operation

WithSecurity sets Security value.

func (*Operation) WithServers

func (o *Operation) WithServers(val ...Server) *Operation

WithServers sets Servers value.

func (*Operation) WithSummary

func (o *Operation) WithSummary(val string) *Operation

WithSummary sets Summary value.

func (*Operation) WithTags

func (o *Operation) WithTags(val ...string) *Operation

WithTags sets Tags value.

type Parameter

type Parameter struct {
	Name             string                  `json:"name"` // Required.
	In               ParameterIn             `json:"in"`   // Required.
	Description      *string                 `json:"description,omitempty"`
	Required         *bool                   `json:"required,omitempty"`
	Deprecated       *bool                   `json:"deprecated,omitempty"`
	AllowEmptyValue  *bool                   `json:"allowEmptyValue,omitempty"`
	Style            *string                 `json:"style,omitempty"`
	Explode          *bool                   `json:"explode,omitempty"`
	AllowReserved    *bool                   `json:"allowReserved,omitempty"`
	Schema           *SchemaOrRef            `json:"schema,omitempty"`
	Content          map[string]MediaType    `json:"content,omitempty"`
	Example          *interface{}            `json:"example,omitempty"`
	Examples         map[string]ExampleOrRef `json:"examples,omitempty"`
	SchemaXORContent *HasContent             `json:"-"`
	Location         *ParameterLocation      `json:"-"`
	MapOfAnything    map[string]interface{}  `json:"-"` // Key must match pattern: `^x-`.
}

Parameter structure is generated from "#/definitions/Parameter".

func (*Parameter) LocationEns added in v0.1.1

func (p *Parameter) LocationEns() *ParameterLocation

LocationEns ensures returned Location is not nil.

func (Parameter) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Parameter) SchemaEns added in v0.1.1

func (p *Parameter) SchemaEns() *SchemaOrRef

SchemaEns ensures returned Schema is not nil.

func (*Parameter) SchemaXORContentEns added in v0.1.1

func (p *Parameter) SchemaXORContentEns() *HasContent

SchemaXORContentEns ensures returned SchemaXORContent is not nil.

func (*Parameter) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Parameter) WithAllowEmptyValue

func (p *Parameter) WithAllowEmptyValue(val bool) *Parameter

WithAllowEmptyValue sets AllowEmptyValue value.

func (*Parameter) WithAllowReserved

func (p *Parameter) WithAllowReserved(val bool) *Parameter

WithAllowReserved sets AllowReserved value.

func (*Parameter) WithContent

func (p *Parameter) WithContent(val map[string]MediaType) *Parameter

WithContent sets Content value.

func (*Parameter) WithContentItem

func (p *Parameter) WithContentItem(key string, val MediaType) *Parameter

WithContentItem sets Content item value.

func (*Parameter) WithDeprecated

func (p *Parameter) WithDeprecated(val bool) *Parameter

WithDeprecated sets Deprecated value.

func (*Parameter) WithDescription

func (p *Parameter) WithDescription(val string) *Parameter

WithDescription sets Description value.

func (*Parameter) WithExample

func (p *Parameter) WithExample(val interface{}) *Parameter

WithExample sets Example value.

func (*Parameter) WithExamples

func (p *Parameter) WithExamples(val map[string]ExampleOrRef) *Parameter

WithExamples sets Examples value.

func (*Parameter) WithExamplesItem

func (p *Parameter) WithExamplesItem(key string, val ExampleOrRef) *Parameter

WithExamplesItem sets Examples item value.

func (*Parameter) WithExplode

func (p *Parameter) WithExplode(val bool) *Parameter

WithExplode sets Explode value.

func (*Parameter) WithIn

func (p *Parameter) WithIn(val ParameterIn) *Parameter

WithIn sets In value.

func (*Parameter) WithLocation

func (p *Parameter) WithLocation(val ParameterLocation) *Parameter

WithLocation sets Location value.

func (*Parameter) WithMapOfAnything

func (p *Parameter) WithMapOfAnything(val map[string]interface{}) *Parameter

WithMapOfAnything sets MapOfAnything value.

func (*Parameter) WithMapOfAnythingItem

func (p *Parameter) WithMapOfAnythingItem(key string, val interface{}) *Parameter

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Parameter) WithName

func (p *Parameter) WithName(val string) *Parameter

WithName sets Name value.

func (*Parameter) WithRequired

func (p *Parameter) WithRequired(val bool) *Parameter

WithRequired sets Required value.

func (*Parameter) WithSchema

func (p *Parameter) WithSchema(val SchemaOrRef) *Parameter

WithSchema sets Schema value.

func (*Parameter) WithSchemaXORContent

func (p *Parameter) WithSchemaXORContent(val HasContent) *Parameter

WithSchemaXORContent sets SchemaXORContent value.

func (*Parameter) WithStyle

func (p *Parameter) WithStyle(val string) *Parameter

WithStyle sets Style value.

type ParameterIn

type ParameterIn string

ParameterIn is an enum type.

func (ParameterIn) MarshalJSON

func (i ParameterIn) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ParameterIn) UnmarshalJSON

func (i *ParameterIn) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type ParameterLocation

type ParameterLocation struct {
	PathParameter   *PathParameter   `json:"-"`
	QueryParameter  *QueryParameter  `json:"-"`
	HeaderParameter *HeaderParameter `json:"-"`
	CookieParameter *CookieParameter `json:"-"`
}

ParameterLocation structure is generated from "#/definitions/ParameterLocation".

Parameter location.

func (*ParameterLocation) CookieParameterEns added in v0.1.1

func (p *ParameterLocation) CookieParameterEns() *CookieParameter

CookieParameterEns ensures returned CookieParameter is not nil.

func (*ParameterLocation) HeaderParameterEns added in v0.1.1

func (p *ParameterLocation) HeaderParameterEns() *HeaderParameter

HeaderParameterEns ensures returned HeaderParameter is not nil.

func (ParameterLocation) MarshalJSON

func (p ParameterLocation) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ParameterLocation) PathParameterEns added in v0.1.1

func (p *ParameterLocation) PathParameterEns() *PathParameter

PathParameterEns ensures returned PathParameter is not nil.

func (*ParameterLocation) QueryParameterEns added in v0.1.1

func (p *ParameterLocation) QueryParameterEns() *QueryParameter

QueryParameterEns ensures returned QueryParameter is not nil.

func (*ParameterLocation) UnmarshalJSON

func (p *ParameterLocation) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ParameterLocation) WithCookieParameter

func (p *ParameterLocation) WithCookieParameter(val CookieParameter) *ParameterLocation

WithCookieParameter sets CookieParameter value.

func (*ParameterLocation) WithHeaderParameter

func (p *ParameterLocation) WithHeaderParameter(val HeaderParameter) *ParameterLocation

WithHeaderParameter sets HeaderParameter value.

func (*ParameterLocation) WithPathParameter

func (p *ParameterLocation) WithPathParameter(val PathParameter) *ParameterLocation

WithPathParameter sets PathParameter value.

func (*ParameterLocation) WithQueryParameter

func (p *ParameterLocation) WithQueryParameter(val QueryParameter) *ParameterLocation

WithQueryParameter sets QueryParameter value.

type ParameterOrRef

type ParameterOrRef struct {
	ParameterReference *ParameterReference `json:"-"`
	Parameter          *Parameter          `json:"-"`
}

ParameterOrRef structure is generated from "#/definitions/ParameterOrRef".

func (ParameterOrRef) MarshalJSON

func (p ParameterOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ParameterOrRef) ParameterEns added in v0.1.1

func (p *ParameterOrRef) ParameterEns() *Parameter

ParameterEns ensures returned Parameter is not nil.

func (*ParameterOrRef) ParameterReferenceEns added in v0.1.1

func (p *ParameterOrRef) ParameterReferenceEns() *ParameterReference

ParameterReferenceEns ensures returned ParameterReference is not nil.

func (*ParameterOrRef) UnmarshalJSON

func (p *ParameterOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ParameterOrRef) WithParameter

func (p *ParameterOrRef) WithParameter(val Parameter) *ParameterOrRef

WithParameter sets Parameter value.

func (*ParameterOrRef) WithParameterReference

func (p *ParameterOrRef) WithParameterReference(val ParameterReference) *ParameterOrRef

WithParameterReference sets ParameterReference value.

type ParameterReference

type ParameterReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

ParameterReference structure is generated from "#/definitions/ParameterReference".

func (ParameterReference) MarshalJSON

func (p ParameterReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ParameterReference) UnmarshalJSON

func (p *ParameterReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ParameterReference) WithRef

func (p *ParameterReference) WithRef(val string) *ParameterReference

WithRef sets Ref value.

type PasswordOAuthFlow

type PasswordOAuthFlow struct {
	// Format: uri-reference.
	// Required.
	TokenURL      string                 `json:"tokenUrl"`
	RefreshURL    *string                `json:"refreshUrl,omitempty"` // Format: uri-reference.
	Scopes        map[string]string      `json:"scopes,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

PasswordOAuthFlow structure is generated from "#/definitions/PasswordOAuthFlow".

func (PasswordOAuthFlow) MarshalJSON

func (p PasswordOAuthFlow) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*PasswordOAuthFlow) UnmarshalJSON

func (p *PasswordOAuthFlow) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*PasswordOAuthFlow) WithMapOfAnything

func (p *PasswordOAuthFlow) WithMapOfAnything(val map[string]interface{}) *PasswordOAuthFlow

WithMapOfAnything sets MapOfAnything value.

func (*PasswordOAuthFlow) WithMapOfAnythingItem

func (p *PasswordOAuthFlow) WithMapOfAnythingItem(key string, val interface{}) *PasswordOAuthFlow

WithMapOfAnythingItem sets MapOfAnything item value.

func (*PasswordOAuthFlow) WithRefreshURL

func (p *PasswordOAuthFlow) WithRefreshURL(val string) *PasswordOAuthFlow

WithRefreshURL sets RefreshURL value.

func (*PasswordOAuthFlow) WithScopes

func (p *PasswordOAuthFlow) WithScopes(val map[string]string) *PasswordOAuthFlow

WithScopes sets Scopes value.

func (*PasswordOAuthFlow) WithScopesItem

func (p *PasswordOAuthFlow) WithScopesItem(key string, val string) *PasswordOAuthFlow

WithScopesItem sets Scopes item value.

func (*PasswordOAuthFlow) WithTokenURL

func (p *PasswordOAuthFlow) WithTokenURL(val string) *PasswordOAuthFlow

WithTokenURL sets TokenURL value.

type PathItem

type PathItem struct {
	Ref                  *string                `json:"$ref,omitempty"`
	Summary              *string                `json:"summary,omitempty"`
	Description          *string                `json:"description,omitempty"`
	Servers              []Server               `json:"servers,omitempty"`
	Parameters           []ParameterOrRef       `json:"parameters,omitempty"`
	MapOfOperationValues map[string]Operation   `json:"-"` // Key must match pattern: `^(get|put|post|delete|options|head|patch|trace)$`.
	MapOfAnything        map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

PathItem structure is generated from "#/definitions/PathItem".

func (PathItem) MarshalJSON

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

MarshalJSON encodes JSON.

func (*PathItem) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*PathItem) WithDescription

func (p *PathItem) WithDescription(val string) *PathItem

WithDescription sets Description value.

func (*PathItem) WithMapOfAnything

func (p *PathItem) WithMapOfAnything(val map[string]interface{}) *PathItem

WithMapOfAnything sets MapOfAnything value.

func (*PathItem) WithMapOfAnythingItem

func (p *PathItem) WithMapOfAnythingItem(key string, val interface{}) *PathItem

WithMapOfAnythingItem sets MapOfAnything item value.

func (*PathItem) WithMapOfOperationValues

func (p *PathItem) WithMapOfOperationValues(val map[string]Operation) *PathItem

WithMapOfOperationValues sets MapOfOperationValues value.

func (*PathItem) WithMapOfOperationValuesItem

func (p *PathItem) WithMapOfOperationValuesItem(key string, val Operation) *PathItem

WithMapOfOperationValuesItem sets MapOfOperationValues item value.

func (*PathItem) WithOperation

func (p *PathItem) WithOperation(method string, operation Operation) *PathItem

func (*PathItem) WithParameters

func (p *PathItem) WithParameters(val ...ParameterOrRef) *PathItem

WithParameters sets Parameters value.

func (*PathItem) WithRef

func (p *PathItem) WithRef(val string) *PathItem

WithRef sets Ref value.

func (*PathItem) WithServers

func (p *PathItem) WithServers(val ...Server) *PathItem

WithServers sets Servers value.

func (*PathItem) WithSummary

func (p *PathItem) WithSummary(val string) *PathItem

WithSummary sets Summary value.

type PathParameter

type PathParameter struct {
	Style *PathParameterStyle `json:"style,omitempty"`
}

PathParameter structure is generated from "#/definitions/ParameterLocation/oneOf/0".

Path Parameter.

Parameter in path.

func (PathParameter) MarshalJSON

func (p PathParameter) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*PathParameter) UnmarshalJSON

func (p *PathParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*PathParameter) WithStyle

func (p *PathParameter) WithStyle(val PathParameterStyle) *PathParameter

WithStyle sets Style value.

type PathParameterStyle

type PathParameterStyle string

PathParameterStyle is an enum type.

func (PathParameterStyle) MarshalJSON

func (i PathParameterStyle) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*PathParameterStyle) UnmarshalJSON

func (i *PathParameterStyle) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type Paths

type Paths struct {
	MapOfPathItemValues map[string]PathItem    `json:"-"` // Key must match pattern: `^\/`.
	MapOfAnything       map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

Paths structure is generated from "#/definitions/Paths".

func (Paths) MarshalJSON

func (p Paths) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*Paths) UnmarshalJSON

func (p *Paths) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*Paths) WithMapOfAnything

func (p *Paths) WithMapOfAnything(val map[string]interface{}) *Paths

WithMapOfAnything sets MapOfAnything value.

func (*Paths) WithMapOfAnythingItem

func (p *Paths) WithMapOfAnythingItem(key string, val interface{}) *Paths

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Paths) WithMapOfPathItemValues

func (p *Paths) WithMapOfPathItemValues(val map[string]PathItem) *Paths

WithMapOfPathItemValues sets MapOfPathItemValues value.

func (*Paths) WithMapOfPathItemValuesItem

func (p *Paths) WithMapOfPathItemValuesItem(key string, val PathItem) *Paths

WithMapOfPathItemValuesItem sets MapOfPathItemValues item value.

type QueryParameter

type QueryParameter struct {
	Style *QueryParameterStyle `json:"style,omitempty"`
}

QueryParameter structure is generated from "#/definitions/ParameterLocation/oneOf/1".

Query Parameter.

Parameter in query.

func (QueryParameter) MarshalJSON

func (q QueryParameter) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*QueryParameter) UnmarshalJSON

func (q *QueryParameter) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*QueryParameter) WithStyle

WithStyle sets Style value.

type QueryParameterStyle

type QueryParameterStyle string

QueryParameterStyle is an enum type.

func (QueryParameterStyle) MarshalJSON

func (i QueryParameterStyle) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*QueryParameterStyle) UnmarshalJSON

func (i *QueryParameterStyle) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type Reflector

type Reflector struct {
	jsonschema.Reflector
	Spec *Spec
}

Reflector builds OpenAPI Schema with reflected structures.

func (*Reflector) SetJSONResponse

func (r *Reflector) SetJSONResponse(o *Operation, output interface{}, httpStatus int) error

SetJSONResponse sets up operation JSON response.

Example
package main

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"time"

	"github.com/swaggest/openapi-go/openapi3"
)

func main() {
	reflector := openapi3.Reflector{}
	reflector.Spec = &openapi3.Spec{Openapi: "3.0.2"}
	reflector.Spec.Info.
		WithTitle("Things API").
		WithVersion("1.2.3").
		WithDescription("Put something here")

	type req struct {
		ID     string `path:"id" example:"XXX-XXXXX"`
		Locale string `query:"locale" pattern:"^[a-z]{2}-[A-Z]{2}$"`
		Title  string `json:"string"`
		Amount uint   `json:"amount"`
		Items  []struct {
			Count uint   `json:"count"`
			Name  string `json:"name"`
		} `json:"items"`
	}

	type resp struct {
		ID     string `json:"id" example:"XXX-XXXXX"`
		Amount uint   `json:"amount"`
		Items  []struct {
			Count uint   `json:"count"`
			Name  string `json:"name"`
		} `json:"items"`
		UpdatedAt time.Time `json:"updated_at"`
	}

	putOp := openapi3.Operation{}

	err := reflector.SetRequest(&putOp, new(req), http.MethodPut)
	if err != nil {
		log.Fatal(err)
	}

	err = reflector.SetJSONResponse(&putOp, new(resp), http.StatusOK)
	if err != nil {
		log.Fatal(err)
	}

	err = reflector.SetJSONResponse(&putOp, new([]resp), http.StatusConflict)
	if err != nil {
		log.Fatal(err)
	}

	getOp := openapi3.Operation{}

	err = reflector.SetRequest(&getOp, new(req), http.MethodGet)
	if err != nil {
		log.Fatal(err)
	}

	err = reflector.SetJSONResponse(&getOp, new(resp), http.StatusOK)
	if err != nil {
		log.Fatal(err)
	}

	pathItem := reflector.Spec.Paths.MapOfPathItemValues["/things/{id}"]
	pathItem.
		WithSummary("Path Summary").
		WithDescription("Path Description")

	pathItem.WithOperation(http.MethodPut, putOp).WithOperation(http.MethodGet, getOp)

	reflector.Spec.Paths.WithMapOfPathItemValuesItem("/things/{id}", pathItem)

	schema, err := json.MarshalIndent(reflector.Spec, "", " ")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(schema))

}
Output:

{
 "openapi": "3.0.2",
 "info": {
  "title": "Things API",
  "description": "Put something here",
  "version": "1.2.3"
 },
 "paths": {
  "/things/{id}": {
   "summary": "Path Summary",
   "description": "Path Description",
   "get": {
    "parameters": [
     {
      "name": "locale",
      "in": "query",
      "schema": {
       "pattern": "^[a-z]{2}-[A-Z]{2}$",
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "example": "XXX-XXXXX"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Openapi3TestResp"
        }
       }
      }
     }
    }
   },
   "put": {
    "parameters": [
     {
      "name": "locale",
      "in": "query",
      "schema": {
       "pattern": "^[a-z]{2}-[A-Z]{2}$",
       "type": "string"
      }
     },
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "example": "XXX-XXXXX"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Openapi3TestReq"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Openapi3TestResp"
        }
       }
      }
     },
     "409": {
      "description": "Conflict",
      "content": {
       "application/json": {
        "schema": {
         "type": "array",
         "items": {
          "$ref": "#/components/schemas/Openapi3TestResp"
         },
         "nullable": true
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Openapi3TestReq": {
    "type": "object",
    "properties": {
     "amount": {
      "minimum": 0,
      "type": "integer"
     },
     "items": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "count": {
         "minimum": 0,
         "type": "integer"
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "string": {
      "type": "string"
     }
    }
   },
   "Openapi3TestResp": {
    "type": "object",
    "properties": {
     "amount": {
      "minimum": 0,
      "type": "integer"
     },
     "id": {
      "type": "string",
      "example": "XXX-XXXXX"
     },
     "items": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "count": {
         "minimum": 0,
         "type": "integer"
        },
        "name": {
         "type": "string"
        }
       }
      }
     },
     "updated_at": {
      "type": "string",
      "format": "date-time"
     }
    }
   }
  }
 }
}

func (*Reflector) SetRequest

func (r *Reflector) SetRequest(o *Operation, input interface{}, httpMethod string) error

SetRequest sets up operation parameters.

func (*Reflector) SpecEns added in v0.1.1

func (r *Reflector) SpecEns() *Spec

SpecEns ensures returned Spec is not nil.

type RequestBody

type RequestBody struct {
	Description   *string                `json:"description,omitempty"`
	Content       map[string]MediaType   `json:"content"` // Required.
	Required      *bool                  `json:"required,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

RequestBody structure is generated from "#/definitions/RequestBody".

func (RequestBody) MarshalJSON

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

MarshalJSON encodes JSON.

func (*RequestBody) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*RequestBody) WithContent

func (r *RequestBody) WithContent(val map[string]MediaType) *RequestBody

WithContent sets Content value.

func (*RequestBody) WithContentItem

func (r *RequestBody) WithContentItem(key string, val MediaType) *RequestBody

WithContentItem sets Content item value.

func (*RequestBody) WithDescription

func (r *RequestBody) WithDescription(val string) *RequestBody

WithDescription sets Description value.

func (*RequestBody) WithMapOfAnything

func (r *RequestBody) WithMapOfAnything(val map[string]interface{}) *RequestBody

WithMapOfAnything sets MapOfAnything value.

func (*RequestBody) WithMapOfAnythingItem

func (r *RequestBody) WithMapOfAnythingItem(key string, val interface{}) *RequestBody

WithMapOfAnythingItem sets MapOfAnything item value.

func (*RequestBody) WithRequired

func (r *RequestBody) WithRequired(val bool) *RequestBody

WithRequired sets Required value.

type RequestBodyOrRef

type RequestBodyOrRef struct {
	RequestBodyReference *RequestBodyReference `json:"-"`
	RequestBody          *RequestBody          `json:"-"`
}

RequestBodyOrRef structure is generated from "#/definitions/RequestBodyOrRef".

func (RequestBodyOrRef) MarshalJSON

func (r RequestBodyOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*RequestBodyOrRef) RequestBodyEns added in v0.1.1

func (r *RequestBodyOrRef) RequestBodyEns() *RequestBody

RequestBodyEns ensures returned RequestBody is not nil.

func (*RequestBodyOrRef) RequestBodyReferenceEns added in v0.1.1

func (r *RequestBodyOrRef) RequestBodyReferenceEns() *RequestBodyReference

RequestBodyReferenceEns ensures returned RequestBodyReference is not nil.

func (*RequestBodyOrRef) UnmarshalJSON

func (r *RequestBodyOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*RequestBodyOrRef) WithRequestBody

func (r *RequestBodyOrRef) WithRequestBody(val RequestBody) *RequestBodyOrRef

WithRequestBody sets RequestBody value.

func (*RequestBodyOrRef) WithRequestBodyReference

func (r *RequestBodyOrRef) WithRequestBodyReference(val RequestBodyReference) *RequestBodyOrRef

WithRequestBodyReference sets RequestBodyReference value.

type RequestBodyReference

type RequestBodyReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

RequestBodyReference structure is generated from "#/definitions/RequestBodyReference".

func (RequestBodyReference) MarshalJSON

func (r RequestBodyReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*RequestBodyReference) UnmarshalJSON

func (r *RequestBodyReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*RequestBodyReference) WithRef

WithRef sets Ref value.

type Response

type Response struct {
	Description   string                 `json:"description"` // Required.
	Headers       map[string]HeaderOrRef `json:"headers,omitempty"`
	Content       map[string]MediaType   `json:"content,omitempty"`
	Links         map[string]LinkOrRef   `json:"links,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

Response structure is generated from "#/definitions/Response".

func (Response) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Response) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Response) WithContent

func (r *Response) WithContent(val map[string]MediaType) *Response

WithContent sets Content value.

func (*Response) WithContentItem

func (r *Response) WithContentItem(key string, val MediaType) *Response

WithContentItem sets Content item value.

func (*Response) WithDescription

func (r *Response) WithDescription(val string) *Response

WithDescription sets Description value.

func (*Response) WithHeaders

func (r *Response) WithHeaders(val map[string]HeaderOrRef) *Response

WithHeaders sets Headers value.

func (*Response) WithHeadersItem

func (r *Response) WithHeadersItem(key string, val HeaderOrRef) *Response

WithHeadersItem sets Headers item value.

func (r *Response) WithLinks(val map[string]LinkOrRef) *Response

WithLinks sets Links value.

func (*Response) WithLinksItem

func (r *Response) WithLinksItem(key string, val LinkOrRef) *Response

WithLinksItem sets Links item value.

func (*Response) WithMapOfAnything

func (r *Response) WithMapOfAnything(val map[string]interface{}) *Response

WithMapOfAnything sets MapOfAnything value.

func (*Response) WithMapOfAnythingItem

func (r *Response) WithMapOfAnythingItem(key string, val interface{}) *Response

WithMapOfAnythingItem sets MapOfAnything item value.

type ResponseOrRef

type ResponseOrRef struct {
	ResponseReference *ResponseReference `json:"-"`
	Response          *Response          `json:"-"`
}

ResponseOrRef structure is generated from "#/definitions/ResponseOrRef".

func (ResponseOrRef) MarshalJSON

func (r ResponseOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ResponseOrRef) ResponseEns added in v0.1.1

func (r *ResponseOrRef) ResponseEns() *Response

ResponseEns ensures returned Response is not nil.

func (*ResponseOrRef) ResponseReferenceEns added in v0.1.1

func (r *ResponseOrRef) ResponseReferenceEns() *ResponseReference

ResponseReferenceEns ensures returned ResponseReference is not nil.

func (*ResponseOrRef) UnmarshalJSON

func (r *ResponseOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ResponseOrRef) WithResponse

func (r *ResponseOrRef) WithResponse(val Response) *ResponseOrRef

WithResponse sets Response value.

func (*ResponseOrRef) WithResponseReference

func (r *ResponseOrRef) WithResponseReference(val ResponseReference) *ResponseOrRef

WithResponseReference sets ResponseReference value.

type ResponseReference

type ResponseReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

ResponseReference structure is generated from "#/definitions/ResponseReference".

func (ResponseReference) MarshalJSON

func (r ResponseReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*ResponseReference) UnmarshalJSON

func (r *ResponseReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*ResponseReference) WithRef

func (r *ResponseReference) WithRef(val string) *ResponseReference

WithRef sets Ref value.

type Responses

type Responses struct {
	Default                  *ResponseOrRef           `json:"default,omitempty"`
	MapOfResponseOrRefValues map[string]ResponseOrRef `json:"-"` // Key must match pattern: `^[1-5](?:\d{2}|XX)$`.
	MapOfAnything            map[string]interface{}   `json:"-"` // Key must match pattern: `^x-`.
}

Responses structure is generated from "#/definitions/Responses".

func (*Responses) DefaultEns added in v0.1.1

func (r *Responses) DefaultEns() *ResponseOrRef

DefaultEns ensures returned Default is not nil.

func (Responses) MarshalJSON

func (r Responses) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*Responses) UnmarshalJSON

func (r *Responses) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*Responses) WithDefault

func (r *Responses) WithDefault(val ResponseOrRef) *Responses

WithDefault sets Default value.

func (*Responses) WithMapOfAnything

func (r *Responses) WithMapOfAnything(val map[string]interface{}) *Responses

WithMapOfAnything sets MapOfAnything value.

func (*Responses) WithMapOfAnythingItem

func (r *Responses) WithMapOfAnythingItem(key string, val interface{}) *Responses

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Responses) WithMapOfResponseOrRefValues

func (r *Responses) WithMapOfResponseOrRefValues(val map[string]ResponseOrRef) *Responses

WithMapOfResponseOrRefValues sets MapOfResponseOrRefValues value.

func (*Responses) WithMapOfResponseOrRefValuesItem

func (r *Responses) WithMapOfResponseOrRefValuesItem(key string, val ResponseOrRef) *Responses

WithMapOfResponseOrRefValuesItem sets MapOfResponseOrRefValues item value.

type Schema

type Schema struct {
	Title                *string                     `json:"title,omitempty"`
	MultipleOf           *float64                    `json:"multipleOf,omitempty"`
	Maximum              *float64                    `json:"maximum,omitempty"`
	ExclusiveMaximum     *bool                       `json:"exclusiveMaximum,omitempty"`
	Minimum              *float64                    `json:"minimum,omitempty"`
	ExclusiveMinimum     *bool                       `json:"exclusiveMinimum,omitempty"`
	MaxLength            *int64                      `json:"maxLength,omitempty"`
	MinLength            *int64                      `json:"minLength,omitempty"`
	Pattern              *string                     `json:"pattern,omitempty"` // Format: regex.
	MaxItems             *int64                      `json:"maxItems,omitempty"`
	MinItems             *int64                      `json:"minItems,omitempty"`
	UniqueItems          *bool                       `json:"uniqueItems,omitempty"`
	MaxProperties        *int64                      `json:"maxProperties,omitempty"`
	MinProperties        *int64                      `json:"minProperties,omitempty"`
	Required             []string                    `json:"required,omitempty"`
	Enum                 []interface{}               `json:"enum,omitempty"`
	Type                 *SchemaType                 `json:"type,omitempty"`
	Not                  *SchemaOrRef                `json:"not,omitempty"`
	AllOf                []SchemaOrRef               `json:"allOf,omitempty"`
	OneOf                []SchemaOrRef               `json:"oneOf,omitempty"`
	AnyOf                []SchemaOrRef               `json:"anyOf,omitempty"`
	Items                *SchemaOrRef                `json:"items,omitempty"`
	Properties           map[string]SchemaOrRef      `json:"properties,omitempty"`
	AdditionalProperties *SchemaAdditionalProperties `json:"additionalProperties,omitempty"`
	Description          *string                     `json:"description,omitempty"`
	Format               *string                     `json:"format,omitempty"`
	Default              *interface{}                `json:"default,omitempty"`
	Nullable             *bool                       `json:"nullable,omitempty"`
	Discriminator        *Discriminator              `json:"discriminator,omitempty"`
	ReadOnly             *bool                       `json:"readOnly,omitempty"`
	WriteOnly            *bool                       `json:"writeOnly,omitempty"`
	Example              *interface{}                `json:"example,omitempty"`
	ExternalDocs         *ExternalDocumentation      `json:"externalDocs,omitempty"`
	Deprecated           *bool                       `json:"deprecated,omitempty"`
	XML                  *XML                        `json:"xml,omitempty"`
	MapOfAnything        map[string]interface{}      `json:"-"` // Key must match pattern: `^x-`.
}

Schema structure is generated from "#/definitions/Schema".

func (*Schema) AdditionalPropertiesEns added in v0.1.1

func (s *Schema) AdditionalPropertiesEns() *SchemaAdditionalProperties

AdditionalPropertiesEns ensures returned AdditionalProperties is not nil.

func (*Schema) DiscriminatorEns added in v0.1.1

func (s *Schema) DiscriminatorEns() *Discriminator

DiscriminatorEns ensures returned Discriminator is not nil.

func (*Schema) ExternalDocsEns added in v0.1.1

func (s *Schema) ExternalDocsEns() *ExternalDocumentation

ExternalDocsEns ensures returned ExternalDocs is not nil.

func (*Schema) ItemsEns added in v0.1.1

func (s *Schema) ItemsEns() *SchemaOrRef

ItemsEns ensures returned Items is not nil.

func (Schema) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Schema) NotEns added in v0.1.1

func (s *Schema) NotEns() *SchemaOrRef

NotEns ensures returned Not is not nil.

func (*Schema) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Schema) WithAdditionalProperties

func (s *Schema) WithAdditionalProperties(val SchemaAdditionalProperties) *Schema

WithAdditionalProperties sets AdditionalProperties value.

func (*Schema) WithAllOf

func (s *Schema) WithAllOf(val ...SchemaOrRef) *Schema

WithAllOf sets AllOf value.

func (*Schema) WithAnyOf

func (s *Schema) WithAnyOf(val ...SchemaOrRef) *Schema

WithAnyOf sets AnyOf value.

func (*Schema) WithDefault

func (s *Schema) WithDefault(val interface{}) *Schema

WithDefault sets Default value.

func (*Schema) WithDeprecated

func (s *Schema) WithDeprecated(val bool) *Schema

WithDeprecated sets Deprecated value.

func (*Schema) WithDescription

func (s *Schema) WithDescription(val string) *Schema

WithDescription sets Description value.

func (*Schema) WithDiscriminator

func (s *Schema) WithDiscriminator(val Discriminator) *Schema

WithDiscriminator sets Discriminator value.

func (*Schema) WithEnum

func (s *Schema) WithEnum(val ...interface{}) *Schema

WithEnum sets Enum value.

func (*Schema) WithExample

func (s *Schema) WithExample(val interface{}) *Schema

WithExample sets Example value.

func (*Schema) WithExclusiveMaximum

func (s *Schema) WithExclusiveMaximum(val bool) *Schema

WithExclusiveMaximum sets ExclusiveMaximum value.

func (*Schema) WithExclusiveMinimum

func (s *Schema) WithExclusiveMinimum(val bool) *Schema

WithExclusiveMinimum sets ExclusiveMinimum value.

func (*Schema) WithExternalDocs

func (s *Schema) WithExternalDocs(val ExternalDocumentation) *Schema

WithExternalDocs sets ExternalDocs value.

func (*Schema) WithFormat

func (s *Schema) WithFormat(val string) *Schema

WithFormat sets Format value.

func (*Schema) WithItems

func (s *Schema) WithItems(val SchemaOrRef) *Schema

WithItems sets Items value.

func (*Schema) WithMapOfAnything

func (s *Schema) WithMapOfAnything(val map[string]interface{}) *Schema

WithMapOfAnything sets MapOfAnything value.

func (*Schema) WithMapOfAnythingItem

func (s *Schema) WithMapOfAnythingItem(key string, val interface{}) *Schema

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Schema) WithMaxItems

func (s *Schema) WithMaxItems(val int64) *Schema

WithMaxItems sets MaxItems value.

func (*Schema) WithMaxLength

func (s *Schema) WithMaxLength(val int64) *Schema

WithMaxLength sets MaxLength value.

func (*Schema) WithMaxProperties

func (s *Schema) WithMaxProperties(val int64) *Schema

WithMaxProperties sets MaxProperties value.

func (*Schema) WithMaximum

func (s *Schema) WithMaximum(val float64) *Schema

WithMaximum sets Maximum value.

func (*Schema) WithMinItems

func (s *Schema) WithMinItems(val int64) *Schema

WithMinItems sets MinItems value.

func (*Schema) WithMinLength

func (s *Schema) WithMinLength(val int64) *Schema

WithMinLength sets MinLength value.

func (*Schema) WithMinProperties

func (s *Schema) WithMinProperties(val int64) *Schema

WithMinProperties sets MinProperties value.

func (*Schema) WithMinimum

func (s *Schema) WithMinimum(val float64) *Schema

WithMinimum sets Minimum value.

func (*Schema) WithMultipleOf

func (s *Schema) WithMultipleOf(val float64) *Schema

WithMultipleOf sets MultipleOf value.

func (*Schema) WithNot

func (s *Schema) WithNot(val SchemaOrRef) *Schema

WithNot sets Not value.

func (*Schema) WithNullable

func (s *Schema) WithNullable(val bool) *Schema

WithNullable sets Nullable value.

func (*Schema) WithOneOf

func (s *Schema) WithOneOf(val ...SchemaOrRef) *Schema

WithOneOf sets OneOf value.

func (*Schema) WithPattern

func (s *Schema) WithPattern(val string) *Schema

WithPattern sets Pattern value.

func (*Schema) WithProperties

func (s *Schema) WithProperties(val map[string]SchemaOrRef) *Schema

WithProperties sets Properties value.

func (*Schema) WithPropertiesItem

func (s *Schema) WithPropertiesItem(key string, val SchemaOrRef) *Schema

WithPropertiesItem sets Properties item value.

func (*Schema) WithReadOnly

func (s *Schema) WithReadOnly(val bool) *Schema

WithReadOnly sets ReadOnly value.

func (*Schema) WithRequired

func (s *Schema) WithRequired(val ...string) *Schema

WithRequired sets Required value.

func (*Schema) WithTitle

func (s *Schema) WithTitle(val string) *Schema

WithTitle sets Title value.

func (*Schema) WithType

func (s *Schema) WithType(val SchemaType) *Schema

WithType sets Type value.

func (*Schema) WithUniqueItems

func (s *Schema) WithUniqueItems(val bool) *Schema

WithUniqueItems sets UniqueItems value.

func (*Schema) WithWriteOnly

func (s *Schema) WithWriteOnly(val bool) *Schema

WithWriteOnly sets WriteOnly value.

func (*Schema) WithXML

func (s *Schema) WithXML(val XML) *Schema

WithXML sets XML value.

func (*Schema) XMLEns added in v0.1.1

func (s *Schema) XMLEns() *XML

XMLEns ensures returned XML is not nil.

type SchemaAdditionalProperties

type SchemaAdditionalProperties struct {
	SchemaOrRef *SchemaOrRef `json:"-"`
	Bool        *bool        `json:"-"`
}

SchemaAdditionalProperties structure is generated from "#/definitions/Schema->additionalProperties".

func (SchemaAdditionalProperties) MarshalJSON

func (s SchemaAdditionalProperties) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*SchemaAdditionalProperties) SchemaOrRefEns added in v0.1.1

func (s *SchemaAdditionalProperties) SchemaOrRefEns() *SchemaOrRef

SchemaOrRefEns ensures returned SchemaOrRef is not nil.

func (*SchemaAdditionalProperties) UnmarshalJSON

func (s *SchemaAdditionalProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*SchemaAdditionalProperties) WithBool

WithBool sets Bool value.

func (*SchemaAdditionalProperties) WithSchemaOrRef

WithSchemaOrRef sets SchemaOrRef value.

type SchemaOrRef

type SchemaOrRef struct {
	Schema          *Schema          `json:"-"`
	SchemaReference *SchemaReference `json:"-"`
}

SchemaOrRef structure is generated from "#/definitions/SchemaOrRef".

func (*SchemaOrRef) FromJSONSchema

func (s *SchemaOrRef) FromJSONSchema(schema jsonschema.SchemaOrBool)

FromJSONSchema loads OpenAPI Schema from JSON Schema.

func (SchemaOrRef) MarshalJSON

func (s SchemaOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*SchemaOrRef) SchemaEns added in v0.1.1

func (s *SchemaOrRef) SchemaEns() *Schema

SchemaEns ensures returned Schema is not nil.

func (*SchemaOrRef) SchemaReferenceEns added in v0.1.1

func (s *SchemaOrRef) SchemaReferenceEns() *SchemaReference

SchemaReferenceEns ensures returned SchemaReference is not nil.

func (*SchemaOrRef) ToJSONSchema added in v0.1.1

func (s *SchemaOrRef) ToJSONSchema(spec *Spec) jsonschema.SchemaOrBool

ToJSONSchema converts OpenAPI Schema to JSON Schema.

Local references are resolved against `#/components/schemas` in spec.

func (*SchemaOrRef) UnmarshalJSON

func (s *SchemaOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*SchemaOrRef) WithSchema

func (s *SchemaOrRef) WithSchema(val Schema) *SchemaOrRef

WithSchema sets Schema value.

func (*SchemaOrRef) WithSchemaReference

func (s *SchemaOrRef) WithSchemaReference(val SchemaReference) *SchemaOrRef

WithSchemaReference sets SchemaReference value.

type SchemaReference

type SchemaReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

SchemaReference structure is generated from "#/definitions/SchemaReference".

func (SchemaReference) MarshalJSON

func (s SchemaReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*SchemaReference) UnmarshalJSON

func (s *SchemaReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*SchemaReference) WithRef

func (s *SchemaReference) WithRef(val string) *SchemaReference

WithRef sets Ref value.

type SchemaType

type SchemaType string

SchemaType is an enum type.

func (SchemaType) MarshalJSON

func (i SchemaType) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*SchemaType) UnmarshalJSON

func (i *SchemaType) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

type SecurityScheme

type SecurityScheme struct {
	APIKeySecurityScheme        *APIKeySecurityScheme        `json:"-"`
	HTTPSecurityScheme          *HTTPSecurityScheme          `json:"-"`
	OAuth2SecurityScheme        *OAuth2SecurityScheme        `json:"-"`
	OpenIDConnectSecurityScheme *OpenIDConnectSecurityScheme `json:"-"`
}

SecurityScheme structure is generated from "#/definitions/SecurityScheme".

func (*SecurityScheme) APIKeySecuritySchemeEns added in v0.1.1

func (s *SecurityScheme) APIKeySecuritySchemeEns() *APIKeySecurityScheme

APIKeySecuritySchemeEns ensures returned APIKeySecurityScheme is not nil.

func (*SecurityScheme) HTTPSecuritySchemeEns added in v0.1.1

func (s *SecurityScheme) HTTPSecuritySchemeEns() *HTTPSecurityScheme

HTTPSecuritySchemeEns ensures returned HTTPSecurityScheme is not nil.

func (SecurityScheme) MarshalJSON

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

MarshalJSON encodes JSON.

func (*SecurityScheme) OAuth2SecuritySchemeEns added in v0.1.1

func (s *SecurityScheme) OAuth2SecuritySchemeEns() *OAuth2SecurityScheme

OAuth2SecuritySchemeEns ensures returned OAuth2SecurityScheme is not nil.

func (*SecurityScheme) OpenIDConnectSecuritySchemeEns added in v0.1.1

func (s *SecurityScheme) OpenIDConnectSecuritySchemeEns() *OpenIDConnectSecurityScheme

OpenIDConnectSecuritySchemeEns ensures returned OpenIDConnectSecurityScheme is not nil.

func (*SecurityScheme) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*SecurityScheme) WithAPIKeySecurityScheme

func (s *SecurityScheme) WithAPIKeySecurityScheme(val APIKeySecurityScheme) *SecurityScheme

WithAPIKeySecurityScheme sets APIKeySecurityScheme value.

func (*SecurityScheme) WithHTTPSecurityScheme

func (s *SecurityScheme) WithHTTPSecurityScheme(val HTTPSecurityScheme) *SecurityScheme

WithHTTPSecurityScheme sets HTTPSecurityScheme value.

func (*SecurityScheme) WithOAuth2SecurityScheme

func (s *SecurityScheme) WithOAuth2SecurityScheme(val OAuth2SecurityScheme) *SecurityScheme

WithOAuth2SecurityScheme sets OAuth2SecurityScheme value.

func (*SecurityScheme) WithOpenIDConnectSecurityScheme

func (s *SecurityScheme) WithOpenIDConnectSecurityScheme(val OpenIDConnectSecurityScheme) *SecurityScheme

WithOpenIDConnectSecurityScheme sets OpenIDConnectSecurityScheme value.

type SecuritySchemeOrRef

type SecuritySchemeOrRef struct {
	SecuritySchemeReference *SecuritySchemeReference `json:"-"`
	SecurityScheme          *SecurityScheme          `json:"-"`
}

SecuritySchemeOrRef structure is generated from "#/definitions/SecuritySchemeOrRef".

func (SecuritySchemeOrRef) MarshalJSON

func (s SecuritySchemeOrRef) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*SecuritySchemeOrRef) SecuritySchemeEns added in v0.1.1

func (s *SecuritySchemeOrRef) SecuritySchemeEns() *SecurityScheme

SecuritySchemeEns ensures returned SecurityScheme is not nil.

func (*SecuritySchemeOrRef) SecuritySchemeReferenceEns added in v0.1.1

func (s *SecuritySchemeOrRef) SecuritySchemeReferenceEns() *SecuritySchemeReference

SecuritySchemeReferenceEns ensures returned SecuritySchemeReference is not nil.

func (*SecuritySchemeOrRef) UnmarshalJSON

func (s *SecuritySchemeOrRef) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*SecuritySchemeOrRef) WithSecurityScheme

func (s *SecuritySchemeOrRef) WithSecurityScheme(val SecurityScheme) *SecuritySchemeOrRef

WithSecurityScheme sets SecurityScheme value.

func (*SecuritySchemeOrRef) WithSecuritySchemeReference

func (s *SecuritySchemeOrRef) WithSecuritySchemeReference(val SecuritySchemeReference) *SecuritySchemeOrRef

WithSecuritySchemeReference sets SecuritySchemeReference value.

type SecuritySchemeReference

type SecuritySchemeReference struct {
	// Format: uri-reference.
	// Required.
	Ref string `json:"$ref"`
}

SecuritySchemeReference structure is generated from "#/definitions/SecuritySchemeReference".

func (SecuritySchemeReference) MarshalJSON

func (s SecuritySchemeReference) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*SecuritySchemeReference) UnmarshalJSON

func (s *SecuritySchemeReference) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*SecuritySchemeReference) WithRef

WithRef sets Ref value.

type Server

type Server struct {
	URL           string                    `json:"url"` // Required.
	Description   *string                   `json:"description,omitempty"`
	Variables     map[string]ServerVariable `json:"variables,omitempty"`
	MapOfAnything map[string]interface{}    `json:"-"` // Key must match pattern: `^x-`.
}

Server structure is generated from "#/definitions/Server".

func (Server) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Server) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Server) WithDescription

func (s *Server) WithDescription(val string) *Server

WithDescription sets Description value.

func (*Server) WithMapOfAnything

func (s *Server) WithMapOfAnything(val map[string]interface{}) *Server

WithMapOfAnything sets MapOfAnything value.

func (*Server) WithMapOfAnythingItem

func (s *Server) WithMapOfAnythingItem(key string, val interface{}) *Server

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Server) WithURL

func (s *Server) WithURL(val string) *Server

WithURL sets URL value.

func (*Server) WithVariables

func (s *Server) WithVariables(val map[string]ServerVariable) *Server

WithVariables sets Variables value.

func (*Server) WithVariablesItem

func (s *Server) WithVariablesItem(key string, val ServerVariable) *Server

WithVariablesItem sets Variables item value.

type ServerVariable

type ServerVariable struct {
	Enum          []string               `json:"enum,omitempty"`
	Default       string                 `json:"default"` // Required.
	Description   *string                `json:"description,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

ServerVariable structure is generated from "#/definitions/ServerVariable".

func (ServerVariable) MarshalJSON

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

MarshalJSON encodes JSON.

func (*ServerVariable) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*ServerVariable) WithDefault

func (s *ServerVariable) WithDefault(val string) *ServerVariable

WithDefault sets Default value.

func (*ServerVariable) WithDescription

func (s *ServerVariable) WithDescription(val string) *ServerVariable

WithDescription sets Description value.

func (*ServerVariable) WithEnum

func (s *ServerVariable) WithEnum(val ...string) *ServerVariable

WithEnum sets Enum value.

func (*ServerVariable) WithMapOfAnything

func (s *ServerVariable) WithMapOfAnything(val map[string]interface{}) *ServerVariable

WithMapOfAnything sets MapOfAnything value.

func (*ServerVariable) WithMapOfAnythingItem

func (s *ServerVariable) WithMapOfAnythingItem(key string, val interface{}) *ServerVariable

WithMapOfAnythingItem sets MapOfAnything item value.

type Spec

type Spec struct {
	// Value must match pattern: `^3\.0\.\d(-.+)?$`.
	// Required.
	Openapi       string                 `json:"openapi"`
	Info          Info                   `json:"info"` // Required.
	ExternalDocs  *ExternalDocumentation `json:"externalDocs,omitempty"`
	Servers       []Server               `json:"servers,omitempty"`
	Security      []map[string][]string  `json:"security,omitempty"`
	Tags          []Tag                  `json:"tags,omitempty"`
	Paths         Paths                  `json:"paths"` // Required.
	Components    *Components            `json:"components,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

Spec structure is generated from "#".

Validation schema for OpenAPI Specification 3.0.X.

func (*Spec) ComponentsEns added in v0.1.1

func (s *Spec) ComponentsEns() *Components

ComponentsEns ensures returned Components is not nil.

func (*Spec) ExternalDocsEns added in v0.1.1

func (s *Spec) ExternalDocsEns() *ExternalDocumentation

ExternalDocsEns ensures returned ExternalDocs is not nil.

func (Spec) MarshalJSON

func (s Spec) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*Spec) UnmarshalJSON

func (s *Spec) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*Spec) WithComponents

func (s *Spec) WithComponents(val Components) *Spec

WithComponents sets Components value.

func (*Spec) WithExternalDocs

func (s *Spec) WithExternalDocs(val ExternalDocumentation) *Spec

WithExternalDocs sets ExternalDocs value.

func (*Spec) WithInfo

func (s *Spec) WithInfo(val Info) *Spec

WithInfo sets Info value.

func (*Spec) WithMapOfAnything

func (s *Spec) WithMapOfAnything(val map[string]interface{}) *Spec

WithMapOfAnything sets MapOfAnything value.

func (*Spec) WithMapOfAnythingItem

func (s *Spec) WithMapOfAnythingItem(key string, val interface{}) *Spec

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Spec) WithOpenapi

func (s *Spec) WithOpenapi(val string) *Spec

WithOpenapi sets Openapi value.

func (*Spec) WithPaths

func (s *Spec) WithPaths(val Paths) *Spec

WithPaths sets Paths value.

func (*Spec) WithSecurity

func (s *Spec) WithSecurity(val ...map[string][]string) *Spec

WithSecurity sets Security value.

func (*Spec) WithServers

func (s *Spec) WithServers(val ...Server) *Spec

WithServers sets Servers value.

func (*Spec) WithTags

func (s *Spec) WithTags(val ...Tag) *Spec

WithTags sets Tags value.

type Tag

type Tag struct {
	Name          string                 `json:"name"` // Required.
	Description   *string                `json:"description,omitempty"`
	ExternalDocs  *ExternalDocumentation `json:"externalDocs,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

Tag structure is generated from "#/definitions/Tag".

func (*Tag) ExternalDocsEns added in v0.1.1

func (t *Tag) ExternalDocsEns() *ExternalDocumentation

ExternalDocsEns ensures returned ExternalDocs is not nil.

func (Tag) MarshalJSON

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

MarshalJSON encodes JSON.

func (*Tag) UnmarshalJSON

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

UnmarshalJSON decodes JSON.

func (*Tag) WithDescription

func (t *Tag) WithDescription(val string) *Tag

WithDescription sets Description value.

func (*Tag) WithExternalDocs

func (t *Tag) WithExternalDocs(val ExternalDocumentation) *Tag

WithExternalDocs sets ExternalDocs value.

func (*Tag) WithMapOfAnything

func (t *Tag) WithMapOfAnything(val map[string]interface{}) *Tag

WithMapOfAnything sets MapOfAnything value.

func (*Tag) WithMapOfAnythingItem

func (t *Tag) WithMapOfAnythingItem(key string, val interface{}) *Tag

WithMapOfAnythingItem sets MapOfAnything item value.

func (*Tag) WithName

func (t *Tag) WithName(val string) *Tag

WithName sets Name value.

type XML

type XML struct {
	Name          *string                `json:"name,omitempty"`
	Namespace     *string                `json:"namespace,omitempty"` // Format: uri.
	Prefix        *string                `json:"prefix,omitempty"`
	Attribute     *bool                  `json:"attribute,omitempty"`
	Wrapped       *bool                  `json:"wrapped,omitempty"`
	MapOfAnything map[string]interface{} `json:"-"` // Key must match pattern: `^x-`.
}

XML structure is generated from "#/definitions/XML".

func (XML) MarshalJSON

func (x XML) MarshalJSON() ([]byte, error)

MarshalJSON encodes JSON.

func (*XML) UnmarshalJSON

func (x *XML) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes JSON.

func (*XML) WithAttribute

func (x *XML) WithAttribute(val bool) *XML

WithAttribute sets Attribute value.

func (*XML) WithMapOfAnything

func (x *XML) WithMapOfAnything(val map[string]interface{}) *XML

WithMapOfAnything sets MapOfAnything value.

func (*XML) WithMapOfAnythingItem

func (x *XML) WithMapOfAnythingItem(key string, val interface{}) *XML

WithMapOfAnythingItem sets MapOfAnything item value.

func (*XML) WithName

func (x *XML) WithName(val string) *XML

WithName sets Name value.

func (*XML) WithNamespace

func (x *XML) WithNamespace(val string) *XML

WithNamespace sets Namespace value.

func (*XML) WithPrefix

func (x *XML) WithPrefix(val string) *XML

WithPrefix sets Prefix value.

func (*XML) WithWrapped

func (x *XML) WithWrapped(val bool) *XML

WithWrapped sets Wrapped value.

Directories

Path Synopsis
_testdata

Jump to

Keyboard shortcuts

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