openapi

package
v0.0.0-...-a037c27 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2019 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package openapi implement OpenAPI Spec v2

Index

Constants

View Source
const (
	Int32  = "int32"
	Int64  = "int64"
	Float  = "float"
	Double = "double"
)

Variables

View Source
var ErrVisitAbort = errors.New(`visit aborted (non-error)`)

Functions

func ContactFromJSON

func ContactFromJSON(buf []byte, dst interface{}) error

ContactFromJSON constructs a Contact from JSON buffer. `dst` must be a pointer to `Contact`

func ExternalDocumentationFromJSON

func ExternalDocumentationFromJSON(buf []byte, dst interface{}) error

ExternalDocumentationFromJSON constructs a ExternalDocumentation from JSON buffer. `dst` must be a pointer to `ExternalDocumentation`

func HeaderFromJSON

func HeaderFromJSON(buf []byte, dst interface{}) error

HeaderFromJSON constructs a Header from JSON buffer. `dst` must be a pointer to `Header`

func InfoFromJSON

func InfoFromJSON(buf []byte, dst interface{}) error

InfoFromJSON constructs a Info from JSON buffer. `dst` must be a pointer to `Info`

func ItemsFromJSON

func ItemsFromJSON(buf []byte, dst interface{}) error

ItemsFromJSON constructs a Items from JSON buffer. `dst` must be a pointer to `Items`

func LicenseFromJSON

func LicenseFromJSON(buf []byte, dst interface{}) error

LicenseFromJSON constructs a License from JSON buffer. `dst` must be a pointer to `License`

func OperationFromJSON

func OperationFromJSON(buf []byte, dst interface{}) error

OperationFromJSON constructs a Operation from JSON buffer. `dst` must be a pointer to `Operation`

func ParameterFromJSON

func ParameterFromJSON(buf []byte, dst interface{}) error

ParameterFromJSON constructs a Parameter from JSON buffer. `dst` must be a pointer to `Parameter`

func PathItemFromJSON

func PathItemFromJSON(buf []byte, dst interface{}) error

PathItemFromJSON constructs a PathItem from JSON buffer. `dst` must be a pointer to `PathItem`

func PathsFromJSON

func PathsFromJSON(buf []byte, dst interface{}) error

PathsFromJSON constructs a Paths from JSON buffer. `dst` must be a pointer to `Paths`

func ResponseFromJSON

func ResponseFromJSON(buf []byte, dst interface{}) error

ResponseFromJSON constructs a Response from JSON buffer. `dst` must be a pointer to `Response`

func ResponsesFromJSON

func ResponsesFromJSON(buf []byte, dst interface{}) error

ResponsesFromJSON constructs a Responses from JSON buffer. `dst` must be a pointer to `Responses`

func SchemaFromJSON

func SchemaFromJSON(buf []byte, dst interface{}) error

SchemaFromJSON constructs a Schema from JSON buffer. `dst` must be a pointer to `Schema`

func SecurityRequirementFromJSON

func SecurityRequirementFromJSON(buf []byte, dst interface{}) error

SecurityRequirementFromJSON constructs a SecurityRequirement from JSON buffer. `dst` must be a pointer to `SecurityRequirement`

func SecuritySchemeFromJSON

func SecuritySchemeFromJSON(buf []byte, dst interface{}) error

SecuritySchemeFromJSON constructs a SecurityScheme from JSON buffer. `dst` must be a pointer to `SecurityScheme`

func SwaggerFromJSON

func SwaggerFromJSON(buf []byte, dst interface{}) error

SwaggerFromJSON constructs a Swagger from JSON buffer. `dst` must be a pointer to `Swagger`

func TagFromJSON

func TagFromJSON(buf []byte, dst interface{}) error

TagFromJSON constructs a Tag from JSON buffer. `dst` must be a pointer to `Tag`

func Visit

func Visit(ctx context.Context, handler, elem interface{}) error

Visit allows you to traverse through the OpenAPI structure

func XMLFromJSON

func XMLFromJSON(buf []byte, dst interface{}) error

XMLFromJSON constructs a XML from JSON buffer. `dst` must be a pointer to `XML`

Types

type CollectionFormat

type CollectionFormat string
const (
	CSV   CollectionFormat = "csv"
	SSV   CollectionFormat = "ssv"
	TSV   CollectionFormat = "tsv"
	Pipes CollectionFormat = "pipes"
	Multi CollectionFormat = "multi"
)

type Contact

type Contact interface {
	Name() string
	URL() string
	Email() string
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Contact
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type ContactBuilder

type ContactBuilder struct {
	// contains filtered or unexported fields
}

ContactBuilder is used to build an instance of Contact. The user must call `Build()` after providing all the necessary information to build an instance of Contact. Builders may NOT be reused. It must be created for every instance of Contact that you want to create

func NewContact

func NewContact(options ...Option) *ContactBuilder

NewContact creates a new builder object for Contact

func (*ContactBuilder) Build

func (b *ContactBuilder) Build(options ...Option) (Contact, error)

Build finalizes the building process for Contact and returns the result By default, Build() will validate if the given structure is valid

func (*ContactBuilder) Email

func (b *ContactBuilder) Email(v string) *ContactBuilder

Email sets the email field for object Contact.

func (*ContactBuilder) Extension

func (b *ContactBuilder) Extension(name string, value interface{}) *ContactBuilder

Extension sets an arbitrary element (an extension) to the object Contact. The extension name should start with a "x-"

func (*ContactBuilder) MustBuild

func (b *ContactBuilder) MustBuild(options ...Option) Contact

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*ContactBuilder) Name

func (b *ContactBuilder) Name(v string) *ContactBuilder

Name sets the name field for object Contact.

func (*ContactBuilder) Reference

func (b *ContactBuilder) Reference(v string) *ContactBuilder

Reference sets the $ref (reference) field for object Contact.

func (*ContactBuilder) URL

URL sets the url field for object Contact.

type ContactMutator

type ContactMutator struct {
	// contains filtered or unexported fields
}

ContactMutator is used to build an instance of Contact. The user must call `Apply()` after providing all the necessary information to the new instance of Contact with new values

func MutateContact

func MutateContact(v Contact, options ...Option) *ContactMutator

MutateContact creates a new mutator object for Contact Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*ContactMutator) Apply

func (m *ContactMutator) Apply() error

Apply finalizes the matuation process for Contact and returns the result

func (*ContactMutator) Email

func (m *ContactMutator) Email(v string) *ContactMutator

Email sets the Email field for object Contact.

func (*ContactMutator) Extension

func (m *ContactMutator) Extension(name string, value interface{}) *ContactMutator

Extension sets an arbitrary extension field in Contact

func (*ContactMutator) Name

func (m *ContactMutator) Name(v string) *ContactMutator

Name sets the Name field for object Contact.

func (*ContactMutator) URL

URL sets the URL field for object Contact.

type ContactVisitor

type ContactVisitor interface {
	VisitContact(context.Context, Contact) error
}

ContactVisitor is an interface for objects that knows how to process Contact elements while traversing the OpenAPI structure

type ExampleMap

type ExampleMap map[ExampleMapKey]interface{}

func (*ExampleMap) Clear

func (v *ExampleMap) Clear() error

Clear removes all elements from ExampleMap

func (ExampleMap) QueryJSON

func (v ExampleMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*ExampleMap) Validate

func (v *ExampleMap) Validate(recurse bool) error

Validate checks the correctness of values in ExampleMap

type ExampleMapIterator

type ExampleMapIterator struct {
	// contains filtered or unexported fields
}

func (*ExampleMapIterator) Item

func (iter *ExampleMapIterator) Item() (string, interface{})

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*ExampleMapIterator) Next

func (iter *ExampleMapIterator) Next() bool

func (*ExampleMapIterator) Size

func (iter *ExampleMapIterator) Size() int

type ExampleMapKey

type ExampleMapKey = string

type Extensions

type Extensions map[string]interface{}

type ExtensionsIterator

type ExtensionsIterator struct {
	// contains filtered or unexported fields
}

func (*ExtensionsIterator) Item

func (iter *ExtensionsIterator) Item() (string, interface{})

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*ExtensionsIterator) Next

func (iter *ExtensionsIterator) Next() bool

func (*ExtensionsIterator) Size

func (iter *ExtensionsIterator) Size() int

type ExternalDocumentation

type ExternalDocumentation interface {
	URL() string
	Description() string
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() ExternalDocumentation
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type ExternalDocumentationBuilder

type ExternalDocumentationBuilder struct {
	// contains filtered or unexported fields
}

ExternalDocumentationBuilder is used to build an instance of ExternalDocumentation. The user must call `Build()` after providing all the necessary information to build an instance of ExternalDocumentation. Builders may NOT be reused. It must be created for every instance of ExternalDocumentation that you want to create

func NewExternalDocumentation

func NewExternalDocumentation(url string, options ...Option) *ExternalDocumentationBuilder

NewExternalDocumentation creates a new builder object for ExternalDocumentation

func (*ExternalDocumentationBuilder) Build

Build finalizes the building process for ExternalDocumentation and returns the result By default, Build() will validate if the given structure is valid

func (*ExternalDocumentationBuilder) Description

Description sets the description field for object ExternalDocumentation.

func (*ExternalDocumentationBuilder) Extension

func (b *ExternalDocumentationBuilder) Extension(name string, value interface{}) *ExternalDocumentationBuilder

Extension sets an arbitrary element (an extension) to the object ExternalDocumentation. The extension name should start with a "x-"

func (*ExternalDocumentationBuilder) MustBuild

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*ExternalDocumentationBuilder) Reference

Reference sets the $ref (reference) field for object ExternalDocumentation.

type ExternalDocumentationMutator

type ExternalDocumentationMutator struct {
	// contains filtered or unexported fields
}

ExternalDocumentationMutator is used to build an instance of ExternalDocumentation. The user must call `Apply()` after providing all the necessary information to the new instance of ExternalDocumentation with new values

func MutateExternalDocumentation

func MutateExternalDocumentation(v ExternalDocumentation, options ...Option) *ExternalDocumentationMutator

MutateExternalDocumentation creates a new mutator object for ExternalDocumentation Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*ExternalDocumentationMutator) Apply

Apply finalizes the matuation process for ExternalDocumentation and returns the result

func (*ExternalDocumentationMutator) Description

Description sets the Description field for object ExternalDocumentation.

func (*ExternalDocumentationMutator) Extension

func (m *ExternalDocumentationMutator) Extension(name string, value interface{}) *ExternalDocumentationMutator

Extension sets an arbitrary extension field in ExternalDocumentation

func (*ExternalDocumentationMutator) URL

URL sets the URL field for object ExternalDocumentation.

type ExternalDocumentationVisitor

type ExternalDocumentationVisitor interface {
	VisitExternalDocumentation(context.Context, ExternalDocumentation) error
}

ExternalDocumentationVisitor is an interface for objects that knows how to process ExternalDocumentation elements while traversing the OpenAPI structure

type Header interface {
	Name() string
	Description() string
	Type() string
	Format() string
	Items() Items
	CollectionFormat() CollectionFormat
	Default() interface{}
	Maximum() float64
	ExclusiveMaximum() float64
	Minimum() float64
	ExclusiveMinimum() float64
	MaxLength() int
	MinLength() int
	Pattern() string
	MaxItems() int
	MinItems() int
	UniqueItems() bool
	Enum() *InterfaceListIterator
	MultipleOf() float64
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Header
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type HeaderBuilder

type HeaderBuilder struct {
	// contains filtered or unexported fields
}

HeaderBuilder is used to build an instance of Header. The user must call `Build()` after providing all the necessary information to build an instance of Header. Builders may NOT be reused. It must be created for every instance of Header that you want to create

func NewHeader

func NewHeader(typ string, options ...Option) *HeaderBuilder

NewHeader creates a new builder object for Header

func (*HeaderBuilder) Build

func (b *HeaderBuilder) Build(options ...Option) (Header, error)

Build finalizes the building process for Header and returns the result By default, Build() will validate if the given structure is valid

func (*HeaderBuilder) CollectionFormat

func (b *HeaderBuilder) CollectionFormat(v CollectionFormat) *HeaderBuilder

CollectionFormat sets the collectionFormat field for object Header.

func (*HeaderBuilder) Default

func (b *HeaderBuilder) Default(v interface{}) *HeaderBuilder

Default sets the defaultValue field for object Header.

func (*HeaderBuilder) Description

func (b *HeaderBuilder) Description(v string) *HeaderBuilder

Description sets the description field for object Header.

func (*HeaderBuilder) Enum

func (b *HeaderBuilder) Enum(v ...interface{}) *HeaderBuilder

Enum sets the enum field for object Header.

func (*HeaderBuilder) ExclusiveMaximum

func (b *HeaderBuilder) ExclusiveMaximum(v float64) *HeaderBuilder

ExclusiveMaximum sets the exclusiveMaximum field for object Header.

func (*HeaderBuilder) ExclusiveMinimum

func (b *HeaderBuilder) ExclusiveMinimum(v float64) *HeaderBuilder

ExclusiveMinimum sets the exclusiveMinimum field for object Header.

func (*HeaderBuilder) Extension

func (b *HeaderBuilder) Extension(name string, value interface{}) *HeaderBuilder

Extension sets an arbitrary element (an extension) to the object Header. The extension name should start with a "x-"

func (*HeaderBuilder) Format

func (b *HeaderBuilder) Format(v string) *HeaderBuilder

Format sets the format field for object Header.

func (*HeaderBuilder) Items

func (b *HeaderBuilder) Items(v Items) *HeaderBuilder

Items sets the items field for object Header.

func (*HeaderBuilder) MaxItems

func (b *HeaderBuilder) MaxItems(v int) *HeaderBuilder

MaxItems sets the maxItems field for object Header.

func (*HeaderBuilder) MaxLength

func (b *HeaderBuilder) MaxLength(v int) *HeaderBuilder

MaxLength sets the maxLength field for object Header.

func (*HeaderBuilder) Maximum

func (b *HeaderBuilder) Maximum(v float64) *HeaderBuilder

Maximum sets the maximum field for object Header.

func (*HeaderBuilder) MinItems

func (b *HeaderBuilder) MinItems(v int) *HeaderBuilder

MinItems sets the minItems field for object Header.

func (*HeaderBuilder) MinLength

func (b *HeaderBuilder) MinLength(v int) *HeaderBuilder

MinLength sets the minLength field for object Header.

func (*HeaderBuilder) Minimum

func (b *HeaderBuilder) Minimum(v float64) *HeaderBuilder

Minimum sets the minimum field for object Header.

func (*HeaderBuilder) MultipleOf

func (b *HeaderBuilder) MultipleOf(v float64) *HeaderBuilder

MultipleOf sets the multipleOf field for object Header.

func (*HeaderBuilder) MustBuild

func (b *HeaderBuilder) MustBuild(options ...Option) Header

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*HeaderBuilder) Name

func (b *HeaderBuilder) Name(v string) *HeaderBuilder

Name sets the name field for object Header.

func (*HeaderBuilder) Pattern

func (b *HeaderBuilder) Pattern(v string) *HeaderBuilder

Pattern sets the pattern field for object Header.

func (*HeaderBuilder) Reference

func (b *HeaderBuilder) Reference(v string) *HeaderBuilder

Reference sets the $ref (reference) field for object Header.

func (*HeaderBuilder) UniqueItems

func (b *HeaderBuilder) UniqueItems(v bool) *HeaderBuilder

UniqueItems sets the uniqueItems field for object Header.

type HeaderMap

type HeaderMap map[HeaderMapKey]Header

func (*HeaderMap) Clear

func (v *HeaderMap) Clear() error

Clear removes all elements from HeaderMap

func (HeaderMap) QueryJSON

func (v HeaderMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*HeaderMap) UnmarshalJSON

func (v *HeaderMap) UnmarshalJSON(data []byte) error

UnmarshalJSON takes a JSON buffer and properly populates `v`

func (*HeaderMap) Validate

func (v *HeaderMap) Validate(recurse bool) error

Validate checks the correctness of values in HeaderMap

type HeaderMapIterator

type HeaderMapIterator struct {
	// contains filtered or unexported fields
}

func (*HeaderMapIterator) Item

func (iter *HeaderMapIterator) Item() (string, Header)

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*HeaderMapIterator) Next

func (iter *HeaderMapIterator) Next() bool

func (*HeaderMapIterator) Size

func (iter *HeaderMapIterator) Size() int

type HeaderMapKey

type HeaderMapKey = string

type HeaderMutator

type HeaderMutator struct {
	// contains filtered or unexported fields
}

HeaderMutator is used to build an instance of Header. The user must call `Apply()` after providing all the necessary information to the new instance of Header with new values

func MutateHeader

func MutateHeader(v Header, options ...Option) *HeaderMutator

MutateHeader creates a new mutator object for Header Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*HeaderMutator) Apply

func (m *HeaderMutator) Apply() error

Apply finalizes the matuation process for Header and returns the result

func (*HeaderMutator) ClearEnum

func (m *HeaderMutator) ClearEnum() *HeaderMutator

ClearEnum clears all elements in enum

func (*HeaderMutator) CollectionFormat

func (m *HeaderMutator) CollectionFormat(v CollectionFormat) *HeaderMutator

CollectionFormat sets the CollectionFormat field for object Header.

func (*HeaderMutator) Default

func (m *HeaderMutator) Default(v interface{}) *HeaderMutator

Default sets the Default field for object Header.

func (*HeaderMutator) Description

func (m *HeaderMutator) Description(v string) *HeaderMutator

Description sets the Description field for object Header.

func (*HeaderMutator) Enum

func (m *HeaderMutator) Enum(value interface{}) *HeaderMutator

Enum appends a value to enum

func (*HeaderMutator) ExclusiveMaximum

func (m *HeaderMutator) ExclusiveMaximum(v float64) *HeaderMutator

ExclusiveMaximum sets the ExclusiveMaximum field for object Header.

func (*HeaderMutator) ExclusiveMinimum

func (m *HeaderMutator) ExclusiveMinimum(v float64) *HeaderMutator

ExclusiveMinimum sets the ExclusiveMinimum field for object Header.

func (*HeaderMutator) Extension

func (m *HeaderMutator) Extension(name string, value interface{}) *HeaderMutator

Extension sets an arbitrary extension field in Header

func (*HeaderMutator) Format

func (m *HeaderMutator) Format(v string) *HeaderMutator

Format sets the Format field for object Header.

func (*HeaderMutator) Items

func (m *HeaderMutator) Items(v Items) *HeaderMutator

Items sets the Items field for object Header.

func (*HeaderMutator) MaxItems

func (m *HeaderMutator) MaxItems(v int) *HeaderMutator

MaxItems sets the MaxItems field for object Header.

func (*HeaderMutator) MaxLength

func (m *HeaderMutator) MaxLength(v int) *HeaderMutator

MaxLength sets the MaxLength field for object Header.

func (*HeaderMutator) Maximum

func (m *HeaderMutator) Maximum(v float64) *HeaderMutator

Maximum sets the Maximum field for object Header.

func (*HeaderMutator) MinItems

func (m *HeaderMutator) MinItems(v int) *HeaderMutator

MinItems sets the MinItems field for object Header.

func (*HeaderMutator) MinLength

func (m *HeaderMutator) MinLength(v int) *HeaderMutator

MinLength sets the MinLength field for object Header.

func (*HeaderMutator) Minimum

func (m *HeaderMutator) Minimum(v float64) *HeaderMutator

Minimum sets the Minimum field for object Header.

func (*HeaderMutator) MultipleOf

func (m *HeaderMutator) MultipleOf(v float64) *HeaderMutator

MultipleOf sets the MultipleOf field for object Header.

func (*HeaderMutator) Name

func (m *HeaderMutator) Name(v string) *HeaderMutator

Name sets the Name field for object Header.

func (*HeaderMutator) Pattern

func (m *HeaderMutator) Pattern(v string) *HeaderMutator

Pattern sets the Pattern field for object Header.

func (*HeaderMutator) Type

func (m *HeaderMutator) Type(v string) *HeaderMutator

Type sets the Type field for object Header.

func (*HeaderMutator) UniqueItems

func (m *HeaderMutator) UniqueItems(v bool) *HeaderMutator

UniqueItems sets the UniqueItems field for object Header.

type HeaderVisitor

type HeaderVisitor interface {
	VisitHeader(context.Context, Header) error
}

HeaderVisitor is an interface for objects that knows how to process Header elements while traversing the OpenAPI structure

type Info

type Info interface {
	Title() string
	Version() string
	Description() string
	TermsOfService() string
	Contact() Contact
	License() License
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Info
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type InfoBuilder

type InfoBuilder struct {
	// contains filtered or unexported fields
}

InfoBuilder is used to build an instance of Info. The user must call `Build()` after providing all the necessary information to build an instance of Info. Builders may NOT be reused. It must be created for every instance of Info that you want to create

func NewInfo

func NewInfo(title string, version string, options ...Option) *InfoBuilder

NewInfo creates a new builder object for Info

func (*InfoBuilder) Build

func (b *InfoBuilder) Build(options ...Option) (Info, error)

Build finalizes the building process for Info and returns the result By default, Build() will validate if the given structure is valid

func (*InfoBuilder) Contact

func (b *InfoBuilder) Contact(v Contact) *InfoBuilder

Contact sets the contact field for object Info.

func (*InfoBuilder) Description

func (b *InfoBuilder) Description(v string) *InfoBuilder

Description sets the description field for object Info.

func (*InfoBuilder) Extension

func (b *InfoBuilder) Extension(name string, value interface{}) *InfoBuilder

Extension sets an arbitrary element (an extension) to the object Info. The extension name should start with a "x-"

func (*InfoBuilder) License

func (b *InfoBuilder) License(v License) *InfoBuilder

License sets the license field for object Info.

func (*InfoBuilder) MustBuild

func (b *InfoBuilder) MustBuild(options ...Option) Info

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*InfoBuilder) Reference

func (b *InfoBuilder) Reference(v string) *InfoBuilder

Reference sets the $ref (reference) field for object Info.

func (*InfoBuilder) TermsOfService

func (b *InfoBuilder) TermsOfService(v string) *InfoBuilder

TermsOfService sets the termsOfService field for object Info.

type InfoMutator

type InfoMutator struct {
	// contains filtered or unexported fields
}

InfoMutator is used to build an instance of Info. The user must call `Apply()` after providing all the necessary information to the new instance of Info with new values

func MutateInfo

func MutateInfo(v Info, options ...Option) *InfoMutator

MutateInfo creates a new mutator object for Info Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*InfoMutator) Apply

func (m *InfoMutator) Apply() error

Apply finalizes the matuation process for Info and returns the result

func (*InfoMutator) Contact

func (m *InfoMutator) Contact(v Contact) *InfoMutator

Contact sets the Contact field for object Info.

func (*InfoMutator) Description

func (m *InfoMutator) Description(v string) *InfoMutator

Description sets the Description field for object Info.

func (*InfoMutator) Extension

func (m *InfoMutator) Extension(name string, value interface{}) *InfoMutator

Extension sets an arbitrary extension field in Info

func (*InfoMutator) License

func (m *InfoMutator) License(v License) *InfoMutator

License sets the License field for object Info.

func (*InfoMutator) TermsOfService

func (m *InfoMutator) TermsOfService(v string) *InfoMutator

TermsOfService sets the TermsOfService field for object Info.

func (*InfoMutator) Title

func (m *InfoMutator) Title(v string) *InfoMutator

Title sets the Title field for object Info.

func (*InfoMutator) Version

func (m *InfoMutator) Version(v string) *InfoMutator

Version sets the Version field for object Info.

type InfoVisitor

type InfoVisitor interface {
	VisitInfo(context.Context, Info) error
}

InfoVisitor is an interface for objects that knows how to process Info elements while traversing the OpenAPI structure

type InterfaceList

type InterfaceList []interface{}

func (*InterfaceList) Clear

func (v *InterfaceList) Clear() error

Clear removes all values from InterfaceList

func (*InterfaceList) Validate

func (v *InterfaceList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type InterfaceListIterator

type InterfaceListIterator struct {
	// contains filtered or unexported fields
}

func (*InterfaceListIterator) Item

func (iter *InterfaceListIterator) Item() interface{}

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*InterfaceListIterator) Next

func (iter *InterfaceListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*InterfaceListIterator) Size

func (iter *InterfaceListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type InterfaceMap

type InterfaceMap map[InterfaceMapKey]interface{}

func (*InterfaceMap) Clear

func (v *InterfaceMap) Clear() error

Clear removes all elements from InterfaceMap

func (InterfaceMap) QueryJSON

func (v InterfaceMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*InterfaceMap) Validate

func (v *InterfaceMap) Validate(recurse bool) error

Validate checks the correctness of values in InterfaceMap

type InterfaceMapIterator

type InterfaceMapIterator struct {
	// contains filtered or unexported fields
}

func (*InterfaceMapIterator) Item

func (iter *InterfaceMapIterator) Item() (string, interface{})

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*InterfaceMapIterator) Next

func (iter *InterfaceMapIterator) Next() bool

func (*InterfaceMapIterator) Size

func (iter *InterfaceMapIterator) Size() int

type InterfaceMapKey

type InterfaceMapKey = string

type Items

type Items interface {
	Type() PrimitiveType
	Format() string
	Items() Items
	CollectionFormat() CollectionFormat
	Default() interface{}
	HasMaximum() bool
	Maximum() float64
	HasExclusiveMaximum() bool
	ExclusiveMaximum() float64
	HasMinimum() bool
	Minimum() float64
	HasExclusiveMinimum() bool
	ExclusiveMinimum() float64
	HasMaxLength() bool
	MaxLength() int
	HasMinLength() bool
	MinLength() int
	Pattern() string
	HasMaxItems() bool
	MaxItems() int
	HasMinItems() bool
	MinItems() int
	HasUniqueItems() bool
	UniqueItems() bool
	Enum() *InterfaceListIterator
	HasMultipleOf() bool
	MultipleOf() float64
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Items
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
	SchemaConverter
}

type ItemsBuilder

type ItemsBuilder struct {
	// contains filtered or unexported fields
}

ItemsBuilder is used to build an instance of Items. The user must call `Build()` after providing all the necessary information to build an instance of Items. Builders may NOT be reused. It must be created for every instance of Items that you want to create

func NewItems

func NewItems(options ...Option) *ItemsBuilder

NewItems creates a new builder object for Items

func (*ItemsBuilder) Build

func (b *ItemsBuilder) Build(options ...Option) (Items, error)

Build finalizes the building process for Items and returns the result By default, Build() will validate if the given structure is valid

func (*ItemsBuilder) CollectionFormat

func (b *ItemsBuilder) CollectionFormat(v CollectionFormat) *ItemsBuilder

CollectionFormat sets the collectionFormat field for object Items.

func (*ItemsBuilder) Default

func (b *ItemsBuilder) Default(v interface{}) *ItemsBuilder

Default sets the defaultValue field for object Items.

func (*ItemsBuilder) Enum

func (b *ItemsBuilder) Enum(v ...interface{}) *ItemsBuilder

Enum sets the enum field for object Items.

func (*ItemsBuilder) ExclusiveMaximum

func (b *ItemsBuilder) ExclusiveMaximum(v float64) *ItemsBuilder

ExclusiveMaximum sets the exclusiveMaximum field for object Items.

func (*ItemsBuilder) ExclusiveMinimum

func (b *ItemsBuilder) ExclusiveMinimum(v float64) *ItemsBuilder

ExclusiveMinimum sets the exclusiveMinimum field for object Items.

func (*ItemsBuilder) Extension

func (b *ItemsBuilder) Extension(name string, value interface{}) *ItemsBuilder

Extension sets an arbitrary element (an extension) to the object Items. The extension name should start with a "x-"

func (*ItemsBuilder) Format

func (b *ItemsBuilder) Format(v string) *ItemsBuilder

Format sets the format field for object Items.

func (*ItemsBuilder) Items

func (b *ItemsBuilder) Items(v Items) *ItemsBuilder

Items sets the items field for object Items.

func (*ItemsBuilder) MaxItems

func (b *ItemsBuilder) MaxItems(v int) *ItemsBuilder

MaxItems sets the maxItems field for object Items.

func (*ItemsBuilder) MaxLength

func (b *ItemsBuilder) MaxLength(v int) *ItemsBuilder

MaxLength sets the maxLength field for object Items.

func (*ItemsBuilder) Maximum

func (b *ItemsBuilder) Maximum(v float64) *ItemsBuilder

Maximum sets the maximum field for object Items.

func (*ItemsBuilder) MinItems

func (b *ItemsBuilder) MinItems(v int) *ItemsBuilder

MinItems sets the minItems field for object Items.

func (*ItemsBuilder) MinLength

func (b *ItemsBuilder) MinLength(v int) *ItemsBuilder

MinLength sets the minLength field for object Items.

func (*ItemsBuilder) Minimum

func (b *ItemsBuilder) Minimum(v float64) *ItemsBuilder

Minimum sets the minimum field for object Items.

func (*ItemsBuilder) MultipleOf

func (b *ItemsBuilder) MultipleOf(v float64) *ItemsBuilder

MultipleOf sets the multipleOf field for object Items.

func (*ItemsBuilder) MustBuild

func (b *ItemsBuilder) MustBuild(options ...Option) Items

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*ItemsBuilder) Pattern

func (b *ItemsBuilder) Pattern(v string) *ItemsBuilder

Pattern sets the pattern field for object Items.

func (*ItemsBuilder) Reference

func (b *ItemsBuilder) Reference(v string) *ItemsBuilder

Reference sets the $ref (reference) field for object Items.

func (*ItemsBuilder) Type

Type sets the typ field for object Items.

func (*ItemsBuilder) UniqueItems

func (b *ItemsBuilder) UniqueItems(v bool) *ItemsBuilder

UniqueItems sets the uniqueItems field for object Items.

type ItemsMutator

type ItemsMutator struct {
	// contains filtered or unexported fields
}

ItemsMutator is used to build an instance of Items. The user must call `Apply()` after providing all the necessary information to the new instance of Items with new values

func MutateItems

func MutateItems(v Items, options ...Option) *ItemsMutator

MutateItems creates a new mutator object for Items Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*ItemsMutator) Apply

func (m *ItemsMutator) Apply() error

Apply finalizes the matuation process for Items and returns the result

func (*ItemsMutator) ClearEnum

func (m *ItemsMutator) ClearEnum() *ItemsMutator

ClearEnum clears all elements in enum

func (*ItemsMutator) ClearExclusiveMaximum

func (m *ItemsMutator) ClearExclusiveMaximum() *ItemsMutator

ClearExclusiveMaximum clears the exclusiveMaximum field

func (*ItemsMutator) ClearExclusiveMinimum

func (m *ItemsMutator) ClearExclusiveMinimum() *ItemsMutator

ClearExclusiveMinimum clears the exclusiveMinimum field

func (*ItemsMutator) ClearMaxItems

func (m *ItemsMutator) ClearMaxItems() *ItemsMutator

ClearMaxItems clears the maxItems field

func (*ItemsMutator) ClearMaxLength

func (m *ItemsMutator) ClearMaxLength() *ItemsMutator

ClearMaxLength clears the maxLength field

func (*ItemsMutator) ClearMaximum

func (m *ItemsMutator) ClearMaximum() *ItemsMutator

ClearMaximum clears the maximum field

func (*ItemsMutator) ClearMinItems

func (m *ItemsMutator) ClearMinItems() *ItemsMutator

ClearMinItems clears the minItems field

func (*ItemsMutator) ClearMinLength

func (m *ItemsMutator) ClearMinLength() *ItemsMutator

ClearMinLength clears the minLength field

func (*ItemsMutator) ClearMinimum

func (m *ItemsMutator) ClearMinimum() *ItemsMutator

ClearMinimum clears the minimum field

func (*ItemsMutator) ClearMultipleOf

func (m *ItemsMutator) ClearMultipleOf() *ItemsMutator

ClearMultipleOf clears the multipleOf field

func (*ItemsMutator) ClearUniqueItems

func (m *ItemsMutator) ClearUniqueItems() *ItemsMutator

ClearUniqueItems clears the uniqueItems field

func (*ItemsMutator) CollectionFormat

func (m *ItemsMutator) CollectionFormat(v CollectionFormat) *ItemsMutator

CollectionFormat sets the CollectionFormat field for object Items.

func (*ItemsMutator) Default

func (m *ItemsMutator) Default(v interface{}) *ItemsMutator

Default sets the Default field for object Items.

func (*ItemsMutator) Enum

func (m *ItemsMutator) Enum(value interface{}) *ItemsMutator

Enum appends a value to enum

func (*ItemsMutator) ExclusiveMaximum

func (m *ItemsMutator) ExclusiveMaximum(v float64) *ItemsMutator

ExclusiveMaximum sets the exclusiveMaximum field.

func (*ItemsMutator) ExclusiveMinimum

func (m *ItemsMutator) ExclusiveMinimum(v float64) *ItemsMutator

ExclusiveMinimum sets the exclusiveMinimum field.

func (*ItemsMutator) Extension

func (m *ItemsMutator) Extension(name string, value interface{}) *ItemsMutator

Extension sets an arbitrary extension field in Items

func (*ItemsMutator) Format

func (m *ItemsMutator) Format(v string) *ItemsMutator

Format sets the Format field for object Items.

func (*ItemsMutator) Items

func (m *ItemsMutator) Items(v Items) *ItemsMutator

Items sets the Items field for object Items.

func (*ItemsMutator) MaxItems

func (m *ItemsMutator) MaxItems(v int) *ItemsMutator

MaxItems sets the maxItems field.

func (*ItemsMutator) MaxLength

func (m *ItemsMutator) MaxLength(v int) *ItemsMutator

MaxLength sets the maxLength field.

func (*ItemsMutator) Maximum

func (m *ItemsMutator) Maximum(v float64) *ItemsMutator

Maximum sets the maximum field.

func (*ItemsMutator) MinItems

func (m *ItemsMutator) MinItems(v int) *ItemsMutator

MinItems sets the minItems field.

func (*ItemsMutator) MinLength

func (m *ItemsMutator) MinLength(v int) *ItemsMutator

MinLength sets the minLength field.

func (*ItemsMutator) Minimum

func (m *ItemsMutator) Minimum(v float64) *ItemsMutator

Minimum sets the minimum field.

func (*ItemsMutator) MultipleOf

func (m *ItemsMutator) MultipleOf(v float64) *ItemsMutator

MultipleOf sets the multipleOf field.

func (*ItemsMutator) Pattern

func (m *ItemsMutator) Pattern(v string) *ItemsMutator

Pattern sets the Pattern field for object Items.

func (*ItemsMutator) Type

Type sets the Type field for object Items.

func (*ItemsMutator) UniqueItems

func (m *ItemsMutator) UniqueItems(v bool) *ItemsMutator

UniqueItems sets the uniqueItems field.

type ItemsVisitor

type ItemsVisitor interface {
	VisitItems(context.Context, Items) error
}

ItemsVisitor is an interface for objects that knows how to process Items elements while traversing the OpenAPI structure

type License

type License interface {
	Name() string
	URL() string
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() License
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type LicenseBuilder

type LicenseBuilder struct {
	// contains filtered or unexported fields
}

LicenseBuilder is used to build an instance of License. The user must call `Build()` after providing all the necessary information to build an instance of License. Builders may NOT be reused. It must be created for every instance of License that you want to create

func NewLicense

func NewLicense(name string, options ...Option) *LicenseBuilder

NewLicense creates a new builder object for License

func (*LicenseBuilder) Build

func (b *LicenseBuilder) Build(options ...Option) (License, error)

Build finalizes the building process for License and returns the result By default, Build() will validate if the given structure is valid

func (*LicenseBuilder) Extension

func (b *LicenseBuilder) Extension(name string, value interface{}) *LicenseBuilder

Extension sets an arbitrary element (an extension) to the object License. The extension name should start with a "x-"

func (*LicenseBuilder) MustBuild

func (b *LicenseBuilder) MustBuild(options ...Option) License

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*LicenseBuilder) Reference

func (b *LicenseBuilder) Reference(v string) *LicenseBuilder

Reference sets the $ref (reference) field for object License.

func (*LicenseBuilder) URL

URL sets the url field for object License.

type LicenseMutator

type LicenseMutator struct {
	// contains filtered or unexported fields
}

LicenseMutator is used to build an instance of License. The user must call `Apply()` after providing all the necessary information to the new instance of License with new values

func MutateLicense

func MutateLicense(v License, options ...Option) *LicenseMutator

MutateLicense creates a new mutator object for License Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*LicenseMutator) Apply

func (m *LicenseMutator) Apply() error

Apply finalizes the matuation process for License and returns the result

func (*LicenseMutator) Extension

func (m *LicenseMutator) Extension(name string, value interface{}) *LicenseMutator

Extension sets an arbitrary extension field in License

func (*LicenseMutator) Name

func (m *LicenseMutator) Name(v string) *LicenseMutator

Name sets the Name field for object License.

func (*LicenseMutator) URL

URL sets the URL field for object License.

type LicenseVisitor

type LicenseVisitor interface {
	VisitLicense(context.Context, License) error
}

LicenseVisitor is an interface for objects that knows how to process License elements while traversing the OpenAPI structure

type Location

type Location string
const (
	InPath   Location = "path"
	InQuery  Location = "query"
	InHeader Location = "header"
	InBody   Location = "body"
	InForm   Location = "formData"
)

type MIMEType

type MIMEType = string
const (
	WWWFormURLEncoded MIMEType = "application/x-www-form-urlencoded"
	MultiparFormDaata MIMEType = "multipart/form-data"
)

type MIMETypeList

type MIMETypeList []MIMEType

func (*MIMETypeList) Clear

func (v *MIMETypeList) Clear() error

Clear removes all values from MIMETypeList

func (*MIMETypeList) Validate

func (v *MIMETypeList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type MIMETypeListIterator

type MIMETypeListIterator struct {
	// contains filtered or unexported fields
}

func (*MIMETypeListIterator) Item

func (iter *MIMETypeListIterator) Item() MIMEType

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*MIMETypeListIterator) Next

func (iter *MIMETypeListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*MIMETypeListIterator) Size

func (iter *MIMETypeListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type MapQueryJSON

type MapQueryJSON map[string]interface{}

type MediaType

type MediaType = string

type MediaTypeListIterator

type MediaTypeListIterator struct {
	// contains filtered or unexported fields
}

func (*MediaTypeListIterator) Item

func (iter *MediaTypeListIterator) Item() MediaType

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*MediaTypeListIterator) Next

func (iter *MediaTypeListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*MediaTypeListIterator) Size

func (iter *MediaTypeListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type OpenAPI

type OpenAPI = Swagger

type Operation

type Operation interface {
	Verb() string
	PathItem() PathItem
	Tags() *StringListIterator
	Summary() string
	Description() string
	ExternalDocs() ExternalDocumentation
	OperationID() string
	Consumes() *MIMETypeListIterator
	Produces() *MIMETypeListIterator
	Parameters() *ParameterListIterator
	Responses() Responses
	Schemes() *SchemeListIterator
	Deprecated() bool
	Security() *SecurityRequirementListIterator
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Operation
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
	// contains filtered or unexported methods
}

type OperationBuilder

type OperationBuilder struct {
	// contains filtered or unexported fields
}

OperationBuilder is used to build an instance of Operation. The user must call `Build()` after providing all the necessary information to build an instance of Operation. Builders may NOT be reused. It must be created for every instance of Operation that you want to create

func NewOperation

func NewOperation(responses Responses, options ...Option) *OperationBuilder

NewOperation creates a new builder object for Operation

func (*OperationBuilder) Build

func (b *OperationBuilder) Build(options ...Option) (Operation, error)

Build finalizes the building process for Operation and returns the result By default, Build() will validate if the given structure is valid

func (*OperationBuilder) Consumes

func (b *OperationBuilder) Consumes(v ...MIMEType) *OperationBuilder

Consumes sets the consumes field for object Operation.

func (*OperationBuilder) Deprecated

func (b *OperationBuilder) Deprecated(v bool) *OperationBuilder

Deprecated sets the deprecated field for object Operation.

func (*OperationBuilder) Description

func (b *OperationBuilder) Description(v string) *OperationBuilder

Description sets the description field for object Operation.

func (*OperationBuilder) Extension

func (b *OperationBuilder) Extension(name string, value interface{}) *OperationBuilder

Extension sets an arbitrary element (an extension) to the object Operation. The extension name should start with a "x-"

func (*OperationBuilder) ExternalDocs

ExternalDocs sets the externalDocs field for object Operation.

func (*OperationBuilder) MustBuild

func (b *OperationBuilder) MustBuild(options ...Option) Operation

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*OperationBuilder) OperationID

func (b *OperationBuilder) OperationID(v string) *OperationBuilder

OperationID sets the operationID field for object Operation.

func (*OperationBuilder) Parameters

func (b *OperationBuilder) Parameters(v ...Parameter) *OperationBuilder

Parameters sets the parameters field for object Operation.

func (*OperationBuilder) Produces

func (b *OperationBuilder) Produces(v ...MIMEType) *OperationBuilder

Produces sets the produces field for object Operation.

func (*OperationBuilder) Reference

func (b *OperationBuilder) Reference(v string) *OperationBuilder

Reference sets the $ref (reference) field for object Operation.

func (*OperationBuilder) Schemes

func (b *OperationBuilder) Schemes(v ...Scheme) *OperationBuilder

Schemes sets the schemes field for object Operation.

func (*OperationBuilder) Security

Security sets the security field for object Operation.

func (*OperationBuilder) Summary

func (b *OperationBuilder) Summary(v string) *OperationBuilder

Summary sets the summary field for object Operation.

func (*OperationBuilder) Tags

func (b *OperationBuilder) Tags(v ...string) *OperationBuilder

Tags sets the tags field for object Operation.

type OperationListIterator

type OperationListIterator struct {
	// contains filtered or unexported fields
}

func (*OperationListIterator) Item

func (iter *OperationListIterator) Item() Operation

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*OperationListIterator) Next

func (iter *OperationListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*OperationListIterator) Size

func (iter *OperationListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type OperationMutator

type OperationMutator struct {
	// contains filtered or unexported fields
}

OperationMutator is used to build an instance of Operation. The user must call `Apply()` after providing all the necessary information to the new instance of Operation with new values

func MutateOperation

func MutateOperation(v Operation, options ...Option) *OperationMutator

MutateOperation creates a new mutator object for Operation Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*OperationMutator) Apply

func (m *OperationMutator) Apply() error

Apply finalizes the matuation process for Operation and returns the result

func (*OperationMutator) ClearConsumes

func (m *OperationMutator) ClearConsumes() *OperationMutator

ClearConsumes clears all elements in consumes

func (*OperationMutator) ClearParameters

func (m *OperationMutator) ClearParameters() *OperationMutator

ClearParameters clears all elements in parameters

func (*OperationMutator) ClearProduces

func (m *OperationMutator) ClearProduces() *OperationMutator

ClearProduces clears all elements in produces

func (*OperationMutator) ClearSchemes

func (m *OperationMutator) ClearSchemes() *OperationMutator

ClearSchemes clears all elements in schemes

func (*OperationMutator) ClearSecurity

func (m *OperationMutator) ClearSecurity() *OperationMutator

ClearSecurity clears all elements in security

func (*OperationMutator) ClearTags

func (m *OperationMutator) ClearTags() *OperationMutator

ClearTags clears all elements in tags

func (*OperationMutator) Consume

func (m *OperationMutator) Consume(value string) *OperationMutator

Consume appends a value to consumes

func (*OperationMutator) Deprecated

func (m *OperationMutator) Deprecated(v bool) *OperationMutator

Deprecated sets the Deprecated field for object Operation.

func (*OperationMutator) Description

func (m *OperationMutator) Description(v string) *OperationMutator

Description sets the Description field for object Operation.

func (*OperationMutator) Extension

func (m *OperationMutator) Extension(name string, value interface{}) *OperationMutator

Extension sets an arbitrary extension field in Operation

func (*OperationMutator) ExternalDocs

ExternalDocs sets the ExternalDocs field for object Operation.

func (*OperationMutator) OperationID

func (m *OperationMutator) OperationID(v string) *OperationMutator

OperationID sets the OperationID field for object Operation.

func (*OperationMutator) Parameter

func (m *OperationMutator) Parameter(value Parameter) *OperationMutator

Parameter appends a value to parameters

func (*OperationMutator) Produce

func (m *OperationMutator) Produce(value string) *OperationMutator

Produce appends a value to produces

func (*OperationMutator) Responses

func (m *OperationMutator) Responses(v Responses) *OperationMutator

Responses sets the Responses field for object Operation.

func (*OperationMutator) Scheme

func (m *OperationMutator) Scheme(value string) *OperationMutator

Scheme appends a value to schemes

func (*OperationMutator) Security

Security appends a value to security

func (*OperationMutator) Summary

func (m *OperationMutator) Summary(v string) *OperationMutator

Summary sets the Summary field for object Operation.

func (*OperationMutator) Tag

func (m *OperationMutator) Tag(value string) *OperationMutator

Tag appends a value to tags

type OperationVisitor

type OperationVisitor interface {
	VisitOperation(context.Context, Operation) error
}

OperationVisitor is an interface for objects that knows how to process Operation elements while traversing the OpenAPI structure

type Option

type Option = option.Interface

func WithLocker

func WithLocker(v sync.Locker) Option

WithLocker specifies the lock object to be used for applicable constructs, such as a Builder object. If a nil value is passed, usually it effectively becomes a non-locking operation. Please Consult the specific construct you're working with for exact semantics

func WithValidate

func WithValidate(v bool) Option

WithValidate specifies if validation should be performed on the object. This option can be passed to `ParseYAML`, `ParseJSON`, and `Do` methods for builders and mutators.

type Parameter

type Parameter interface {
	Name() string
	Description() string
	Required() bool
	In() Location
	Schema() Schema
	Type() PrimitiveType
	Format() string
	Title() string
	AllowEmptyValue() bool
	Items() Items
	CollectionFormat() CollectionFormat
	Default() interface{}
	HasMaximum() bool
	Maximum() float64
	HasExclusiveMaximum() bool
	ExclusiveMaximum() float64
	HasMinimum() bool
	Minimum() float64
	HasExclusiveMinimum() bool
	ExclusiveMinimum() float64
	HasMaxLength() bool
	MaxLength() int
	HasMinLength() bool
	MinLength() int
	Pattern() string
	HasMaxItems() bool
	MaxItems() int
	HasMinItems() bool
	MinItems() int
	HasUniqueItems() bool
	UniqueItems() bool
	Enum() *InterfaceListIterator
	HasMultipleOf() bool
	MultipleOf() float64
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Parameter
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
	SchemaConverter
}

type ParameterBuilder

type ParameterBuilder struct {
	// contains filtered or unexported fields
}

ParameterBuilder is used to build an instance of Parameter. The user must call `Build()` after providing all the necessary information to build an instance of Parameter. Builders may NOT be reused. It must be created for every instance of Parameter that you want to create

func NewParameter

func NewParameter(name string, in Location, options ...Option) *ParameterBuilder

NewParameter creates a new builder object for Parameter

func (*ParameterBuilder) AllowEmptyValue

func (b *ParameterBuilder) AllowEmptyValue(v bool) *ParameterBuilder

AllowEmptyValue sets the allowEmptyValue field for object Parameter.

func (*ParameterBuilder) Build

func (b *ParameterBuilder) Build(options ...Option) (Parameter, error)

Build finalizes the building process for Parameter and returns the result By default, Build() will validate if the given structure is valid

func (*ParameterBuilder) CollectionFormat

func (b *ParameterBuilder) CollectionFormat(v CollectionFormat) *ParameterBuilder

CollectionFormat sets the collectionFormat field for object Parameter.

func (*ParameterBuilder) Default

func (b *ParameterBuilder) Default(v interface{}) *ParameterBuilder

Default sets the defaultValue field for object Parameter.

func (*ParameterBuilder) Description

func (b *ParameterBuilder) Description(v string) *ParameterBuilder

Description sets the description field for object Parameter.

func (*ParameterBuilder) Enum

func (b *ParameterBuilder) Enum(v ...interface{}) *ParameterBuilder

Enum sets the enum field for object Parameter.

func (*ParameterBuilder) ExclusiveMaximum

func (b *ParameterBuilder) ExclusiveMaximum(v float64) *ParameterBuilder

ExclusiveMaximum sets the exclusiveMaximum field for object Parameter.

func (*ParameterBuilder) ExclusiveMinimum

func (b *ParameterBuilder) ExclusiveMinimum(v float64) *ParameterBuilder

ExclusiveMinimum sets the exclusiveMinimum field for object Parameter.

func (*ParameterBuilder) Extension

func (b *ParameterBuilder) Extension(name string, value interface{}) *ParameterBuilder

Extension sets an arbitrary element (an extension) to the object Parameter. The extension name should start with a "x-"

func (*ParameterBuilder) Format

Format sets the format field for object Parameter.

func (*ParameterBuilder) Items

Items sets the items field for object Parameter.

func (*ParameterBuilder) MaxItems

func (b *ParameterBuilder) MaxItems(v int) *ParameterBuilder

MaxItems sets the maxItems field for object Parameter.

func (*ParameterBuilder) MaxLength

func (b *ParameterBuilder) MaxLength(v int) *ParameterBuilder

MaxLength sets the maxLength field for object Parameter.

func (*ParameterBuilder) Maximum

func (b *ParameterBuilder) Maximum(v float64) *ParameterBuilder

Maximum sets the maximum field for object Parameter.

func (*ParameterBuilder) MinItems

func (b *ParameterBuilder) MinItems(v int) *ParameterBuilder

MinItems sets the minItems field for object Parameter.

func (*ParameterBuilder) MinLength

func (b *ParameterBuilder) MinLength(v int) *ParameterBuilder

MinLength sets the minLength field for object Parameter.

func (*ParameterBuilder) Minimum

func (b *ParameterBuilder) Minimum(v float64) *ParameterBuilder

Minimum sets the minimum field for object Parameter.

func (*ParameterBuilder) MultipleOf

func (b *ParameterBuilder) MultipleOf(v float64) *ParameterBuilder

MultipleOf sets the multipleOf field for object Parameter.

func (*ParameterBuilder) MustBuild

func (b *ParameterBuilder) MustBuild(options ...Option) Parameter

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*ParameterBuilder) Pattern

func (b *ParameterBuilder) Pattern(v string) *ParameterBuilder

Pattern sets the pattern field for object Parameter.

func (*ParameterBuilder) Reference

func (b *ParameterBuilder) Reference(v string) *ParameterBuilder

Reference sets the $ref (reference) field for object Parameter.

func (*ParameterBuilder) Required

func (b *ParameterBuilder) Required(v bool) *ParameterBuilder

Required sets the required field for object Parameter.

func (*ParameterBuilder) Schema

Schema sets the schema field for object Parameter.

func (*ParameterBuilder) Title

Title sets the title field for object Parameter.

func (*ParameterBuilder) Type

Type sets the typ field for object Parameter.

func (*ParameterBuilder) UniqueItems

func (b *ParameterBuilder) UniqueItems(v bool) *ParameterBuilder

UniqueItems sets the uniqueItems field for object Parameter.

type ParameterList

type ParameterList []Parameter

func (*ParameterList) Clear

func (v *ParameterList) Clear() error

Clear removes all values from ParameterList

func (*ParameterList) UnmarshalJSON

func (v *ParameterList) UnmarshalJSON(data []byte) error

UnmarshalJSON defines how ParameterList is deserialized from JSON

func (*ParameterList) Validate

func (v *ParameterList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type ParameterListIterator

type ParameterListIterator struct {
	// contains filtered or unexported fields
}

func (*ParameterListIterator) Item

func (iter *ParameterListIterator) Item() Parameter

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*ParameterListIterator) Next

func (iter *ParameterListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*ParameterListIterator) Size

func (iter *ParameterListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type ParameterMap

type ParameterMap map[ParameterMapKey]Parameter

func (*ParameterMap) Clear

func (v *ParameterMap) Clear() error

Clear removes all elements from ParameterMap

func (ParameterMap) QueryJSON

func (v ParameterMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*ParameterMap) UnmarshalJSON

func (v *ParameterMap) UnmarshalJSON(data []byte) error

UnmarshalJSON takes a JSON buffer and properly populates `v`

func (*ParameterMap) Validate

func (v *ParameterMap) Validate(recurse bool) error

Validate checks the correctness of values in ParameterMap

type ParameterMapIterator

type ParameterMapIterator struct {
	// contains filtered or unexported fields
}

func (*ParameterMapIterator) Item

func (iter *ParameterMapIterator) Item() (string, Parameter)

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*ParameterMapIterator) Next

func (iter *ParameterMapIterator) Next() bool

func (*ParameterMapIterator) Size

func (iter *ParameterMapIterator) Size() int

type ParameterMapKey

type ParameterMapKey = string

type ParameterMutator

type ParameterMutator struct {
	// contains filtered or unexported fields
}

ParameterMutator is used to build an instance of Parameter. The user must call `Apply()` after providing all the necessary information to the new instance of Parameter with new values

func MutateParameter

func MutateParameter(v Parameter, options ...Option) *ParameterMutator

MutateParameter creates a new mutator object for Parameter Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*ParameterMutator) AllowEmptyValue

func (m *ParameterMutator) AllowEmptyValue(v bool) *ParameterMutator

AllowEmptyValue sets the AllowEmptyValue field for object Parameter.

func (*ParameterMutator) Apply

func (m *ParameterMutator) Apply() error

Apply finalizes the matuation process for Parameter and returns the result

func (*ParameterMutator) ClearEnum

func (m *ParameterMutator) ClearEnum() *ParameterMutator

ClearEnum clears all elements in enum

func (*ParameterMutator) ClearExclusiveMaximum

func (m *ParameterMutator) ClearExclusiveMaximum() *ParameterMutator

ClearExclusiveMaximum clears the exclusiveMaximum field

func (*ParameterMutator) ClearExclusiveMinimum

func (m *ParameterMutator) ClearExclusiveMinimum() *ParameterMutator

ClearExclusiveMinimum clears the exclusiveMinimum field

func (*ParameterMutator) ClearMaxItems

func (m *ParameterMutator) ClearMaxItems() *ParameterMutator

ClearMaxItems clears the maxItems field

func (*ParameterMutator) ClearMaxLength

func (m *ParameterMutator) ClearMaxLength() *ParameterMutator

ClearMaxLength clears the maxLength field

func (*ParameterMutator) ClearMaximum

func (m *ParameterMutator) ClearMaximum() *ParameterMutator

ClearMaximum clears the maximum field

func (*ParameterMutator) ClearMinItems

func (m *ParameterMutator) ClearMinItems() *ParameterMutator

ClearMinItems clears the minItems field

func (*ParameterMutator) ClearMinLength

func (m *ParameterMutator) ClearMinLength() *ParameterMutator

ClearMinLength clears the minLength field

func (*ParameterMutator) ClearMinimum

func (m *ParameterMutator) ClearMinimum() *ParameterMutator

ClearMinimum clears the minimum field

func (*ParameterMutator) ClearMultipleOf

func (m *ParameterMutator) ClearMultipleOf() *ParameterMutator

ClearMultipleOf clears the multipleOf field

func (*ParameterMutator) ClearUniqueItems

func (m *ParameterMutator) ClearUniqueItems() *ParameterMutator

ClearUniqueItems clears the uniqueItems field

func (*ParameterMutator) CollectionFormat

func (m *ParameterMutator) CollectionFormat(v CollectionFormat) *ParameterMutator

CollectionFormat sets the CollectionFormat field for object Parameter.

func (*ParameterMutator) Default

func (m *ParameterMutator) Default(v interface{}) *ParameterMutator

Default sets the Default field for object Parameter.

func (*ParameterMutator) Description

func (m *ParameterMutator) Description(v string) *ParameterMutator

Description sets the Description field for object Parameter.

func (*ParameterMutator) Enum

func (m *ParameterMutator) Enum(value interface{}) *ParameterMutator

Enum appends a value to enum

func (*ParameterMutator) ExclusiveMaximum

func (m *ParameterMutator) ExclusiveMaximum(v float64) *ParameterMutator

ExclusiveMaximum sets the exclusiveMaximum field.

func (*ParameterMutator) ExclusiveMinimum

func (m *ParameterMutator) ExclusiveMinimum(v float64) *ParameterMutator

ExclusiveMinimum sets the exclusiveMinimum field.

func (*ParameterMutator) Extension

func (m *ParameterMutator) Extension(name string, value interface{}) *ParameterMutator

Extension sets an arbitrary extension field in Parameter

func (*ParameterMutator) Format

Format sets the Format field for object Parameter.

func (*ParameterMutator) In

In sets the In field for object Parameter.

func (*ParameterMutator) Items

Items sets the Items field for object Parameter.

func (*ParameterMutator) MaxItems

func (m *ParameterMutator) MaxItems(v int) *ParameterMutator

MaxItems sets the maxItems field.

func (*ParameterMutator) MaxLength

func (m *ParameterMutator) MaxLength(v int) *ParameterMutator

MaxLength sets the maxLength field.

func (*ParameterMutator) Maximum

func (m *ParameterMutator) Maximum(v float64) *ParameterMutator

Maximum sets the maximum field.

func (*ParameterMutator) MinItems

func (m *ParameterMutator) MinItems(v int) *ParameterMutator

MinItems sets the minItems field.

func (*ParameterMutator) MinLength

func (m *ParameterMutator) MinLength(v int) *ParameterMutator

MinLength sets the minLength field.

func (*ParameterMutator) Minimum

func (m *ParameterMutator) Minimum(v float64) *ParameterMutator

Minimum sets the minimum field.

func (*ParameterMutator) MultipleOf

func (m *ParameterMutator) MultipleOf(v float64) *ParameterMutator

MultipleOf sets the multipleOf field.

func (*ParameterMutator) Name

Name sets the Name field for object Parameter.

func (*ParameterMutator) Pattern

func (m *ParameterMutator) Pattern(v string) *ParameterMutator

Pattern sets the Pattern field for object Parameter.

func (*ParameterMutator) Required

func (m *ParameterMutator) Required(v bool) *ParameterMutator

Required sets the Required field for object Parameter.

func (*ParameterMutator) Schema

Schema sets the Schema field for object Parameter.

func (*ParameterMutator) Title

Title sets the Title field for object Parameter.

func (*ParameterMutator) Type

Type sets the Type field for object Parameter.

func (*ParameterMutator) UniqueItems

func (m *ParameterMutator) UniqueItems(v bool) *ParameterMutator

UniqueItems sets the uniqueItems field.

type ParameterVisitor

type ParameterVisitor interface {
	VisitParameter(context.Context, Parameter) error
}

ParameterVisitor is an interface for objects that knows how to process Parameter elements while traversing the OpenAPI structure

type PathItem

type PathItem interface {
	Name() string
	Path() string
	Get() Operation
	Put() Operation
	Post() Operation
	Delete() Operation
	Options() Operation
	Head() Operation
	Patch() Operation
	Parameters() *ParameterListIterator
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() PathItem
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
	Operations() *OperationListIterator
	// contains filtered or unexported methods
}

type PathItemBuilder

type PathItemBuilder struct {
	// contains filtered or unexported fields
}

PathItemBuilder is used to build an instance of PathItem. The user must call `Build()` after providing all the necessary information to build an instance of PathItem. Builders may NOT be reused. It must be created for every instance of PathItem that you want to create

func NewPathItem

func NewPathItem(options ...Option) *PathItemBuilder

NewPathItem creates a new builder object for PathItem

func (*PathItemBuilder) Build

func (b *PathItemBuilder) Build(options ...Option) (PathItem, error)

Build finalizes the building process for PathItem and returns the result By default, Build() will validate if the given structure is valid

func (*PathItemBuilder) Delete

func (*PathItemBuilder) Extension

func (b *PathItemBuilder) Extension(name string, value interface{}) *PathItemBuilder

Extension sets an arbitrary element (an extension) to the object PathItem. The extension name should start with a "x-"

func (*PathItemBuilder) Get

func (*PathItemBuilder) Head

func (*PathItemBuilder) MustBuild

func (b *PathItemBuilder) MustBuild(options ...Option) PathItem

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*PathItemBuilder) Options

func (b *PathItemBuilder) Options(v Operation) *PathItemBuilder

func (*PathItemBuilder) Parameters

func (b *PathItemBuilder) Parameters(v ...Parameter) *PathItemBuilder

Parameters sets the parameters field for object PathItem.

func (*PathItemBuilder) Patch

func (*PathItemBuilder) Post

func (*PathItemBuilder) Put

func (*PathItemBuilder) Reference

func (b *PathItemBuilder) Reference(v string) *PathItemBuilder

Reference sets the $ref (reference) field for object PathItem.

type PathItemListIterator

type PathItemListIterator struct {
	// contains filtered or unexported fields
}

func (*PathItemListIterator) Item

func (iter *PathItemListIterator) Item() PathItem

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*PathItemListIterator) Next

func (iter *PathItemListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*PathItemListIterator) Size

func (iter *PathItemListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type PathItemMap

type PathItemMap map[PathItemMapKey]PathItem

func (*PathItemMap) Clear

func (v *PathItemMap) Clear() error

Clear removes all elements from PathItemMap

func (PathItemMap) QueryJSON

func (v PathItemMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*PathItemMap) UnmarshalJSON

func (v *PathItemMap) UnmarshalJSON(data []byte) error

UnmarshalJSON takes a JSON buffer and properly populates `v`

func (*PathItemMap) Validate

func (v *PathItemMap) Validate(recurse bool) error

Validate checks the correctness of values in PathItemMap

type PathItemMapIterator

type PathItemMapIterator struct {
	// contains filtered or unexported fields
}

func (*PathItemMapIterator) Item

func (iter *PathItemMapIterator) Item() (string, PathItem)

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*PathItemMapIterator) Next

func (iter *PathItemMapIterator) Next() bool

func (*PathItemMapIterator) Size

func (iter *PathItemMapIterator) Size() int

type PathItemMapKey

type PathItemMapKey = string

type PathItemMutator

type PathItemMutator struct {
	// contains filtered or unexported fields
}

PathItemMutator is used to build an instance of PathItem. The user must call `Apply()` after providing all the necessary information to the new instance of PathItem with new values

func MutatePathItem

func MutatePathItem(v PathItem, options ...Option) *PathItemMutator

MutatePathItem creates a new mutator object for PathItem Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*PathItemMutator) Apply

func (m *PathItemMutator) Apply() error

Apply finalizes the matuation process for PathItem and returns the result

func (*PathItemMutator) ClearParameters

func (m *PathItemMutator) ClearParameters() *PathItemMutator

ClearParameters clears all elements in parameters

func (*PathItemMutator) Delete

func (*PathItemMutator) Extension

func (m *PathItemMutator) Extension(name string, value interface{}) *PathItemMutator

Extension sets an arbitrary extension field in PathItem

func (*PathItemMutator) Get

func (*PathItemMutator) Head

func (*PathItemMutator) Options

func (m *PathItemMutator) Options(v Operation) *PathItemMutator

func (*PathItemMutator) Parameter

func (m *PathItemMutator) Parameter(value Parameter) *PathItemMutator

Parameter appends a value to parameters

func (*PathItemMutator) Patch

func (*PathItemMutator) Post

func (*PathItemMutator) Put

func (*PathItemMutator) Trace

type PathItemVisitor

type PathItemVisitor interface {
	VisitPathItem(context.Context, PathItem) error
}

PathItemVisitor is an interface for objects that knows how to process PathItem elements while traversing the OpenAPI structure

type Paths

type Paths interface {
	Paths() *PathItemMapIterator
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Paths
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type PathsBuilder

type PathsBuilder struct {
	// contains filtered or unexported fields
}

PathsBuilder is used to build an instance of Paths. The user must call `Build()` after providing all the necessary information to build an instance of Paths. Builders may NOT be reused. It must be created for every instance of Paths that you want to create

func NewPaths

func NewPaths(options ...Option) *PathsBuilder

NewPaths creates a new builder object for Paths

func (*PathsBuilder) Build

func (b *PathsBuilder) Build(options ...Option) (Paths, error)

Build finalizes the building process for Paths and returns the result By default, Build() will validate if the given structure is valid

func (*PathsBuilder) Extension

func (b *PathsBuilder) Extension(name string, value interface{}) *PathsBuilder

Extension sets an arbitrary element (an extension) to the object Paths. The extension name should start with a "x-"

func (*PathsBuilder) MustBuild

func (b *PathsBuilder) MustBuild(options ...Option) Paths

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*PathsBuilder) Path

func (b *PathsBuilder) Path(path string, item PathItem) *PathsBuilder

Path sets the path item for path `path` to `item`

func (*PathsBuilder) Paths

func (b *PathsBuilder) Paths(v PathItemMap) *PathsBuilder

Paths sets the paths field for object Paths.

func (*PathsBuilder) Reference

func (b *PathsBuilder) Reference(v string) *PathsBuilder

Reference sets the $ref (reference) field for object Paths.

type PathsMutator

type PathsMutator struct {
	// contains filtered or unexported fields
}

PathsMutator is used to build an instance of Paths. The user must call `Apply()` after providing all the necessary information to the new instance of Paths with new values

func MutatePaths

func MutatePaths(v Paths, options ...Option) *PathsMutator

MutatePaths creates a new mutator object for Paths Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*PathsMutator) Apply

func (m *PathsMutator) Apply() error

Apply finalizes the matuation process for Paths and returns the result

func (*PathsMutator) Extension

func (m *PathsMutator) Extension(name string, value interface{}) *PathsMutator

Extension sets an arbitrary extension field in Paths

func (*PathsMutator) Path

func (m *PathsMutator) Path(path string, item PathItem) *PathsMutator

Path sets the path item for path `path` to `item`

type PathsVisitor

type PathsVisitor interface {
	VisitPaths(context.Context, Paths) error
}

PathsVisitor is an interface for objects that knows how to process Paths elements while traversing the OpenAPI structure

type PrimitiveType

type PrimitiveType string
const (
	Invalid PrimitiveType = "invalid"
	Integer PrimitiveType = "integer"
	Number  PrimitiveType = "number"
	String  PrimitiveType = "string"
	Boolean PrimitiveType = "boolean"
	Object  PrimitiveType = "object"
	Array   PrimitiveType = "array"
	File    PrimitiveType = "file"
	Null    PrimitiveType = "null"
)

func GuessSchemaType

func GuessSchemaType(s Schema) PrimitiveType

GuessSchemaType returns the type declared in the Schema, or if not present, attempts to guess by the presence of certain fields. In case it can't determine the type, return Invalid

func (PrimitiveType) IsValid

func (p PrimitiveType) IsValid() bool

type QueryJSONer

type QueryJSONer interface {
	QueryJSON(string) (interface{}, bool)
}

type ResolveError

type ResolveError interface {
	Fatal() bool
}

ResolveError is returned when Resolver fails to resolve a reference (`$ref`)

type Resolver

type Resolver interface {
	// Resolves a JSON reference. In very rare occasions where
	// you do not want to actually resolve the value but allow
	// processing to continue, you may return an error value
	// that implements ResolveError and return false for the
	// `Fatal` method.
	Resolve(string) (interface{}, error)
}

Resolver resolves JSON references (`$ref`)

func NewResolver

func NewResolver(ctx Swagger) Resolver

type Response

type Response interface {
	Name() string
	StatusCode() string
	Description() string
	Schema() Schema
	Headers() *HeaderMapIterator
	Examples() *ExampleMapIterator
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Response
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
	// contains filtered or unexported methods
}

type ResponseBuilder

type ResponseBuilder struct {
	// contains filtered or unexported fields
}

ResponseBuilder is used to build an instance of Response. The user must call `Build()` after providing all the necessary information to build an instance of Response. Builders may NOT be reused. It must be created for every instance of Response that you want to create

func NewResponse

func NewResponse(description string, options ...Option) *ResponseBuilder

NewResponse creates a new builder object for Response

func (*ResponseBuilder) Build

func (b *ResponseBuilder) Build(options ...Option) (Response, error)

Build finalizes the building process for Response and returns the result By default, Build() will validate if the given structure is valid

func (*ResponseBuilder) Examples

func (b *ResponseBuilder) Examples(v ExampleMap) *ResponseBuilder

Examples sets the examples field for object Response.

func (*ResponseBuilder) Extension

func (b *ResponseBuilder) Extension(name string, value interface{}) *ResponseBuilder

Extension sets an arbitrary element (an extension) to the object Response. The extension name should start with a "x-"

func (*ResponseBuilder) Headers

func (b *ResponseBuilder) Headers(v HeaderMap) *ResponseBuilder

Headers sets the headers field for object Response.

func (*ResponseBuilder) MustBuild

func (b *ResponseBuilder) MustBuild(options ...Option) Response

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*ResponseBuilder) Name

Name sets the name field for object Response.

func (*ResponseBuilder) Reference

func (b *ResponseBuilder) Reference(v string) *ResponseBuilder

Reference sets the $ref (reference) field for object Response.

func (*ResponseBuilder) Schema

func (b *ResponseBuilder) Schema(v Schema) *ResponseBuilder

Schema sets the schema field for object Response.

func (*ResponseBuilder) StatusCode

func (b *ResponseBuilder) StatusCode(v string) *ResponseBuilder

StatusCode sets the statusCode field for object Response.

type ResponseMap

type ResponseMap map[ResponseMapKey]Response

func (*ResponseMap) Clear

func (v *ResponseMap) Clear() error

Clear removes all elements from ResponseMap

func (ResponseMap) QueryJSON

func (v ResponseMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*ResponseMap) UnmarshalJSON

func (v *ResponseMap) UnmarshalJSON(data []byte) error

UnmarshalJSON takes a JSON buffer and properly populates `v`

func (*ResponseMap) Validate

func (v *ResponseMap) Validate(recurse bool) error

Validate checks the correctness of values in ResponseMap

type ResponseMapIterator

type ResponseMapIterator struct {
	// contains filtered or unexported fields
}

func (*ResponseMapIterator) Item

func (iter *ResponseMapIterator) Item() (string, Response)

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*ResponseMapIterator) Next

func (iter *ResponseMapIterator) Next() bool

func (*ResponseMapIterator) Size

func (iter *ResponseMapIterator) Size() int

type ResponseMapKey

type ResponseMapKey = string

type ResponseMutator

type ResponseMutator struct {
	// contains filtered or unexported fields
}

ResponseMutator is used to build an instance of Response. The user must call `Apply()` after providing all the necessary information to the new instance of Response with new values

func MutateResponse

func MutateResponse(v Response, options ...Option) *ResponseMutator

MutateResponse creates a new mutator object for Response Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*ResponseMutator) Apply

func (m *ResponseMutator) Apply() error

Apply finalizes the matuation process for Response and returns the result

func (*ResponseMutator) ClearExamples

func (m *ResponseMutator) ClearExamples() *ResponseMutator

ClearExamples removes all values in examples field

func (*ResponseMutator) ClearHeaders

func (m *ResponseMutator) ClearHeaders() *ResponseMutator

ClearHeaders removes all values in headers field

func (*ResponseMutator) Description

func (m *ResponseMutator) Description(v string) *ResponseMutator

Description sets the Description field for object Response.

func (*ResponseMutator) Example

func (m *ResponseMutator) Example(key ExampleMapKey, value interface{}) *ResponseMutator

Example sets the value of examples

func (*ResponseMutator) Extension

func (m *ResponseMutator) Extension(name string, value interface{}) *ResponseMutator

Extension sets an arbitrary extension field in Response

func (*ResponseMutator) Header

func (m *ResponseMutator) Header(key HeaderMapKey, value Header) *ResponseMutator

Header sets the value of headers

func (*ResponseMutator) Name

Name sets the Name field for object Response.

func (*ResponseMutator) Schema

func (m *ResponseMutator) Schema(v Schema) *ResponseMutator

Schema sets the Schema field for object Response.

func (*ResponseMutator) StatusCode

func (m *ResponseMutator) StatusCode(v string) *ResponseMutator

StatusCode sets the StatusCode field for object Response.

type ResponseVisitor

type ResponseVisitor interface {
	VisitResponse(context.Context, Response) error
}

ResponseVisitor is an interface for objects that knows how to process Response elements while traversing the OpenAPI structure

type Responses

type Responses interface {
	Default() Response
	Responses() *ResponseMapIterator
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Responses
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type ResponsesBuilder

type ResponsesBuilder struct {
	// contains filtered or unexported fields
}

ResponsesBuilder is used to build an instance of Responses. The user must call `Build()` after providing all the necessary information to build an instance of Responses. Builders may NOT be reused. It must be created for every instance of Responses that you want to create

func NewResponses

func NewResponses(options ...Option) *ResponsesBuilder

NewResponses creates a new builder object for Responses

func (*ResponsesBuilder) Build

func (b *ResponsesBuilder) Build(options ...Option) (Responses, error)

Build finalizes the building process for Responses and returns the result By default, Build() will validate if the given structure is valid

func (*ResponsesBuilder) Default

Default sets the defaultValue field for object Responses.

func (*ResponsesBuilder) Extension

func (b *ResponsesBuilder) Extension(name string, value interface{}) *ResponsesBuilder

Extension sets an arbitrary element (an extension) to the object Responses. The extension name should start with a "x-"

func (*ResponsesBuilder) MustBuild

func (b *ResponsesBuilder) MustBuild(options ...Option) Responses

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*ResponsesBuilder) Reference

func (b *ResponsesBuilder) Reference(v string) *ResponsesBuilder

Reference sets the $ref (reference) field for object Responses.

func (*ResponsesBuilder) Response

func (b *ResponsesBuilder) Response(code string, v Response) *ResponsesBuilder

Response sets the response for status code `code` to `v`

func (*ResponsesBuilder) Responses

Responses sets the responses field for object Responses.

type ResponsesMutator

type ResponsesMutator struct {
	// contains filtered or unexported fields
}

ResponsesMutator is used to build an instance of Responses. The user must call `Apply()` after providing all the necessary information to the new instance of Responses with new values

func MutateResponses

func MutateResponses(v Responses, options ...Option) *ResponsesMutator

MutateResponses creates a new mutator object for Responses Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*ResponsesMutator) Apply

func (m *ResponsesMutator) Apply() error

Apply finalizes the matuation process for Responses and returns the result

func (*ResponsesMutator) Default

Default sets the Default field for object Responses.

func (*ResponsesMutator) Extension

func (m *ResponsesMutator) Extension(name string, value interface{}) *ResponsesMutator

Extension sets an arbitrary extension field in Responses

func (*ResponsesMutator) Response

func (m *ResponsesMutator) Response(key ResponseMapKey, value Response) *ResponsesMutator

type ResponsesVisitor

type ResponsesVisitor interface {
	VisitResponses(context.Context, Responses) error
}

ResponsesVisitor is an interface for objects that knows how to process Responses elements while traversing the OpenAPI structure

type Schema

type Schema interface {
	Name() string
	Type() PrimitiveType
	Format() string
	Title() string
	HasMultipleOf() bool
	MultipleOf() float64
	HasMaximum() bool
	Maximum() float64
	HasExclusiveMaximum() bool
	ExclusiveMaximum() float64
	HasMinimum() bool
	Minimum() float64
	HasExclusiveMinimum() bool
	ExclusiveMinimum() float64
	HasMaxLength() bool
	MaxLength() int
	HasMinLength() bool
	MinLength() int
	Pattern() string
	HasMaxItems() bool
	MaxItems() int
	HasMinItems() bool
	MinItems() int
	HasUniqueItems() bool
	UniqueItems() bool
	HasMaxProperties() bool
	MaxProperties() int
	HasMinProperties() bool
	MinProperties() int
	Required() *StringListIterator
	Enum() *InterfaceListIterator
	AllOf() *SchemaListIterator
	Items() Schema
	Properties() *SchemaMapIterator
	AdditionaProperties() *SchemaMapIterator
	Default() interface{}
	Discriminator() string
	ReadOnly() bool
	ExternalDocs() ExternalDocumentation
	Example() interface{}
	Deprecated() bool
	XML() XML
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Schema
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
	IsRequiredProperty(string) bool
	IsValid() bool
	SchemaConverter
}

func MergeSchemas

func MergeSchemas(left, right Schema) (Schema, error)

Merges two schemas, and creates a new one.

Schemas that have JSON references are not supported.

Only objects and arrays are supported. Both of the specified schemas must be of the same primitive type.

If there are ambiquities such as duplicate fields defined in both schemas, it returns an error.

The resulting schema is always unnamed.

func MergedSchema

func MergedSchema(s Schema, r Resolver) (Schema, error)

MergedSchema is a utility function to automatically return a merged schema in presence of 'allOf' element. If it does not exist, returns the given schema unchanged.

This function requires an external resolver, as it may be the case that we may need to resolve definitions

type SchemaBuilder

type SchemaBuilder struct {
	// contains filtered or unexported fields
}

SchemaBuilder is used to build an instance of Schema. The user must call `Build()` after providing all the necessary information to build an instance of Schema. Builders may NOT be reused. It must be created for every instance of Schema that you want to create

func NewSchema

func NewSchema(options ...Option) *SchemaBuilder

NewSchema creates a new builder object for Schema

func (*SchemaBuilder) AdditionaProperties

func (b *SchemaBuilder) AdditionaProperties(v SchemaMap) *SchemaBuilder

AdditionaProperties sets the additionaProperties field for object Schema.

func (*SchemaBuilder) AllOf

func (b *SchemaBuilder) AllOf(v ...Schema) *SchemaBuilder

AllOf sets the allOf field for object Schema.

func (*SchemaBuilder) Build

func (b *SchemaBuilder) Build(options ...Option) (Schema, error)

Build finalizes the building process for Schema and returns the result By default, Build() will validate if the given structure is valid

func (*SchemaBuilder) Default

func (b *SchemaBuilder) Default(v interface{}) *SchemaBuilder

Default sets the defaultValue field for object Schema.

func (*SchemaBuilder) Deprecated

func (b *SchemaBuilder) Deprecated(v bool) *SchemaBuilder

Deprecated sets the deprecated field for object Schema.

func (*SchemaBuilder) Discriminator

func (b *SchemaBuilder) Discriminator(v string) *SchemaBuilder

Discriminator sets the discriminator field for object Schema.

func (*SchemaBuilder) Enum

func (b *SchemaBuilder) Enum(v ...interface{}) *SchemaBuilder

Enum sets the enum field for object Schema.

func (*SchemaBuilder) Example

func (b *SchemaBuilder) Example(v interface{}) *SchemaBuilder

Example sets the example field for object Schema.

func (*SchemaBuilder) ExclusiveMaximum

func (b *SchemaBuilder) ExclusiveMaximum(v float64) *SchemaBuilder

ExclusiveMaximum sets the exclusiveMaximum field for object Schema.

func (*SchemaBuilder) ExclusiveMinimum

func (b *SchemaBuilder) ExclusiveMinimum(v float64) *SchemaBuilder

ExclusiveMinimum sets the exclusiveMinimum field for object Schema.

func (*SchemaBuilder) Extension

func (b *SchemaBuilder) Extension(name string, value interface{}) *SchemaBuilder

Extension sets an arbitrary element (an extension) to the object Schema. The extension name should start with a "x-"

func (*SchemaBuilder) ExternalDocs

ExternalDocs sets the externalDocs field for object Schema.

func (*SchemaBuilder) Format

func (b *SchemaBuilder) Format(v string) *SchemaBuilder

Format sets the format field for object Schema.

func (*SchemaBuilder) Items

func (b *SchemaBuilder) Items(v Schema) *SchemaBuilder

Items sets the items field for object Schema.

func (*SchemaBuilder) MaxItems

func (b *SchemaBuilder) MaxItems(v int) *SchemaBuilder

MaxItems sets the maxItems field for object Schema.

func (*SchemaBuilder) MaxLength

func (b *SchemaBuilder) MaxLength(v int) *SchemaBuilder

MaxLength sets the maxLength field for object Schema.

func (*SchemaBuilder) MaxProperties

func (b *SchemaBuilder) MaxProperties(v int) *SchemaBuilder

MaxProperties sets the maxProperties field for object Schema.

func (*SchemaBuilder) Maximum

func (b *SchemaBuilder) Maximum(v float64) *SchemaBuilder

Maximum sets the maximum field for object Schema.

func (*SchemaBuilder) MinItems

func (b *SchemaBuilder) MinItems(v int) *SchemaBuilder

MinItems sets the minItems field for object Schema.

func (*SchemaBuilder) MinLength

func (b *SchemaBuilder) MinLength(v int) *SchemaBuilder

MinLength sets the minLength field for object Schema.

func (*SchemaBuilder) MinProperties

func (b *SchemaBuilder) MinProperties(v int) *SchemaBuilder

MinProperties sets the minProperties field for object Schema.

func (*SchemaBuilder) Minimum

func (b *SchemaBuilder) Minimum(v float64) *SchemaBuilder

Minimum sets the minimum field for object Schema.

func (*SchemaBuilder) MultipleOf

func (b *SchemaBuilder) MultipleOf(v float64) *SchemaBuilder

MultipleOf sets the multipleOf field for object Schema.

func (*SchemaBuilder) MustBuild

func (b *SchemaBuilder) MustBuild(options ...Option) Schema

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*SchemaBuilder) Pattern

func (b *SchemaBuilder) Pattern(v string) *SchemaBuilder

Pattern sets the pattern field for object Schema.

func (*SchemaBuilder) Property

func (b *SchemaBuilder) Property(name string, prop Schema) *SchemaBuilder

func (*SchemaBuilder) ReadOnly

func (b *SchemaBuilder) ReadOnly(v bool) *SchemaBuilder

ReadOnly sets the readOnly field for object Schema.

func (*SchemaBuilder) Reference

func (b *SchemaBuilder) Reference(v string) *SchemaBuilder

Reference sets the $ref (reference) field for object Schema.

func (*SchemaBuilder) Required

func (b *SchemaBuilder) Required(v ...string) *SchemaBuilder

Required sets the required field for object Schema.

func (*SchemaBuilder) Title

func (b *SchemaBuilder) Title(v string) *SchemaBuilder

Title sets the title field for object Schema.

func (*SchemaBuilder) Type

Type sets the typ field for object Schema.

func (*SchemaBuilder) UniqueItems

func (b *SchemaBuilder) UniqueItems(v bool) *SchemaBuilder

UniqueItems sets the uniqueItems field for object Schema.

func (*SchemaBuilder) XML

func (b *SchemaBuilder) XML(v XML) *SchemaBuilder

XML sets the xml field for object Schema.

type SchemaConverter

type SchemaConverter interface {
	ConvertToSchema() (Schema, error)
}

SchemaConverter is available for those types which resemble a Schema object, such as Parameter and Items. The resulting Schema will not be 100% compatible as the original object as available fields differ slightly, but should be close enough to be used interchangeably.

type SchemaList

type SchemaList []Schema

func (*SchemaList) Clear

func (v *SchemaList) Clear() error

Clear removes all values from SchemaList

func (*SchemaList) UnmarshalJSON

func (v *SchemaList) UnmarshalJSON(data []byte) error

UnmarshalJSON defines how SchemaList is deserialized from JSON

func (*SchemaList) Validate

func (v *SchemaList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type SchemaListIterator

type SchemaListIterator struct {
	// contains filtered or unexported fields
}

func (*SchemaListIterator) Item

func (iter *SchemaListIterator) Item() Schema

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*SchemaListIterator) Next

func (iter *SchemaListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*SchemaListIterator) Size

func (iter *SchemaListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type SchemaMap

type SchemaMap map[SchemaMapKey]Schema

func (*SchemaMap) Clear

func (v *SchemaMap) Clear() error

Clear removes all elements from SchemaMap

func (SchemaMap) QueryJSON

func (v SchemaMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*SchemaMap) UnmarshalJSON

func (v *SchemaMap) UnmarshalJSON(data []byte) error

UnmarshalJSON takes a JSON buffer and properly populates `v`

func (*SchemaMap) Validate

func (v *SchemaMap) Validate(recurse bool) error

Validate checks the correctness of values in SchemaMap

type SchemaMapIterator

type SchemaMapIterator struct {
	// contains filtered or unexported fields
}

func (*SchemaMapIterator) Item

func (iter *SchemaMapIterator) Item() (string, Schema)

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*SchemaMapIterator) Next

func (iter *SchemaMapIterator) Next() bool

func (*SchemaMapIterator) Size

func (iter *SchemaMapIterator) Size() int

type SchemaMapKey

type SchemaMapKey = string

type SchemaMutator

type SchemaMutator struct {
	// contains filtered or unexported fields
}

SchemaMutator is used to build an instance of Schema. The user must call `Apply()` after providing all the necessary information to the new instance of Schema with new values

func MutateSchema

func MutateSchema(v Schema, options ...Option) *SchemaMutator

MutateSchema creates a new mutator object for Schema Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*SchemaMutator) AdditionaProperty

func (m *SchemaMutator) AdditionaProperty(key SchemaMapKey, value Schema) *SchemaMutator

AdditionaProperty sets the value of additionaProperties

func (*SchemaMutator) AllOf

func (m *SchemaMutator) AllOf(value Schema) *SchemaMutator

AllOf appends a value to allOf

func (*SchemaMutator) Apply

func (m *SchemaMutator) Apply() error

Apply finalizes the matuation process for Schema and returns the result

func (*SchemaMutator) ClearAdditionaProperties

func (m *SchemaMutator) ClearAdditionaProperties() *SchemaMutator

ClearAdditionaProperties removes all values in additionaProperties field

func (*SchemaMutator) ClearAllOf

func (m *SchemaMutator) ClearAllOf() *SchemaMutator

ClearAllOf clears all elements in allOf

func (*SchemaMutator) ClearEnum

func (m *SchemaMutator) ClearEnum() *SchemaMutator

ClearEnum clears all elements in enum

func (*SchemaMutator) ClearExclusiveMaximum

func (m *SchemaMutator) ClearExclusiveMaximum() *SchemaMutator

ClearExclusiveMaximum clears the exclusiveMaximum field

func (*SchemaMutator) ClearExclusiveMinimum

func (m *SchemaMutator) ClearExclusiveMinimum() *SchemaMutator

ClearExclusiveMinimum clears the exclusiveMinimum field

func (*SchemaMutator) ClearMaxItems

func (m *SchemaMutator) ClearMaxItems() *SchemaMutator

ClearMaxItems clears the maxItems field

func (*SchemaMutator) ClearMaxLength

func (m *SchemaMutator) ClearMaxLength() *SchemaMutator

ClearMaxLength clears the maxLength field

func (*SchemaMutator) ClearMaxProperties

func (m *SchemaMutator) ClearMaxProperties() *SchemaMutator

ClearMaxProperties clears the maxProperties field

func (*SchemaMutator) ClearMaximum

func (m *SchemaMutator) ClearMaximum() *SchemaMutator

ClearMaximum clears the maximum field

func (*SchemaMutator) ClearMinItems

func (m *SchemaMutator) ClearMinItems() *SchemaMutator

ClearMinItems clears the minItems field

func (*SchemaMutator) ClearMinLength

func (m *SchemaMutator) ClearMinLength() *SchemaMutator

ClearMinLength clears the minLength field

func (*SchemaMutator) ClearMinProperties

func (m *SchemaMutator) ClearMinProperties() *SchemaMutator

ClearMinProperties clears the minProperties field

func (*SchemaMutator) ClearMinimum

func (m *SchemaMutator) ClearMinimum() *SchemaMutator

ClearMinimum clears the minimum field

func (*SchemaMutator) ClearMultipleOf

func (m *SchemaMutator) ClearMultipleOf() *SchemaMutator

ClearMultipleOf clears the multipleOf field

func (*SchemaMutator) ClearProperties

func (m *SchemaMutator) ClearProperties() *SchemaMutator

ClearProperties removes all values in properties field

func (*SchemaMutator) ClearRequired

func (m *SchemaMutator) ClearRequired() *SchemaMutator

ClearRequired clears all elements in required

func (*SchemaMutator) ClearUniqueItems

func (m *SchemaMutator) ClearUniqueItems() *SchemaMutator

ClearUniqueItems clears the uniqueItems field

func (*SchemaMutator) Default

func (m *SchemaMutator) Default(v interface{}) *SchemaMutator

Default sets the Default field for object Schema.

func (*SchemaMutator) Deprecated

func (m *SchemaMutator) Deprecated(v bool) *SchemaMutator

Deprecated sets the Deprecated field for object Schema.

func (*SchemaMutator) Discriminator

func (m *SchemaMutator) Discriminator(v string) *SchemaMutator

Discriminator sets the Discriminator field for object Schema.

func (*SchemaMutator) Enum

func (m *SchemaMutator) Enum(value interface{}) *SchemaMutator

Enum appends a value to enum

func (*SchemaMutator) Example

func (m *SchemaMutator) Example(v interface{}) *SchemaMutator

Example sets the Example field for object Schema.

func (*SchemaMutator) ExclusiveMaximum

func (m *SchemaMutator) ExclusiveMaximum(v float64) *SchemaMutator

ExclusiveMaximum sets the exclusiveMaximum field.

func (*SchemaMutator) ExclusiveMinimum

func (m *SchemaMutator) ExclusiveMinimum(v float64) *SchemaMutator

ExclusiveMinimum sets the exclusiveMinimum field.

func (*SchemaMutator) Extension

func (m *SchemaMutator) Extension(name string, value interface{}) *SchemaMutator

Extension sets an arbitrary extension field in Schema

func (*SchemaMutator) ExternalDocs

ExternalDocs sets the ExternalDocs field for object Schema.

func (*SchemaMutator) Format

func (m *SchemaMutator) Format(v string) *SchemaMutator

Format sets the Format field for object Schema.

func (*SchemaMutator) Items

func (m *SchemaMutator) Items(v Schema) *SchemaMutator

Items sets the Items field for object Schema.

func (*SchemaMutator) MaxItems

func (m *SchemaMutator) MaxItems(v int) *SchemaMutator

MaxItems sets the maxItems field.

func (*SchemaMutator) MaxLength

func (m *SchemaMutator) MaxLength(v int) *SchemaMutator

MaxLength sets the maxLength field.

func (*SchemaMutator) MaxProperties

func (m *SchemaMutator) MaxProperties(v int) *SchemaMutator

MaxProperties sets the maxProperties field.

func (*SchemaMutator) Maximum

func (m *SchemaMutator) Maximum(v float64) *SchemaMutator

Maximum sets the maximum field.

func (*SchemaMutator) MinItems

func (m *SchemaMutator) MinItems(v int) *SchemaMutator

MinItems sets the minItems field.

func (*SchemaMutator) MinLength

func (m *SchemaMutator) MinLength(v int) *SchemaMutator

MinLength sets the minLength field.

func (*SchemaMutator) MinProperties

func (m *SchemaMutator) MinProperties(v int) *SchemaMutator

MinProperties sets the minProperties field.

func (*SchemaMutator) Minimum

func (m *SchemaMutator) Minimum(v float64) *SchemaMutator

Minimum sets the minimum field.

func (*SchemaMutator) MultipleOf

func (m *SchemaMutator) MultipleOf(v float64) *SchemaMutator

MultipleOf sets the multipleOf field.

func (*SchemaMutator) Name

func (m *SchemaMutator) Name(v string) *SchemaMutator

Name sets the Name field for object Schema.

func (*SchemaMutator) Pattern

func (m *SchemaMutator) Pattern(v string) *SchemaMutator

Pattern sets the Pattern field for object Schema.

func (*SchemaMutator) Property

func (m *SchemaMutator) Property(key SchemaMapKey, value Schema) *SchemaMutator

Property sets the value of properties

func (*SchemaMutator) ReadOnly

func (m *SchemaMutator) ReadOnly(v bool) *SchemaMutator

ReadOnly sets the ReadOnly field for object Schema.

func (*SchemaMutator) Required

func (m *SchemaMutator) Required(value string) *SchemaMutator

Required appends a value to required

func (*SchemaMutator) Title

func (m *SchemaMutator) Title(v string) *SchemaMutator

Title sets the Title field for object Schema.

func (*SchemaMutator) Type

Type sets the Type field for object Schema.

func (*SchemaMutator) UniqueItems

func (m *SchemaMutator) UniqueItems(v bool) *SchemaMutator

UniqueItems sets the uniqueItems field.

func (*SchemaMutator) XML

func (m *SchemaMutator) XML(v XML) *SchemaMutator

XML sets the XML field for object Schema.

type SchemaVisitor

type SchemaVisitor interface {
	VisitSchema(context.Context, Schema) error
}

SchemaVisitor is an interface for objects that knows how to process Schema elements while traversing the OpenAPI structure

type Scheme

type Scheme = string

type SchemeList

type SchemeList []string

func (*SchemeList) Clear

func (v *SchemeList) Clear() error

Clear removes all values from SchemeList

func (*SchemeList) Validate

func (v *SchemeList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type SchemeListIterator

type SchemeListIterator struct {
	// contains filtered or unexported fields
}

func (*SchemeListIterator) Item

func (iter *SchemeListIterator) Item() Scheme

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*SchemeListIterator) Next

func (iter *SchemeListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*SchemeListIterator) Size

func (iter *SchemeListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type ScopesMap

type ScopesMap map[ScopesMapKey][]string

func (*ScopesMap) Clear

func (v *ScopesMap) Clear() error

Clear removes all elements from ScopesMap

func (ScopesMap) QueryJSON

func (v ScopesMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*ScopesMap) Validate

func (v *ScopesMap) Validate(recurse bool) error

Validate checks the correctness of values in ScopesMap

type ScopesMapIterator

type ScopesMapIterator struct {
	// contains filtered or unexported fields
}

func (*ScopesMapIterator) Item

func (iter *ScopesMapIterator) Item() (string, []string)

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*ScopesMapIterator) Next

func (iter *ScopesMapIterator) Next() bool

func (*ScopesMapIterator) Size

func (iter *ScopesMapIterator) Size() int

type ScopesMapKey

type ScopesMapKey = string

type SecurityRequirement

type SecurityRequirement interface {
	Name() string
	Scopes() *ScopesMapIterator
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() SecurityRequirement
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type SecurityRequirementBuilder

type SecurityRequirementBuilder struct {
	// contains filtered or unexported fields
}

SecurityRequirementBuilder is used to build an instance of SecurityRequirement. The user must call `Build()` after providing all the necessary information to build an instance of SecurityRequirement. Builders may NOT be reused. It must be created for every instance of SecurityRequirement that you want to create

func NewSecurityRequirement

func NewSecurityRequirement(options ...Option) *SecurityRequirementBuilder

NewSecurityRequirement creates a new builder object for SecurityRequirement

func (*SecurityRequirementBuilder) Build

Build finalizes the building process for SecurityRequirement and returns the result By default, Build() will validate if the given structure is valid

func (*SecurityRequirementBuilder) Extension

func (b *SecurityRequirementBuilder) Extension(name string, value interface{}) *SecurityRequirementBuilder

Extension sets an arbitrary element (an extension) to the object SecurityRequirement. The extension name should start with a "x-"

func (*SecurityRequirementBuilder) MustBuild

func (b *SecurityRequirementBuilder) MustBuild(options ...Option) SecurityRequirement

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*SecurityRequirementBuilder) Name

Name sets the name field for object SecurityRequirement.

func (*SecurityRequirementBuilder) Reference

Reference sets the $ref (reference) field for object SecurityRequirement.

type SecurityRequirementList

type SecurityRequirementList []SecurityRequirement

func (*SecurityRequirementList) Clear

func (v *SecurityRequirementList) Clear() error

Clear removes all values from SecurityRequirementList

func (*SecurityRequirementList) UnmarshalJSON

func (v *SecurityRequirementList) UnmarshalJSON(data []byte) error

UnmarshalJSON defines how SecurityRequirementList is deserialized from JSON

func (*SecurityRequirementList) Validate

func (v *SecurityRequirementList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type SecurityRequirementListIterator

type SecurityRequirementListIterator struct {
	// contains filtered or unexported fields
}

func (*SecurityRequirementListIterator) Item

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*SecurityRequirementListIterator) Next

func (iter *SecurityRequirementListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*SecurityRequirementListIterator) Size

func (iter *SecurityRequirementListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type SecurityRequirementMutator

type SecurityRequirementMutator struct {
	// contains filtered or unexported fields
}

SecurityRequirementMutator is used to build an instance of SecurityRequirement. The user must call `Apply()` after providing all the necessary information to the new instance of SecurityRequirement with new values

func MutateSecurityRequirement

func MutateSecurityRequirement(v SecurityRequirement, options ...Option) *SecurityRequirementMutator

MutateSecurityRequirement creates a new mutator object for SecurityRequirement Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*SecurityRequirementMutator) Apply

func (m *SecurityRequirementMutator) Apply() error

Apply finalizes the matuation process for SecurityRequirement and returns the result

func (*SecurityRequirementMutator) Extension

func (m *SecurityRequirementMutator) Extension(name string, value interface{}) *SecurityRequirementMutator

Extension sets an arbitrary extension field in SecurityRequirement

func (*SecurityRequirementMutator) Name

Name sets the Name field for object SecurityRequirement.

type SecurityRequirementVisitor

type SecurityRequirementVisitor interface {
	VisitSecurityRequirement(context.Context, SecurityRequirement) error
}

SecurityRequirementVisitor is an interface for objects that knows how to process SecurityRequirement elements while traversing the OpenAPI structure

type SecurityScheme

type SecurityScheme interface {
	Type() string
	Description() string
	Name() string
	In() string
	Flow() string
	AuthorizationURL() string
	TokenURL() string
	Scopes() *StringMapIterator
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() SecurityScheme
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type SecuritySchemeBuilder

type SecuritySchemeBuilder struct {
	// contains filtered or unexported fields
}

SecuritySchemeBuilder is used to build an instance of SecurityScheme. The user must call `Build()` after providing all the necessary information to build an instance of SecurityScheme. Builders may NOT be reused. It must be created for every instance of SecurityScheme that you want to create

func NewSecurityScheme

func NewSecurityScheme(typ string, options ...Option) *SecuritySchemeBuilder

NewSecurityScheme creates a new builder object for SecurityScheme

func (*SecuritySchemeBuilder) AuthorizationURL

func (b *SecuritySchemeBuilder) AuthorizationURL(v string) *SecuritySchemeBuilder

AuthorizationURL sets the authorizationURL field for object SecurityScheme.

func (*SecuritySchemeBuilder) Build

func (b *SecuritySchemeBuilder) Build(options ...Option) (SecurityScheme, error)

Build finalizes the building process for SecurityScheme and returns the result By default, Build() will validate if the given structure is valid

func (*SecuritySchemeBuilder) Description

Description sets the description field for object SecurityScheme.

func (*SecuritySchemeBuilder) Extension

func (b *SecuritySchemeBuilder) Extension(name string, value interface{}) *SecuritySchemeBuilder

Extension sets an arbitrary element (an extension) to the object SecurityScheme. The extension name should start with a "x-"

func (*SecuritySchemeBuilder) Flow

Flow sets the flow field for object SecurityScheme.

func (*SecuritySchemeBuilder) In

In sets the in field for object SecurityScheme.

func (*SecuritySchemeBuilder) MustBuild

func (b *SecuritySchemeBuilder) MustBuild(options ...Option) SecurityScheme

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*SecuritySchemeBuilder) Name

Name sets the name field for object SecurityScheme.

func (*SecuritySchemeBuilder) Reference

Reference sets the $ref (reference) field for object SecurityScheme.

func (*SecuritySchemeBuilder) Scopes

Scopes sets the scopes field for object SecurityScheme.

func (*SecuritySchemeBuilder) TokenURL

TokenURL sets the tokenURL field for object SecurityScheme.

type SecuritySchemeMap

type SecuritySchemeMap map[SecuritySchemeMapKey]SecurityScheme

func (*SecuritySchemeMap) Clear

func (v *SecuritySchemeMap) Clear() error

Clear removes all elements from SecuritySchemeMap

func (SecuritySchemeMap) QueryJSON

func (v SecuritySchemeMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*SecuritySchemeMap) UnmarshalJSON

func (v *SecuritySchemeMap) UnmarshalJSON(data []byte) error

UnmarshalJSON takes a JSON buffer and properly populates `v`

func (*SecuritySchemeMap) Validate

func (v *SecuritySchemeMap) Validate(recurse bool) error

Validate checks the correctness of values in SecuritySchemeMap

type SecuritySchemeMapIterator

type SecuritySchemeMapIterator struct {
	// contains filtered or unexported fields
}

func (*SecuritySchemeMapIterator) Item

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*SecuritySchemeMapIterator) Next

func (iter *SecuritySchemeMapIterator) Next() bool

func (*SecuritySchemeMapIterator) Size

func (iter *SecuritySchemeMapIterator) Size() int

type SecuritySchemeMapKey

type SecuritySchemeMapKey = string

type SecuritySchemeMutator

type SecuritySchemeMutator struct {
	// contains filtered or unexported fields
}

SecuritySchemeMutator is used to build an instance of SecurityScheme. The user must call `Apply()` after providing all the necessary information to the new instance of SecurityScheme with new values

func MutateSecurityScheme

func MutateSecurityScheme(v SecurityScheme, options ...Option) *SecuritySchemeMutator

MutateSecurityScheme creates a new mutator object for SecurityScheme Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*SecuritySchemeMutator) Apply

func (m *SecuritySchemeMutator) Apply() error

Apply finalizes the matuation process for SecurityScheme and returns the result

func (*SecuritySchemeMutator) AuthorizationURL

func (m *SecuritySchemeMutator) AuthorizationURL(v string) *SecuritySchemeMutator

AuthorizationURL sets the AuthorizationURL field for object SecurityScheme.

func (*SecuritySchemeMutator) ClearScopes

func (m *SecuritySchemeMutator) ClearScopes() *SecuritySchemeMutator

ClearScopes removes all values in scopes field

func (*SecuritySchemeMutator) Description

Description sets the Description field for object SecurityScheme.

func (*SecuritySchemeMutator) Extension

func (m *SecuritySchemeMutator) Extension(name string, value interface{}) *SecuritySchemeMutator

Extension sets an arbitrary extension field in SecurityScheme

func (*SecuritySchemeMutator) Flow

Flow sets the Flow field for object SecurityScheme.

func (*SecuritySchemeMutator) In

In sets the In field for object SecurityScheme.

func (*SecuritySchemeMutator) Name

Name sets the Name field for object SecurityScheme.

func (*SecuritySchemeMutator) Scope

Scope sets the value of scopes

func (*SecuritySchemeMutator) TokenURL

TokenURL sets the TokenURL field for object SecurityScheme.

func (*SecuritySchemeMutator) Type

Type sets the Type field for object SecurityScheme.

type SecuritySchemeVisitor

type SecuritySchemeVisitor interface {
	VisitSecurityScheme(context.Context, SecurityScheme) error
}

SecuritySchemeVisitor is an interface for objects that knows how to process SecurityScheme elements while traversing the OpenAPI structure

type SliceQueryJSON

type SliceQueryJSON []interface{}

type StringList

type StringList []string

func (*StringList) Clear

func (v *StringList) Clear() error

Clear removes all values from StringList

func (*StringList) Validate

func (v *StringList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type StringListIterator

type StringListIterator struct {
	// contains filtered or unexported fields
}

func (*StringListIterator) Item

func (iter *StringListIterator) Item() string

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*StringListIterator) Next

func (iter *StringListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*StringListIterator) Size

func (iter *StringListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type StringListListIterator

type StringListListIterator struct {
	// contains filtered or unexported fields
}

func (*StringListListIterator) Item

func (iter *StringListListIterator) Item() []string

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*StringListListIterator) Next

func (iter *StringListListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*StringListListIterator) Size

func (iter *StringListListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type StringMap

type StringMap map[StringMapKey]string

func (*StringMap) Clear

func (v *StringMap) Clear() error

Clear removes all elements from StringMap

func (StringMap) QueryJSON

func (v StringMap) QueryJSON(path string) (ret interface{}, ok bool)

QueryJSON is used to query an element within the document Using jsonref

func (*StringMap) Validate

func (v *StringMap) Validate(recurse bool) error

Validate checks the correctness of values in StringMap

type StringMapIterator

type StringMapIterator struct {
	// contains filtered or unexported fields
}

func (*StringMapIterator) Item

func (iter *StringMapIterator) Item() (string, string)

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*StringMapIterator) Next

func (iter *StringMapIterator) Next() bool

func (*StringMapIterator) Size

func (iter *StringMapIterator) Size() int

type StringMapKey

type StringMapKey = string

type Swagger

type Swagger interface {
	Version() string
	Info() Info
	Host() string
	BasePath() string
	Schemes() *SchemeListIterator
	Consumes() *MIMETypeListIterator
	Produces() *MIMETypeListIterator
	Paths() Paths
	Definitions() *InterfaceMapIterator
	Parameters() *ParameterMapIterator
	Responses() *ResponseMapIterator
	SecurityDefinitions() *SecuritySchemeMapIterator
	Security() *SecurityRequirementListIterator
	Tags() *TagListIterator
	ExternalDocs() ExternalDocumentation
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Swagger
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
	QueryJSON(string) (interface{}, bool)
}

func ParseJSON

func ParseJSON(src io.Reader, options ...Option) (Swagger, error)

func ParseYAML

func ParseYAML(src io.Reader, options ...Option) (Swagger, error)

type SwaggerBuilder

type SwaggerBuilder struct {
	// contains filtered or unexported fields
}

SwaggerBuilder is used to build an instance of Swagger. The user must call `Build()` after providing all the necessary information to build an instance of Swagger. Builders may NOT be reused. It must be created for every instance of Swagger that you want to create

func NewSwagger

func NewSwagger(info Info, paths Paths, options ...Option) *SwaggerBuilder

NewSwagger creates a new builder object for Swagger

func (*SwaggerBuilder) BasePath

func (b *SwaggerBuilder) BasePath(v string) *SwaggerBuilder

BasePath sets the basePath field for object Swagger.

func (*SwaggerBuilder) Build

func (b *SwaggerBuilder) Build(options ...Option) (Swagger, error)

Build finalizes the building process for Swagger and returns the result By default, Build() will validate if the given structure is valid

func (*SwaggerBuilder) Consumes

func (b *SwaggerBuilder) Consumes(v ...MIMEType) *SwaggerBuilder

Consumes sets the consumes field for object Swagger.

func (*SwaggerBuilder) Definitions

func (b *SwaggerBuilder) Definitions(v InterfaceMap) *SwaggerBuilder

Definitions sets the definitions field for object Swagger.

func (*SwaggerBuilder) Extension

func (b *SwaggerBuilder) Extension(name string, value interface{}) *SwaggerBuilder

Extension sets an arbitrary element (an extension) to the object Swagger. The extension name should start with a "x-"

func (*SwaggerBuilder) ExternalDocs

ExternalDocs sets the externalDocs field for object Swagger.

func (*SwaggerBuilder) Host

func (b *SwaggerBuilder) Host(v string) *SwaggerBuilder

Host sets the host field for object Swagger.

func (*SwaggerBuilder) MustBuild

func (b *SwaggerBuilder) MustBuild(options ...Option) Swagger

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*SwaggerBuilder) Parameters

func (b *SwaggerBuilder) Parameters(v ParameterMap) *SwaggerBuilder

Parameters sets the parameters field for object Swagger.

func (*SwaggerBuilder) Produces

func (b *SwaggerBuilder) Produces(v ...MIMEType) *SwaggerBuilder

Produces sets the produces field for object Swagger.

func (*SwaggerBuilder) Reference

func (b *SwaggerBuilder) Reference(v string) *SwaggerBuilder

Reference sets the $ref (reference) field for object Swagger.

func (*SwaggerBuilder) Responses

func (b *SwaggerBuilder) Responses(v ResponseMap) *SwaggerBuilder

Responses sets the responses field for object Swagger.

func (*SwaggerBuilder) Schemes

func (b *SwaggerBuilder) Schemes(v ...Scheme) *SwaggerBuilder

Schemes sets the schemes field for object Swagger.

func (*SwaggerBuilder) Security

Security sets the security field for object Swagger.

func (*SwaggerBuilder) SecurityDefinitions

func (b *SwaggerBuilder) SecurityDefinitions(v SecuritySchemeMap) *SwaggerBuilder

SecurityDefinitions sets the securityDefinitions field for object Swagger.

func (*SwaggerBuilder) Tags

func (b *SwaggerBuilder) Tags(v ...Tag) *SwaggerBuilder

Tags sets the tags field for object Swagger.

type SwaggerMutator

type SwaggerMutator struct {
	// contains filtered or unexported fields
}

SwaggerMutator is used to build an instance of Swagger. The user must call `Apply()` after providing all the necessary information to the new instance of Swagger with new values

func MutateSwagger

func MutateSwagger(v Swagger, options ...Option) *SwaggerMutator

MutateSwagger creates a new mutator object for Swagger Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*SwaggerMutator) Apply

func (m *SwaggerMutator) Apply() error

Apply finalizes the matuation process for Swagger and returns the result

func (*SwaggerMutator) BasePath

func (m *SwaggerMutator) BasePath(v string) *SwaggerMutator

BasePath sets the BasePath field for object Swagger.

func (*SwaggerMutator) ClearConsumes

func (m *SwaggerMutator) ClearConsumes() *SwaggerMutator

ClearConsumes clears all elements in consumes

func (*SwaggerMutator) ClearDefinitions

func (m *SwaggerMutator) ClearDefinitions() *SwaggerMutator

ClearDefinitions removes all values in definitions field

func (*SwaggerMutator) ClearParameters

func (m *SwaggerMutator) ClearParameters() *SwaggerMutator

ClearParameters removes all values in parameters field

func (*SwaggerMutator) ClearProduces

func (m *SwaggerMutator) ClearProduces() *SwaggerMutator

ClearProduces clears all elements in produces

func (*SwaggerMutator) ClearResponses

func (m *SwaggerMutator) ClearResponses() *SwaggerMutator

ClearResponses removes all values in responses field

func (*SwaggerMutator) ClearSchemes

func (m *SwaggerMutator) ClearSchemes() *SwaggerMutator

ClearSchemes clears all elements in schemes

func (*SwaggerMutator) ClearSecurity

func (m *SwaggerMutator) ClearSecurity() *SwaggerMutator

ClearSecurity clears all elements in security

func (*SwaggerMutator) ClearSecurityDefinitions

func (m *SwaggerMutator) ClearSecurityDefinitions() *SwaggerMutator

ClearSecurityDefinitions removes all values in securityDefinitions field

func (*SwaggerMutator) ClearTags

func (m *SwaggerMutator) ClearTags() *SwaggerMutator

ClearTags clears all elements in tags

func (*SwaggerMutator) Consume

func (m *SwaggerMutator) Consume(value string) *SwaggerMutator

Consume appends a value to consumes

func (*SwaggerMutator) Definition

func (m *SwaggerMutator) Definition(key InterfaceMapKey, value interface{}) *SwaggerMutator

Definition sets the value of definitions

func (*SwaggerMutator) Extension

func (m *SwaggerMutator) Extension(name string, value interface{}) *SwaggerMutator

Extension sets an arbitrary extension field in Swagger

func (*SwaggerMutator) ExternalDocs

ExternalDocs sets the ExternalDocs field for object Swagger.

func (*SwaggerMutator) Host

func (m *SwaggerMutator) Host(v string) *SwaggerMutator

Host sets the Host field for object Swagger.

func (*SwaggerMutator) Info

func (m *SwaggerMutator) Info(v Info) *SwaggerMutator

Info sets the Info field for object Swagger.

func (*SwaggerMutator) Parameter

func (m *SwaggerMutator) Parameter(key ParameterMapKey, value Parameter) *SwaggerMutator

Parameter sets the value of parameters

func (*SwaggerMutator) Paths

func (m *SwaggerMutator) Paths(v Paths) *SwaggerMutator

Paths sets the Paths field for object Swagger.

func (*SwaggerMutator) Produce

func (m *SwaggerMutator) Produce(value string) *SwaggerMutator

Produce appends a value to produces

func (*SwaggerMutator) Response

func (m *SwaggerMutator) Response(key ResponseMapKey, value Response) *SwaggerMutator

Response sets the value of responses

func (*SwaggerMutator) Scheme

func (m *SwaggerMutator) Scheme(value string) *SwaggerMutator

Scheme appends a value to schemes

func (*SwaggerMutator) Security

Security appends a value to security

func (*SwaggerMutator) SecurityDefinition

func (m *SwaggerMutator) SecurityDefinition(key SecuritySchemeMapKey, value SecurityScheme) *SwaggerMutator

SecurityDefinition sets the value of securityDefinitions

func (*SwaggerMutator) Tag

func (m *SwaggerMutator) Tag(value Tag) *SwaggerMutator

Tag appends a value to tags

func (*SwaggerMutator) Version

func (m *SwaggerMutator) Version(v string) *SwaggerMutator

Version sets the Version field for object Swagger.

type SwaggerVisitor

type SwaggerVisitor interface {
	VisitSwagger(context.Context, Swagger) error
}

SwaggerVisitor is an interface for objects that knows how to process Swagger elements while traversing the OpenAPI structure

type Tag

type Tag interface {
	Name() string
	Description() string
	ExternalDocs() ExternalDocumentation
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() Tag
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type TagBuilder

type TagBuilder struct {
	// contains filtered or unexported fields
}

TagBuilder is used to build an instance of Tag. The user must call `Build()` after providing all the necessary information to build an instance of Tag. Builders may NOT be reused. It must be created for every instance of Tag that you want to create

func NewTag

func NewTag(name string, options ...Option) *TagBuilder

NewTag creates a new builder object for Tag

func (*TagBuilder) Build

func (b *TagBuilder) Build(options ...Option) (Tag, error)

Build finalizes the building process for Tag and returns the result By default, Build() will validate if the given structure is valid

func (*TagBuilder) Description

func (b *TagBuilder) Description(v string) *TagBuilder

Description sets the description field for object Tag.

func (*TagBuilder) Extension

func (b *TagBuilder) Extension(name string, value interface{}) *TagBuilder

Extension sets an arbitrary element (an extension) to the object Tag. The extension name should start with a "x-"

func (*TagBuilder) ExternalDocs

func (b *TagBuilder) ExternalDocs(v ExternalDocumentation) *TagBuilder

ExternalDocs sets the externalDocs field for object Tag.

func (*TagBuilder) MustBuild

func (b *TagBuilder) MustBuild(options ...Option) Tag

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*TagBuilder) Reference

func (b *TagBuilder) Reference(v string) *TagBuilder

Reference sets the $ref (reference) field for object Tag.

type TagList

type TagList []Tag

func (*TagList) Clear

func (v *TagList) Clear() error

Clear removes all values from TagList

func (*TagList) UnmarshalJSON

func (v *TagList) UnmarshalJSON(data []byte) error

UnmarshalJSON defines how TagList is deserialized from JSON

func (*TagList) Validate

func (v *TagList) Validate(recurse bool) error

Validate checks for the values for correctness. If `recurse` is specified, child elements are also validated

type TagListIterator

type TagListIterator struct {
	// contains filtered or unexported fields
}

func (*TagListIterator) Item

func (iter *TagListIterator) Item() Tag

Item returns the next item in this iterator. Make sure to call Next() before hand to check if the iterator has more items

func (*TagListIterator) Next

func (iter *TagListIterator) Next() bool

Next returns true if there are more elements in this iterator

func (*TagListIterator) Size

func (iter *TagListIterator) Size() int

Size returns the size of the iterator. This size is fixed at creation time. It does not represent the remaining number of items

type TagMutator

type TagMutator struct {
	// contains filtered or unexported fields
}

TagMutator is used to build an instance of Tag. The user must call `Apply()` after providing all the necessary information to the new instance of Tag with new values

func MutateTag

func MutateTag(v Tag, options ...Option) *TagMutator

MutateTag creates a new mutator object for Tag Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*TagMutator) Apply

func (m *TagMutator) Apply() error

Apply finalizes the matuation process for Tag and returns the result

func (*TagMutator) Description

func (m *TagMutator) Description(v string) *TagMutator

Description sets the Description field for object Tag.

func (*TagMutator) Extension

func (m *TagMutator) Extension(name string, value interface{}) *TagMutator

Extension sets an arbitrary extension field in Tag

func (*TagMutator) ExternalDocs

func (m *TagMutator) ExternalDocs(v ExternalDocumentation) *TagMutator

ExternalDocs sets the ExternalDocs field for object Tag.

func (*TagMutator) Name

func (m *TagMutator) Name(v string) *TagMutator

Name sets the Name field for object Tag.

type TagVisitor

type TagVisitor interface {
	VisitTag(context.Context, Tag) error
}

TagVisitor is an interface for objects that knows how to process Tag elements while traversing the OpenAPI structure

type Validator

type Validator interface {
	Validate(bool) error
}

Validator objects can validate themselves.

type XML

type XML interface {
	Name() string
	Namespace() string
	Prefix() string
	Attribute() bool
	Wrapped() bool
	Extension(string) (interface{}, bool)
	Extensions() *ExtensionsIterator
	Clone() XML
	IsUnresolved() bool
	MarshalJSON() ([]byte, error)
	Reference() string
	Validator
}

type XMLBuilder

type XMLBuilder struct {
	// contains filtered or unexported fields
}

XMLBuilder is used to build an instance of XML. The user must call `Build()` after providing all the necessary information to build an instance of XML. Builders may NOT be reused. It must be created for every instance of XML that you want to create

func NewXML

func NewXML(options ...Option) *XMLBuilder

NewXML creates a new builder object for XML

func (*XMLBuilder) Attribute

func (b *XMLBuilder) Attribute(v bool) *XMLBuilder

Attribute sets the attribute field for object XML.

func (*XMLBuilder) Build

func (b *XMLBuilder) Build(options ...Option) (XML, error)

Build finalizes the building process for XML and returns the result By default, Build() will validate if the given structure is valid

func (*XMLBuilder) Extension

func (b *XMLBuilder) Extension(name string, value interface{}) *XMLBuilder

Extension sets an arbitrary element (an extension) to the object XML. The extension name should start with a "x-"

func (*XMLBuilder) MustBuild

func (b *XMLBuilder) MustBuild(options ...Option) XML

MustBuild is a convenience function for those time when you know that the result of the builder must be successful

func (*XMLBuilder) Name

func (b *XMLBuilder) Name(v string) *XMLBuilder

Name sets the name field for object XML.

func (*XMLBuilder) Namespace

func (b *XMLBuilder) Namespace(v string) *XMLBuilder

Namespace sets the namespace field for object XML.

func (*XMLBuilder) Prefix

func (b *XMLBuilder) Prefix(v string) *XMLBuilder

Prefix sets the prefix field for object XML.

func (*XMLBuilder) Reference

func (b *XMLBuilder) Reference(v string) *XMLBuilder

Reference sets the $ref (reference) field for object XML.

func (*XMLBuilder) Wrapped

func (b *XMLBuilder) Wrapped(v bool) *XMLBuilder

Wrapped sets the wrapped field for object XML.

type XMLMutator

type XMLMutator struct {
	// contains filtered or unexported fields
}

XMLMutator is used to build an instance of XML. The user must call `Apply()` after providing all the necessary information to the new instance of XML with new values

func MutateXML

func MutateXML(v XML, options ...Option) *XMLMutator

MutateXML creates a new mutator object for XML Operations on the mutator are safe to be used concurrently, except for when calling `Apply()`, where the user is responsible for restricting access to the target object to be mutated

func (*XMLMutator) Apply

func (m *XMLMutator) Apply() error

Apply finalizes the matuation process for XML and returns the result

func (*XMLMutator) Attribute

func (m *XMLMutator) Attribute(v bool) *XMLMutator

Attribute sets the Attribute field for object XML.

func (*XMLMutator) Extension

func (m *XMLMutator) Extension(name string, value interface{}) *XMLMutator

Extension sets an arbitrary extension field in XML

func (*XMLMutator) Name

func (m *XMLMutator) Name(v string) *XMLMutator

Name sets the Name field for object XML.

func (*XMLMutator) Namespace

func (m *XMLMutator) Namespace(v string) *XMLMutator

Namespace sets the Namespace field for object XML.

func (*XMLMutator) Prefix

func (m *XMLMutator) Prefix(v string) *XMLMutator

Prefix sets the Prefix field for object XML.

func (*XMLMutator) Wrapped

func (m *XMLMutator) Wrapped(v bool) *XMLMutator

Wrapped sets the Wrapped field for object XML.

type XMLVisitor

type XMLVisitor interface {
	VisitXML(context.Context, XML) error
}

XMLVisitor is an interface for objects that knows how to process XML elements while traversing the OpenAPI structure

Source Files

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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