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: 15 Imported by: 0

Documentation

Overview

Package openapi implements OpenAPI 3.x.

This package contains objects that comprise an OpenAPI spec, but only their interfaces are exported. For example, openapi.OpenAPI (the root node that encompasses an entire spec) is an interface, paths are stored under the openapi.Paths interface, and so forth.

The real objects are hidden within this package so that users cannot accidentally create an incomplete object (for example, the spec states that the root element must contain an "info" key, but if the openapi.OpenAPI was a struct you would be able to create an empty openapi.OpenAPI{}, which would be invalid)

The API limits your ability to accidentally create empty values (and also the ability to assign arbitrary values inot fields) because the whole OpenAPI spec is rather complex -- that is, when we translate the document structure into Go, and we try to work with it, it's not just a matter of processing each objects, but we need context. For example when working with Operation objects, we really need to know the path that we're dealing with, as well as the HTTP verb that go with it. However, these values are not defined within the Operation objects: they belong to the Paths object and PathItem objects. When processing through these objects we would either have to pass all of the objects, or we would need to somehow remember their relationships, so we can query them. This is where the limitation comes into play. By limiting unregulated access to fields, we provide automatic hooks to keep track of these relationships.

In doing so, we are able to provide API like this

oper := ... // Operation object
if oper.Detached() { // has this been assigned to a PathItem?
  path := oper.Path() // path that this Operation belongs to
  verb := oper.Verb() // HTTP verb that this Operation is assigned to
}

Building objects must happen through a builder object: The constructor for the object builder asks the user to pass the required parameters that have no default values, and everything else can be optionally passed via methods. When all values are handed, you call `Do()` to obtain the object.

openapi.NewParameter(name). // name parameter is required
  Required(true). // required parameter is optional
  Do()

The objects are *generally* immutable and therefore provide no mutator methods on themselves. However we realize that there are times when you just want to change them: To workaround this issue, we provide mutators which work almost identically as the builders.

openapi.MutatePrameter(p).
  Required(false).
  Do()

When we assign entity objects, the objects are automatically cloned to avoid mutation from outside of the OpenAPI tree

Index

Constants

View Source
const (
	DefaultSpecVersion = "0.0.1"
	DefaultVersion     = "3.0.1"
)

Variables

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

Functions

func CallbackFromJSON

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

CallbackFromJSON constructs a Callback from JSON buffer. `dst` must be a pointer to `Callback`

func ComponentsFromJSON

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

ComponentsFromJSON constructs a Components from JSON buffer. `dst` must be a pointer to `Components`

func ContactFromJSON

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

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

func DiscriminatorFromJSON

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

DiscriminatorFromJSON constructs a Discriminator from JSON buffer. `dst` must be a pointer to `Discriminator`

func EncodingFromJSON

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

EncodingFromJSON constructs a Encoding from JSON buffer. `dst` must be a pointer to `Encoding`

func ExampleFromJSON

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

ExampleFromJSON constructs a Example from JSON buffer. `dst` must be a pointer to `Example`

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 LicenseFromJSON

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

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

func LinkFromJSON

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

LinkFromJSON constructs a Link from JSON buffer. `dst` must be a pointer to `Link`

func MediaTypeFromJSON

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

MediaTypeFromJSON constructs a MediaType from JSON buffer. `dst` must be a pointer to `MediaType`

func OAuthFlowFromJSON

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

OAuthFlowFromJSON constructs a OAuthFlow from JSON buffer. `dst` must be a pointer to `OAuthFlow`

func OAuthFlowsFromJSON

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

OAuthFlowsFromJSON constructs a OAuthFlows from JSON buffer. `dst` must be a pointer to `OAuthFlows`

func OpenAPIFromJSON

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

OpenAPIFromJSON constructs a OpenAPI from JSON buffer. `dst` must be a pointer to `OpenAPI`

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 RequestBodyFromJSON

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

RequestBodyFromJSON constructs a RequestBody from JSON buffer. `dst` must be a pointer to `RequestBody`

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 ServerFromJSON

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

ServerFromJSON constructs a Server from JSON buffer. `dst` must be a pointer to `Server`

func ServerVariableFromJSON

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

ServerVariableFromJSON constructs a ServerVariable from JSON buffer. `dst` must be a pointer to `ServerVariable`

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

Types

type Callback

type Callback interface {
	Name() string
	URLs() map[string]PathItem
	MarshalJSON() ([]byte, error)
	Clone() Callback
	Validator
	// contains filtered or unexported methods
}

type CallbackBuilder

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

CallbackBuilder is used to build an instance of Callback. The user must call `Build()` after providing all the necessary information to build an instance of Callback

func NewCallback

func NewCallback() *CallbackBuilder

NewCallback creates a new builder object for Callback

func (*CallbackBuilder) Build

func (b *CallbackBuilder) Build(options ...Option) (Callback, error)

Build finalizes the building process for Callback and returns the result

func (*CallbackBuilder) MustBuild

func (b *CallbackBuilder) MustBuild(options ...Option) Callback

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

func (*CallbackBuilder) Reference

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

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

func (*CallbackBuilder) URLs

URLs sets the URLs field for object Callback.

type CallbackMap

type CallbackMap map[CallbackMapKey]Callback

func (*CallbackMap) Clear

func (v *CallbackMap) Clear() error

func (CallbackMap) QueryJSON

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

func (*CallbackMap) UnmarshalJSON

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

func (*CallbackMap) Validate

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

Validate checks the correctness of values in CallbackMap

type CallbackMapIterator

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

func (*CallbackMapIterator) Item

func (iter *CallbackMapIterator) Item() (string, Callback)

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

func (*CallbackMapIterator) Next

func (iter *CallbackMapIterator) Next() bool

type CallbackMapKey

type CallbackMapKey = string

type CallbackMutator

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

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

func MutateCallback

func MutateCallback(v Callback) *CallbackMutator

MutateCallback creates a new mutator object for Callback

func (*CallbackMutator) Do

func (b *CallbackMutator) Do() error

Do finalizes the matuation process for Callback and returns the result

func (*CallbackMutator) Name

Name sets the Name field for object Callback.

func (*CallbackMutator) URLs

URLs sets the URLs field for object Callback.

type CallbackVisitor

type CallbackVisitor interface {
	VisitCallback(context.Context, Callback) error
}

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

type Components

type Components interface {
	Schemas() *SchemaMapIterator
	Responses() *ResponseMapIterator
	Parameters() *ParameterMapIterator
	Examples() *ExampleMapIterator
	RequestBodies() *RequestBodyMapIterator
	Headers() *HeaderMapIterator
	SecuritySchemes() *SecuritySchemeMapIterator
	Links() *LinkMapIterator
	Callbacks() *CallbackMapIterator
	MarshalJSON() ([]byte, error)
	Clone() Components
	Validator
}

type ComponentsBuilder

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

ComponentsBuilder is used to build an instance of Components. The user must call `Build()` after providing all the necessary information to build an instance of Components

func NewComponents

func NewComponents() *ComponentsBuilder

NewComponents creates a new builder object for Components

func (*ComponentsBuilder) Build

func (b *ComponentsBuilder) Build(options ...Option) (Components, error)

Build finalizes the building process for Components and returns the result

func (*ComponentsBuilder) Callbacks

func (b *ComponentsBuilder) Callbacks(v map[string]Callback) *ComponentsBuilder

Callbacks sets the Callbacks field for object Components.

func (*ComponentsBuilder) Examples

func (b *ComponentsBuilder) Examples(v map[string]Example) *ComponentsBuilder

Examples sets the Examples field for object Components.

func (*ComponentsBuilder) Headers

func (b *ComponentsBuilder) Headers(v map[string]Header) *ComponentsBuilder

Headers sets the Headers field for object Components.

Links sets the Links field for object Components.

func (*ComponentsBuilder) MustBuild

func (b *ComponentsBuilder) MustBuild(options ...Option) Components

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

func (*ComponentsBuilder) Parameters

func (b *ComponentsBuilder) Parameters(v map[string]Parameter) *ComponentsBuilder

Parameters sets the Parameters field for object Components.

func (*ComponentsBuilder) Reference

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

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

func (*ComponentsBuilder) RequestBodies

func (b *ComponentsBuilder) RequestBodies(v map[string]RequestBody) *ComponentsBuilder

RequestBodies sets the RequestBodies field for object Components.

func (*ComponentsBuilder) Responses

func (b *ComponentsBuilder) Responses(v map[string]Response) *ComponentsBuilder

Responses sets the Responses field for object Components.

func (*ComponentsBuilder) Schema

func (b *ComponentsBuilder) Schema(name string, s Schema) *ComponentsBuilder

Schema sets the schema identified by `name` to `s`

func (*ComponentsBuilder) Schemas

func (b *ComponentsBuilder) Schemas(v map[string]Schema) *ComponentsBuilder

Schemas sets the Schemas field for object Components.

func (*ComponentsBuilder) SecuritySchemes

func (b *ComponentsBuilder) SecuritySchemes(v map[string]SecurityScheme) *ComponentsBuilder

SecuritySchemes sets the SecuritySchemes field for object Components.

type ComponentsMutator

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

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

func MutateComponents

func MutateComponents(v Components) *ComponentsMutator

MutateComponents creates a new mutator object for Components

func (*ComponentsMutator) Callback

func (*ComponentsMutator) ClearCallbacks

func (b *ComponentsMutator) ClearCallbacks() *ComponentsMutator

func (*ComponentsMutator) ClearExamples

func (b *ComponentsMutator) ClearExamples() *ComponentsMutator

func (*ComponentsMutator) ClearHeaders

func (b *ComponentsMutator) ClearHeaders() *ComponentsMutator
func (b *ComponentsMutator) ClearLinks() *ComponentsMutator

func (*ComponentsMutator) ClearParameters

func (b *ComponentsMutator) ClearParameters() *ComponentsMutator

func (*ComponentsMutator) ClearRequestBodies

func (b *ComponentsMutator) ClearRequestBodies() *ComponentsMutator

func (*ComponentsMutator) ClearResponses

func (b *ComponentsMutator) ClearResponses() *ComponentsMutator

func (*ComponentsMutator) ClearSchemas

func (b *ComponentsMutator) ClearSchemas() *ComponentsMutator

func (*ComponentsMutator) ClearSecuritySchemes

func (b *ComponentsMutator) ClearSecuritySchemes() *ComponentsMutator

func (*ComponentsMutator) Do

func (b *ComponentsMutator) Do() error

Do finalizes the matuation process for Components and returns the result

func (*ComponentsMutator) Example

func (b *ComponentsMutator) Example(key ExampleMapKey, value Example) *ComponentsMutator

func (*ComponentsMutator) Header

func (b *ComponentsMutator) Header(key HeaderMapKey, value Header) *ComponentsMutator
func (b *ComponentsMutator) Link(key LinkMapKey, value Link) *ComponentsMutator

func (*ComponentsMutator) Parameter

func (*ComponentsMutator) RequestBody

func (*ComponentsMutator) Response

func (*ComponentsMutator) Schema

func (b *ComponentsMutator) Schema(key SchemaMapKey, value Schema) *ComponentsMutator

func (*ComponentsMutator) SecurityScheme

type ComponentsVisitor

type ComponentsVisitor interface {
	VisitComponents(context.Context, Components) error
}

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

type Contact

type Contact interface {
	Name() string
	URL() string
	Email() string
	MarshalJSON() ([]byte, error)
	Clone() Contact
	Validator
}

Contact represents the contact object https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#contactObject

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

func NewContact

func NewContact() *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

func (*ContactBuilder) Email

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

Email sets the Email field for object Contact.

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 `Do()` after providing all the necessary information to the new instance of Contact with new values

func MutateContact

func MutateContact(v Contact) *ContactMutator

MutateContact creates a new mutator object for Contact

func (*ContactMutator) Do

func (b *ContactMutator) Do() error

Do finalizes the matuation process for Contact and returns the result

func (*ContactMutator) Email

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

Email sets the Email field for object Contact.

func (*ContactMutator) Name

func (b *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 Discriminator

type Discriminator interface {
	PropertyName() string
	Mapping() *StringMapIterator
	MarshalJSON() ([]byte, error)
	Clone() Discriminator
	Validator
}

type DiscriminatorBuilder

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

DiscriminatorBuilder is used to build an instance of Discriminator. The user must call `Build()` after providing all the necessary information to build an instance of Discriminator

func NewDiscriminator

func NewDiscriminator(propertyName string) *DiscriminatorBuilder

NewDiscriminator creates a new builder object for Discriminator

func (*DiscriminatorBuilder) Build

func (b *DiscriminatorBuilder) Build(options ...Option) (Discriminator, error)

Build finalizes the building process for Discriminator and returns the result

func (*DiscriminatorBuilder) Mapping

Mapping sets the Mapping field for object Discriminator.

func (*DiscriminatorBuilder) MustBuild

func (b *DiscriminatorBuilder) MustBuild(options ...Option) Discriminator

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

func (*DiscriminatorBuilder) Reference

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

type DiscriminatorMutator

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

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

func MutateDiscriminator

func MutateDiscriminator(v Discriminator) *DiscriminatorMutator

MutateDiscriminator creates a new mutator object for Discriminator

func (*DiscriminatorMutator) ClearMapping

func (b *DiscriminatorMutator) ClearMapping() *DiscriminatorMutator

func (*DiscriminatorMutator) Do

func (b *DiscriminatorMutator) Do() error

Do finalizes the matuation process for Discriminator and returns the result

func (*DiscriminatorMutator) Mapping

func (*DiscriminatorMutator) PropertyName

func (b *DiscriminatorMutator) PropertyName(v string) *DiscriminatorMutator

PropertyName sets the PropertyName field for object Discriminator.

type DiscriminatorVisitor

type DiscriminatorVisitor interface {
	VisitDiscriminator(context.Context, Discriminator) error
}

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

type Encoding

type Encoding interface {
	Name() string
	ContentType() string
	Headers() *HeaderMapIterator
	Explode() bool
	AllowReserved() bool
	MarshalJSON() ([]byte, error)
	Clone() Encoding
	Validator
	// contains filtered or unexported methods
}

type EncodingBuilder

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

EncodingBuilder is used to build an instance of Encoding. The user must call `Build()` after providing all the necessary information to build an instance of Encoding

func NewEncoding

func NewEncoding() *EncodingBuilder

NewEncoding creates a new builder object for Encoding

func (*EncodingBuilder) AllowReserved

func (b *EncodingBuilder) AllowReserved(v bool) *EncodingBuilder

AllowReserved sets the AllowReserved field for object Encoding.

func (*EncodingBuilder) Build

func (b *EncodingBuilder) Build(options ...Option) (Encoding, error)

Build finalizes the building process for Encoding and returns the result

func (*EncodingBuilder) ContentType

func (b *EncodingBuilder) ContentType(v string) *EncodingBuilder

ContentType sets the ContentType field for object Encoding.

func (*EncodingBuilder) Explode

func (b *EncodingBuilder) Explode(v bool) *EncodingBuilder

Explode sets the Explode field for object Encoding.

func (*EncodingBuilder) Headers

func (b *EncodingBuilder) Headers(v map[string]Header) *EncodingBuilder

Headers sets the Headers field for object Encoding.

func (*EncodingBuilder) MustBuild

func (b *EncodingBuilder) MustBuild(options ...Option) Encoding

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

func (*EncodingBuilder) Reference

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

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

type EncodingMap

type EncodingMap map[EncodingMapKey]Encoding

func (*EncodingMap) Clear

func (v *EncodingMap) Clear() error

func (EncodingMap) QueryJSON

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

func (*EncodingMap) UnmarshalJSON

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

func (*EncodingMap) Validate

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

Validate checks the correctness of values in EncodingMap

type EncodingMapIterator

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

func (*EncodingMapIterator) Item

func (iter *EncodingMapIterator) Item() (string, Encoding)

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

func (*EncodingMapIterator) Next

func (iter *EncodingMapIterator) Next() bool

type EncodingMapKey

type EncodingMapKey = string

type EncodingMutator

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

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

func MutateEncoding

func MutateEncoding(v Encoding) *EncodingMutator

MutateEncoding creates a new mutator object for Encoding

func (*EncodingMutator) AllowReserved

func (b *EncodingMutator) AllowReserved(v bool) *EncodingMutator

AllowReserved sets the AllowReserved field for object Encoding.

func (*EncodingMutator) ClearHeaders

func (b *EncodingMutator) ClearHeaders() *EncodingMutator

func (*EncodingMutator) ContentType

func (b *EncodingMutator) ContentType(v string) *EncodingMutator

ContentType sets the ContentType field for object Encoding.

func (*EncodingMutator) Do

func (b *EncodingMutator) Do() error

Do finalizes the matuation process for Encoding and returns the result

func (*EncodingMutator) Explode

func (b *EncodingMutator) Explode(v bool) *EncodingMutator

Explode sets the Explode field for object Encoding.

func (*EncodingMutator) Header

func (b *EncodingMutator) Header(key HeaderMapKey, value Header) *EncodingMutator

func (*EncodingMutator) Name

Name sets the Name field for object Encoding.

type EncodingVisitor

type EncodingVisitor interface {
	VisitEncoding(context.Context, Encoding) error
}

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

type Example

type Example interface {
	Name() string
	Description() string
	Value() interface{}
	ExternalValue() string
	MarshalJSON() ([]byte, error)
	Clone() Example
	Validator
	// contains filtered or unexported methods
}

type ExampleBuilder

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

ExampleBuilder is used to build an instance of Example. The user must call `Build()` after providing all the necessary information to build an instance of Example

func NewExample

func NewExample() *ExampleBuilder

NewExample creates a new builder object for Example

func (*ExampleBuilder) Build

func (b *ExampleBuilder) Build(options ...Option) (Example, error)

Build finalizes the building process for Example and returns the result

func (*ExampleBuilder) Description

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

Description sets the Description field for object Example.

func (*ExampleBuilder) ExternalValue

func (b *ExampleBuilder) ExternalValue(v string) *ExampleBuilder

ExternalValue sets the ExternalValue field for object Example.

func (*ExampleBuilder) MustBuild

func (b *ExampleBuilder) MustBuild(options ...Option) Example

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

func (*ExampleBuilder) Reference

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

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

func (*ExampleBuilder) Value

func (b *ExampleBuilder) Value(v interface{}) *ExampleBuilder

Value sets the Value field for object Example.

type ExampleMap

type ExampleMap map[ExampleMapKey]Example

func (*ExampleMap) Clear

func (v *ExampleMap) Clear() error

func (ExampleMap) QueryJSON

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

func (*ExampleMap) UnmarshalJSON

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

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, Example)

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

type ExampleMapKey

type ExampleMapKey = string

type ExampleMutator

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

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

func MutateExample

func MutateExample(v Example) *ExampleMutator

MutateExample creates a new mutator object for Example

func (*ExampleMutator) Description

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

Description sets the Description field for object Example.

func (*ExampleMutator) Do

func (b *ExampleMutator) Do() error

Do finalizes the matuation process for Example and returns the result

func (*ExampleMutator) ExternalValue

func (b *ExampleMutator) ExternalValue(v string) *ExampleMutator

ExternalValue sets the ExternalValue field for object Example.

func (*ExampleMutator) Name

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

Name sets the Name field for object Example.

func (*ExampleMutator) Value

func (b *ExampleMutator) Value(v interface{}) *ExampleMutator

Value sets the Value field for object Example.

type ExampleVisitor

type ExampleVisitor interface {
	VisitExample(context.Context, Example) error
}

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

type Extensions

type Extensions map[string]interface{}

type ExternalDocumentation

type ExternalDocumentation interface {
	Description() string
	URL() string
	MarshalJSON() ([]byte, error)
	Clone() ExternalDocumentation
	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

func NewExternalDocumentation

func NewExternalDocumentation(url string) *ExternalDocumentationBuilder

NewExternalDocumentation creates a new builder object for ExternalDocumentation

func (*ExternalDocumentationBuilder) Build

Build finalizes the building process for ExternalDocumentation and returns the result

func (*ExternalDocumentationBuilder) Description

Description sets the Description field for object ExternalDocumentation.

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 `Do()` after providing all the necessary information to the new instance of ExternalDocumentation with new values

func MutateExternalDocumentation

func MutateExternalDocumentation(v ExternalDocumentation) *ExternalDocumentationMutator

MutateExternalDocumentation creates a new mutator object for ExternalDocumentation

func (*ExternalDocumentationMutator) Description

Description sets the Description field for object ExternalDocumentation.

func (*ExternalDocumentationMutator) Do

Do finalizes the matuation process for ExternalDocumentation and returns the result

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
	In() Location
	Required() bool
	Description() string
	Deprecated() bool
	AllowEmptyValue() bool
	Explode() bool
	AllowReserved() bool
	Schema() Schema
	Examples() *ExampleMapIterator
	Content() *MediaTypeMapIterator
	MarshalJSON() ([]byte, error)
	Clone() Header
	Validator
	// contains filtered or unexported methods
}

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

func NewHeader

func NewHeader() *HeaderBuilder

NewHeader creates a new builder object for Header

func (*HeaderBuilder) AllowEmptyValue

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

AllowEmptyValue sets the AllowEmptyValue field for object Header.

func (*HeaderBuilder) AllowReserved

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

AllowReserved sets the AllowReserved field for object Header.

func (*HeaderBuilder) Build

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

Build finalizes the building process for Header and returns the result

func (*HeaderBuilder) Content

func (b *HeaderBuilder) Content(v map[string]MediaType) *HeaderBuilder

Content sets the Content field for object Header.

func (*HeaderBuilder) Deprecated

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

Deprecated sets the Deprecated field for object Header.

func (*HeaderBuilder) Description

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

Description sets the Description field for object Header.

func (*HeaderBuilder) Examples

func (b *HeaderBuilder) Examples(v map[string]Example) *HeaderBuilder

Examples sets the Examples field for object Header.

func (*HeaderBuilder) Explode

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

Explode sets the Explode field for object Header.

func (*HeaderBuilder) In

In sets the In field for object Header. If this is not called, a default value (InHeader) is assigned to this field

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) Reference

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

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

func (*HeaderBuilder) Required

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

Required sets the Required field for object Header.

func (*HeaderBuilder) Schema

func (b *HeaderBuilder) Schema(v Schema) *HeaderBuilder

Schema sets the Schema field for object Header.

type HeaderMap

type HeaderMap map[HeaderMapKey]Header

func (*HeaderMap) Clear

func (v *HeaderMap) Clear() error

func (HeaderMap) QueryJSON

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

func (*HeaderMap) UnmarshalJSON

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

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

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 `Do()` after providing all the necessary information to the new instance of Header with new values

func MutateHeader

func MutateHeader(v Header) *HeaderMutator

MutateHeader creates a new mutator object for Header

func (*HeaderMutator) AllowEmptyValue

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

AllowEmptyValue sets the AllowEmptyValue field for object Header.

func (*HeaderMutator) AllowReserved

func (b *HeaderMutator) AllowReserved(v bool) *HeaderMutator

AllowReserved sets the AllowReserved field for object Header.

func (*HeaderMutator) ClearContent

func (b *HeaderMutator) ClearContent() *HeaderMutator

func (*HeaderMutator) ClearExamples

func (b *HeaderMutator) ClearExamples() *HeaderMutator

func (*HeaderMutator) Content

func (b *HeaderMutator) Content(key MediaTypeMapKey, value MediaType) *HeaderMutator

func (*HeaderMutator) Deprecated

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

Deprecated sets the Deprecated field for object Header.

func (*HeaderMutator) Description

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

Description sets the Description field for object Header.

func (*HeaderMutator) Do

func (b *HeaderMutator) Do() error

Do finalizes the matuation process for Header and returns the result

func (*HeaderMutator) Example

func (b *HeaderMutator) Example(key ExampleMapKey, value Example) *HeaderMutator

func (*HeaderMutator) Explode

func (b *HeaderMutator) Explode(v bool) *HeaderMutator

Explode sets the Explode field for object Header.

func (*HeaderMutator) In

In sets the In field for object Header.

func (*HeaderMutator) Required

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

Required sets the Required field for object Header.

func (*HeaderMutator) Schema

func (b *HeaderMutator) Schema(v Schema) *HeaderMutator

Schema sets the Schema 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
	Description() string
	TermsOfService() string
	Contact() Contact
	License() License
	Version() string
	MarshalJSON() ([]byte, error)
	Clone() Info
	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

func NewInfo

func NewInfo(title string) *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

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) 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.

func (*InfoBuilder) Version

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

Version sets the Version field for object Info. If this is not called, a default value (DefaultSpecVersion) is assigned to this field

type InfoMutator

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

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

func MutateInfo

func MutateInfo(v Info) *InfoMutator

MutateInfo creates a new mutator object for Info

func (*InfoMutator) Contact

func (b *InfoMutator) Contact(v Contact) *InfoMutator

Contact sets the Contact field for object Info.

func (*InfoMutator) Description

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

Description sets the Description field for object Info.

func (*InfoMutator) Do

func (b *InfoMutator) Do() error

Do finalizes the matuation process for Info and returns the result

func (*InfoMutator) License

func (b *InfoMutator) License(v License) *InfoMutator

License sets the License field for object Info.

func (*InfoMutator) TermsOfService

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

TermsOfService sets the TermsOfService field for object Info.

func (*InfoMutator) Title

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

Title sets the Title field for object Info.

func (*InfoMutator) Version

func (b *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

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

type InterfaceMap

type InterfaceMap map[InterfaceMapKey]interface{}

func (*InterfaceMap) Clear

func (v *InterfaceMap) Clear() error

func (InterfaceMap) QueryJSON

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

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

type InterfaceMapKey

type InterfaceMapKey = string

type License

type License interface {
	Name() string
	URL() string
	MarshalJSON() ([]byte, error)
	Clone() License
	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

func NewLicense

func NewLicense(name string) *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

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 `Do()` after providing all the necessary information to the new instance of License with new values

func MutateLicense

func MutateLicense(v License) *LicenseMutator

MutateLicense creates a new mutator object for License

func (*LicenseMutator) Do

func (b *LicenseMutator) Do() error

Do finalizes the matuation process for License and returns the result

func (*LicenseMutator) Name

func (b *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 Link interface {
	Name() string
	OperationRef() string
	OperationID() string
	Parameters() *InterfaceMapIterator
	RequestBody() interface{}
	Description() string
	Server() Server
	MarshalJSON() ([]byte, error)
	Clone() Link
	Validator
	// contains filtered or unexported methods
}

type LinkBuilder

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

LinkBuilder is used to build an instance of Link. The user must call `Build()` after providing all the necessary information to build an instance of Link

func NewLink() *LinkBuilder

NewLink creates a new builder object for Link

func (*LinkBuilder) Build

func (b *LinkBuilder) Build(options ...Option) (Link, error)

Build finalizes the building process for Link and returns the result

func (*LinkBuilder) Description

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

Description sets the Description field for object Link.

func (*LinkBuilder) MustBuild

func (b *LinkBuilder) MustBuild(options ...Option) Link

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

func (*LinkBuilder) OperationID

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

OperationID sets the OperationID field for object Link.

func (*LinkBuilder) OperationRef

func (b *LinkBuilder) OperationRef(v string) *LinkBuilder

OperationRef sets the OperationRef field for object Link.

func (*LinkBuilder) Parameters

func (b *LinkBuilder) Parameters(v map[string]interface{}) *LinkBuilder

Parameters sets the Parameters field for object Link.

func (*LinkBuilder) Reference

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

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

func (*LinkBuilder) RequestBody

func (b *LinkBuilder) RequestBody(v interface{}) *LinkBuilder

RequestBody sets the RequestBody field for object Link.

func (*LinkBuilder) Server

func (b *LinkBuilder) Server(v Server) *LinkBuilder

Server sets the Server field for object Link.

type LinkMap

type LinkMap map[LinkMapKey]Link

func (*LinkMap) Clear

func (v *LinkMap) Clear() error

func (LinkMap) QueryJSON

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

func (*LinkMap) UnmarshalJSON

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

func (*LinkMap) Validate

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

Validate checks the correctness of values in LinkMap

type LinkMapIterator

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

func (*LinkMapIterator) Item

func (iter *LinkMapIterator) Item() (string, Link)

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

func (*LinkMapIterator) Next

func (iter *LinkMapIterator) Next() bool

type LinkMapKey

type LinkMapKey = string

type LinkMutator

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

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

func MutateLink(v Link) *LinkMutator

MutateLink creates a new mutator object for Link

func (*LinkMutator) ClearParameters

func (b *LinkMutator) ClearParameters() *LinkMutator

func (*LinkMutator) Description

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

Description sets the Description field for object Link.

func (*LinkMutator) Do

func (b *LinkMutator) Do() error

Do finalizes the matuation process for Link and returns the result

func (*LinkMutator) Name

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

Name sets the Name field for object Link.

func (*LinkMutator) OperationID

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

OperationID sets the OperationID field for object Link.

func (*LinkMutator) OperationRef

func (b *LinkMutator) OperationRef(v string) *LinkMutator

OperationRef sets the OperationRef field for object Link.

func (*LinkMutator) Parameter

func (b *LinkMutator) Parameter(key InterfaceMapKey, value interface{}) *LinkMutator

func (*LinkMutator) RequestBody

func (b *LinkMutator) RequestBody(v interface{}) *LinkMutator

RequestBody sets the RequestBody field for object Link.

func (*LinkMutator) Server

func (b *LinkMutator) Server(v Server) *LinkMutator

Server sets the Server field for object Link.

type LinkVisitor

type LinkVisitor interface {
	VisitLink(context.Context, Link) error
}

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

type Location

type Location string
const (
	InHeader Location = "header"
	InQuery  Location = "query"
	InPath   Location = "path"
	InCookie Location = "cookie"
)

type MapQueryJSON

type MapQueryJSON map[string]interface{}

type MediaType

type MediaType interface {
	Name() string
	Mime() string
	Schema() Schema
	Examples() *ExampleMapIterator
	Encoding() *EncodingMapIterator
	MarshalJSON() ([]byte, error)
	Clone() MediaType
	Validator
	// contains filtered or unexported methods
}

type MediaTypeBuilder

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

MediaTypeBuilder is used to build an instance of MediaType. The user must call `Build()` after providing all the necessary information to build an instance of MediaType

func NewMediaType

func NewMediaType() *MediaTypeBuilder

NewMediaType creates a new builder object for MediaType

func (*MediaTypeBuilder) Build

func (b *MediaTypeBuilder) Build(options ...Option) (MediaType, error)

Build finalizes the building process for MediaType and returns the result

func (*MediaTypeBuilder) Encoding

func (b *MediaTypeBuilder) Encoding(v map[string]Encoding) *MediaTypeBuilder

Encoding sets the Encoding field for object MediaType.

func (*MediaTypeBuilder) Examples

func (b *MediaTypeBuilder) Examples(v map[string]Example) *MediaTypeBuilder

Examples sets the Examples field for object MediaType.

func (*MediaTypeBuilder) MustBuild

func (b *MediaTypeBuilder) MustBuild(options ...Option) MediaType

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

func (*MediaTypeBuilder) Reference

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

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

func (*MediaTypeBuilder) Schema

Schema sets the Schema field for object MediaType.

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

type MediaTypeMap

type MediaTypeMap map[MediaTypeMapKey]MediaType

func (*MediaTypeMap) Clear

func (v *MediaTypeMap) Clear() error

func (MediaTypeMap) QueryJSON

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

func (*MediaTypeMap) UnmarshalJSON

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

func (*MediaTypeMap) Validate

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

Validate checks the correctness of values in MediaTypeMap

type MediaTypeMapIterator

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

func (*MediaTypeMapIterator) Item

func (iter *MediaTypeMapIterator) Item() (string, 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 (*MediaTypeMapIterator) Next

func (iter *MediaTypeMapIterator) Next() bool

type MediaTypeMapKey

type MediaTypeMapKey = string

type MediaTypeMutator

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

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

func MutateMediaType

func MutateMediaType(v MediaType) *MediaTypeMutator

MutateMediaType creates a new mutator object for MediaType

func (*MediaTypeMutator) ClearEncoding

func (b *MediaTypeMutator) ClearEncoding() *MediaTypeMutator

func (*MediaTypeMutator) ClearExamples

func (b *MediaTypeMutator) ClearExamples() *MediaTypeMutator

func (*MediaTypeMutator) Do

func (b *MediaTypeMutator) Do() error

Do finalizes the matuation process for MediaType and returns the result

func (*MediaTypeMutator) Encoding

func (b *MediaTypeMutator) Encoding(key EncodingMapKey, value Encoding) *MediaTypeMutator

func (*MediaTypeMutator) Example

func (b *MediaTypeMutator) Example(key ExampleMapKey, value Example) *MediaTypeMutator

func (*MediaTypeMutator) Mime

Mime sets the Mime field for object MediaType.

func (*MediaTypeMutator) Name

Name sets the Name field for object MediaType.

func (*MediaTypeMutator) Schema

Schema sets the Schema field for object MediaType.

type MediaTypeVisitor

type MediaTypeVisitor interface {
	VisitMediaType(context.Context, MediaType) error
}

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

type OAuthFlow

type OAuthFlow interface {
	AuthorizationURL() string
	TokenURL() string
	RefreshURL() string
	Scopes() *ScopeMapIterator
	MarshalJSON() ([]byte, error)
	Clone() OAuthFlow
	Validator
}

type OAuthFlowBuilder

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

OAuthFlowBuilder is used to build an instance of OAuthFlow. The user must call `Build()` after providing all the necessary information to build an instance of OAuthFlow

func NewOAuthFlow

func NewOAuthFlow() *OAuthFlowBuilder

NewOAuthFlow creates a new builder object for OAuthFlow

func (*OAuthFlowBuilder) AuthorizationURL

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

AuthorizationURL sets the AuthorizationURL field for object OAuthFlow.

func (*OAuthFlowBuilder) Build

func (b *OAuthFlowBuilder) Build(options ...Option) (OAuthFlow, error)

Build finalizes the building process for OAuthFlow and returns the result

func (*OAuthFlowBuilder) MustBuild

func (b *OAuthFlowBuilder) MustBuild(options ...Option) OAuthFlow

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

func (*OAuthFlowBuilder) Reference

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

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

func (*OAuthFlowBuilder) RefreshURL

func (b *OAuthFlowBuilder) RefreshURL(v string) *OAuthFlowBuilder

RefreshURL sets the RefreshURL field for object OAuthFlow.

func (*OAuthFlowBuilder) Scopes

func (b *OAuthFlowBuilder) Scopes(v map[string]string) *OAuthFlowBuilder

Scopes sets the Scopes field for object OAuthFlow.

func (*OAuthFlowBuilder) TokenURL

func (b *OAuthFlowBuilder) TokenURL(v string) *OAuthFlowBuilder

TokenURL sets the TokenURL field for object OAuthFlow.

type OAuthFlowMutator

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

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

func MutateOAuthFlow

func MutateOAuthFlow(v OAuthFlow) *OAuthFlowMutator

MutateOAuthFlow creates a new mutator object for OAuthFlow

func (*OAuthFlowMutator) AuthorizationURL

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

AuthorizationURL sets the AuthorizationURL field for object OAuthFlow.

func (*OAuthFlowMutator) ClearScopes

func (b *OAuthFlowMutator) ClearScopes() *OAuthFlowMutator

func (*OAuthFlowMutator) Do

func (b *OAuthFlowMutator) Do() error

Do finalizes the matuation process for OAuthFlow and returns the result

func (*OAuthFlowMutator) RefreshURL

func (b *OAuthFlowMutator) RefreshURL(v string) *OAuthFlowMutator

RefreshURL sets the RefreshURL field for object OAuthFlow.

func (*OAuthFlowMutator) Scope

func (b *OAuthFlowMutator) Scope(key ScopeMapKey, value string) *OAuthFlowMutator

func (*OAuthFlowMutator) TokenURL

func (b *OAuthFlowMutator) TokenURL(v string) *OAuthFlowMutator

TokenURL sets the TokenURL field for object OAuthFlow.

type OAuthFlowVisitor

type OAuthFlowVisitor interface {
	VisitOAuthFlow(context.Context, OAuthFlow) error
}

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

type OAuthFlows

type OAuthFlows interface {
	Implicit() OAuthFlow
	Password() OAuthFlow
	ClientCredentials() OAuthFlow
	AuthorizationCode() OAuthFlow
	MarshalJSON() ([]byte, error)
	Clone() OAuthFlows
	Validator
}

type OAuthFlowsBuilder

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

OAuthFlowsBuilder is used to build an instance of OAuthFlows. The user must call `Build()` after providing all the necessary information to build an instance of OAuthFlows

func NewOAuthFlows

func NewOAuthFlows() *OAuthFlowsBuilder

NewOAuthFlows creates a new builder object for OAuthFlows

func (*OAuthFlowsBuilder) AuthorizationCode

func (b *OAuthFlowsBuilder) AuthorizationCode(v OAuthFlow) *OAuthFlowsBuilder

AuthorizationCode sets the AuthorizationCode field for object OAuthFlows.

func (*OAuthFlowsBuilder) Build

func (b *OAuthFlowsBuilder) Build(options ...Option) (OAuthFlows, error)

Build finalizes the building process for OAuthFlows and returns the result

func (*OAuthFlowsBuilder) ClientCredentials

func (b *OAuthFlowsBuilder) ClientCredentials(v OAuthFlow) *OAuthFlowsBuilder

ClientCredentials sets the ClientCredentials field for object OAuthFlows.

func (*OAuthFlowsBuilder) Implicit

Implicit sets the Implicit field for object OAuthFlows.

func (*OAuthFlowsBuilder) MustBuild

func (b *OAuthFlowsBuilder) MustBuild(options ...Option) OAuthFlows

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

func (*OAuthFlowsBuilder) Password

Password sets the Password field for object OAuthFlows.

func (*OAuthFlowsBuilder) Reference

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

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

type OAuthFlowsMutator

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

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

func MutateOAuthFlows

func MutateOAuthFlows(v OAuthFlows) *OAuthFlowsMutator

MutateOAuthFlows creates a new mutator object for OAuthFlows

func (*OAuthFlowsMutator) AuthorizationCode

func (b *OAuthFlowsMutator) AuthorizationCode(v OAuthFlow) *OAuthFlowsMutator

AuthorizationCode sets the AuthorizationCode field for object OAuthFlows.

func (*OAuthFlowsMutator) ClientCredentials

func (b *OAuthFlowsMutator) ClientCredentials(v OAuthFlow) *OAuthFlowsMutator

ClientCredentials sets the ClientCredentials field for object OAuthFlows.

func (*OAuthFlowsMutator) Do

func (b *OAuthFlowsMutator) Do() error

Do finalizes the matuation process for OAuthFlows and returns the result

func (*OAuthFlowsMutator) Implicit

Implicit sets the Implicit field for object OAuthFlows.

func (*OAuthFlowsMutator) Password

Password sets the Password field for object OAuthFlows.

type OAuthFlowsVisitor

type OAuthFlowsVisitor interface {
	VisitOAuthFlows(context.Context, OAuthFlows) error
}

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

type OpenAPI

type OpenAPI interface {
	Version() string
	Info() Info
	Servers() *ServerListIterator
	Paths() Paths
	Components() Components
	Security() SecurityRequirement
	Tags() *TagListIterator
	ExternalDocs() ExternalDocumentation
	MarshalJSON() ([]byte, error)
	Clone() OpenAPI
	Validator
	QueryJSON(string) (interface{}, bool)
}

func ParseJSON

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

func ParseYAML

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

type OpenAPIBuilder

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

OpenAPIBuilder is used to build an instance of OpenAPI. The user must call `Build()` after providing all the necessary information to build an instance of OpenAPI

func NewOpenAPI

func NewOpenAPI(info Info, paths Paths) *OpenAPIBuilder

NewOpenAPI creates a new builder object for OpenAPI

func (*OpenAPIBuilder) Build

func (b *OpenAPIBuilder) Build(options ...Option) (OpenAPI, error)

Build finalizes the building process for OpenAPI and returns the result

func (*OpenAPIBuilder) Components

func (b *OpenAPIBuilder) Components(v Components) *OpenAPIBuilder

Components sets the Components field for object OpenAPI.

func (*OpenAPIBuilder) ExternalDocs

ExternalDocs sets the ExternalDocs field for object OpenAPI.

func (*OpenAPIBuilder) MustBuild

func (b *OpenAPIBuilder) MustBuild(options ...Option) OpenAPI

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

func (*OpenAPIBuilder) Reference

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

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

func (*OpenAPIBuilder) Security

Security sets the Security field for object OpenAPI.

func (*OpenAPIBuilder) Servers

func (b *OpenAPIBuilder) Servers(v []Server) *OpenAPIBuilder

Servers sets the Servers field for object OpenAPI.

func (*OpenAPIBuilder) Tags

func (b *OpenAPIBuilder) Tags(v []Tag) *OpenAPIBuilder

Tags sets the Tags field for object OpenAPI.

func (*OpenAPIBuilder) Version

func (b *OpenAPIBuilder) Version(v string) *OpenAPIBuilder

Version sets the Version field for object OpenAPI. If this is not called, a default value (DefaultVersion) is assigned to this field

type OpenAPIMutator

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

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

func MutateOpenAPI

func MutateOpenAPI(v OpenAPI) *OpenAPIMutator

MutateOpenAPI creates a new mutator object for OpenAPI

func (*OpenAPIMutator) ClearServers

func (b *OpenAPIMutator) ClearServers() *OpenAPIMutator

func (*OpenAPIMutator) ClearTags

func (b *OpenAPIMutator) ClearTags() *OpenAPIMutator

func (*OpenAPIMutator) Components

func (b *OpenAPIMutator) Components(v Components) *OpenAPIMutator

Components sets the Components field for object OpenAPI.

func (*OpenAPIMutator) Do

func (b *OpenAPIMutator) Do() error

Do finalizes the matuation process for OpenAPI and returns the result

func (*OpenAPIMutator) ExternalDocs

ExternalDocs sets the ExternalDocs field for object OpenAPI.

func (*OpenAPIMutator) Info

func (b *OpenAPIMutator) Info(v Info) *OpenAPIMutator

Info sets the Info field for object OpenAPI.

func (*OpenAPIMutator) Paths

func (b *OpenAPIMutator) Paths(v Paths) *OpenAPIMutator

Paths sets the Paths field for object OpenAPI.

func (*OpenAPIMutator) Security

Security sets the Security field for object OpenAPI.

func (*OpenAPIMutator) Server

func (b *OpenAPIMutator) Server(value Server) *OpenAPIMutator

func (*OpenAPIMutator) Tag

func (b *OpenAPIMutator) Tag(value Tag) *OpenAPIMutator

func (*OpenAPIMutator) Version

func (b *OpenAPIMutator) Version(v string) *OpenAPIMutator

Version sets the Version field for object OpenAPI.

type OpenAPIVisitor

type OpenAPIVisitor interface {
	VisitOpenAPI(context.Context, OpenAPI) error
}

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

type Operation

type Operation interface {
	Verb() string
	PathItem() PathItem
	Tags() *StringListIterator
	Summary() string
	Description() string
	ExternalDocs() ExternalDocumentation
	OperationID() string
	Parameters() *ParameterListIterator
	RequestBody() RequestBody
	Responses() Responses
	Callbacks() *CallbackMapIterator
	Deprecated() bool
	Security() *SecurityRequirementListIterator
	Servers() *ServerListIterator
	MarshalJSON() ([]byte, error)
	Clone() Operation
	Validator

	Path() string
	Detached() bool
	// 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

func NewOperation

func NewOperation(responses Responses) *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

func (*OperationBuilder) Callbacks

func (b *OperationBuilder) Callbacks(v map[string]Callback) *OperationBuilder

Callbacks sets the Callbacks 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) 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) Parameter

func (b *OperationBuilder) Parameter(p Parameter) *OperationBuilder

Parameter adds parameter `p` to the operation

func (*OperationBuilder) Parameters

func (b *OperationBuilder) Parameters(v []Parameter) *OperationBuilder

Parameters sets the Parameters 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) RequestBody

func (b *OperationBuilder) RequestBody(v RequestBody) *OperationBuilder

RequestBody sets the RequestBody field for object Operation.

func (*OperationBuilder) Security

Security sets the Security field for object Operation.

func (*OperationBuilder) Servers

func (b *OperationBuilder) Servers(v []Server) *OperationBuilder

Servers sets the Servers field for object Operation.

func (*OperationBuilder) Summary

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

Summary sets the Summary field for object Operation.

func (*OperationBuilder) Tag

Tag adds tag `s` to the operation

func (*OperationBuilder) Tags

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

type OperationMutator

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

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

func MutateOperation

func MutateOperation(v Operation) *OperationMutator

MutateOperation creates a new mutator object for Operation

func (*OperationMutator) Callback

func (b *OperationMutator) Callback(key CallbackMapKey, value Callback) *OperationMutator

func (*OperationMutator) ClearCallbacks

func (b *OperationMutator) ClearCallbacks() *OperationMutator

func (*OperationMutator) ClearParameters

func (b *OperationMutator) ClearParameters() *OperationMutator

func (*OperationMutator) ClearSecurity

func (b *OperationMutator) ClearSecurity() *OperationMutator

func (*OperationMutator) ClearServers

func (b *OperationMutator) ClearServers() *OperationMutator

func (*OperationMutator) ClearTags

func (b *OperationMutator) ClearTags() *OperationMutator

func (*OperationMutator) Deprecated

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

Deprecated sets the Deprecated field for object Operation.

func (*OperationMutator) Description

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

Description sets the Description field for object Operation.

func (*OperationMutator) Do

func (b *OperationMutator) Do() error

Do finalizes the matuation process for Operation and returns the result

func (*OperationMutator) ExternalDocs

ExternalDocs sets the ExternalDocs field for object Operation.

func (*OperationMutator) OperationID

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

OperationID sets the OperationID field for object Operation.

func (*OperationMutator) Parameter

func (b *OperationMutator) Parameter(value Parameter) *OperationMutator

func (*OperationMutator) RequestBody

func (b *OperationMutator) RequestBody(v RequestBody) *OperationMutator

RequestBody sets the RequestBody field for object Operation.

func (*OperationMutator) Responses

func (b *OperationMutator) Responses(v Responses) *OperationMutator

Responses sets the Responses field for object Operation.

func (*OperationMutator) Security

func (*OperationMutator) Server

func (b *OperationMutator) Server(value Server) *OperationMutator

func (*OperationMutator) Summary

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

Summary sets the Summary field for object Operation.

func (*OperationMutator) Tag

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

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 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
	In() Location
	Required() bool
	Description() string
	Deprecated() bool
	AllowEmptyValue() bool
	Explode() bool
	AllowReserved() bool
	Schema() Schema
	Examples() *ExampleMapIterator
	Content() *MediaTypeMapIterator
	MarshalJSON() ([]byte, error)
	Clone() Parameter
	Validator
}

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

func NewParameter

func NewParameter(name string, in Location) *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) AllowReserved

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

AllowReserved sets the AllowReserved 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

func (*ParameterBuilder) Content

Content sets the Content field for object Parameter.

func (*ParameterBuilder) Deprecated

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

Deprecated sets the Deprecated field for object Parameter.

func (*ParameterBuilder) Description

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

Description sets the Description field for object Parameter.

func (*ParameterBuilder) Examples

func (b *ParameterBuilder) Examples(v map[string]Example) *ParameterBuilder

Examples sets the Examples field for object Parameter.

func (*ParameterBuilder) Explode

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

Explode sets the Explode 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) 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. If this is not called, a default value (defaultParameterRequiredFromLocation(in)) is assigned to this field

func (*ParameterBuilder) Schema

Schema sets the Schema field for object Parameter.

type ParameterList

type ParameterList []Parameter

func (*ParameterList) Clear

func (v *ParameterList) Clear() error

func (*ParameterList) UnmarshalJSON

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

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

type ParameterMap

type ParameterMap map[ParameterMapKey]Parameter

func (*ParameterMap) Clear

func (v *ParameterMap) Clear() error

func (ParameterMap) QueryJSON

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

func (*ParameterMap) UnmarshalJSON

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

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

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 `Do()` after providing all the necessary information to the new instance of Parameter with new values

func MutateParameter

func MutateParameter(v Parameter) *ParameterMutator

MutateParameter creates a new mutator object for Parameter

func (*ParameterMutator) AllowEmptyValue

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

AllowEmptyValue sets the AllowEmptyValue field for object Parameter.

func (*ParameterMutator) AllowReserved

func (b *ParameterMutator) AllowReserved(v bool) *ParameterMutator

AllowReserved sets the AllowReserved field for object Parameter.

func (*ParameterMutator) ClearContent

func (b *ParameterMutator) ClearContent() *ParameterMutator

func (*ParameterMutator) ClearExamples

func (b *ParameterMutator) ClearExamples() *ParameterMutator

func (*ParameterMutator) Content

func (*ParameterMutator) Deprecated

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

Deprecated sets the Deprecated field for object Parameter.

func (*ParameterMutator) Description

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

Description sets the Description field for object Parameter.

func (*ParameterMutator) Do

func (b *ParameterMutator) Do() error

Do finalizes the matuation process for Parameter and returns the result

func (*ParameterMutator) Example

func (b *ParameterMutator) Example(key ExampleMapKey, value Example) *ParameterMutator

func (*ParameterMutator) Explode

func (b *ParameterMutator) Explode(v bool) *ParameterMutator

Explode sets the Explode field for object Parameter.

func (*ParameterMutator) In

In sets the In field for object Parameter.

func (*ParameterMutator) Name

Name sets the Name field for object Parameter.

func (*ParameterMutator) Required

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

Required sets the Required field for object Parameter.

func (*ParameterMutator) Schema

Schema sets the Schema field for object Parameter.

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
	Summary() string
	Description() string
	Get() Operation
	Put() Operation
	Post() Operation
	Delete() Operation
	Options() Operation
	Head() Operation
	Patch() Operation
	Trace() Operation
	Servers() *ServerListIterator
	Parameters() *ParameterListIterator
	MarshalJSON() ([]byte, error)
	Clone() PathItem
	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

func NewPathItem

func NewPathItem() *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

func (*PathItemBuilder) Delete

func (*PathItemBuilder) Description

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

Description sets the Description field for object PathItem.

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 (m *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) Path

Path sets the Path field for object PathItem.

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.

func (*PathItemBuilder) Servers

func (b *PathItemBuilder) Servers(v []Server) *PathItemBuilder

Servers sets the Servers field for object PathItem.

func (*PathItemBuilder) Summary

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

Summary sets the Summary field for object PathItem.

func (*PathItemBuilder) Trace

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

type PathItemMap

type PathItemMap map[PathItemMapKey]PathItem

func (*PathItemMap) Clear

func (v *PathItemMap) Clear() error

func (PathItemMap) QueryJSON

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

func (*PathItemMap) UnmarshalJSON

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

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

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 `Do()` after providing all the necessary information to the new instance of PathItem with new values

func MutatePathItem

func MutatePathItem(v PathItem) *PathItemMutator

MutatePathItem creates a new mutator object for PathItem

func (*PathItemMutator) ClearParameters

func (b *PathItemMutator) ClearParameters() *PathItemMutator

func (*PathItemMutator) ClearServers

func (b *PathItemMutator) ClearServers() *PathItemMutator

func (*PathItemMutator) Delete

func (*PathItemMutator) Description

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

Description sets the Description field for object PathItem.

func (*PathItemMutator) Do

func (b *PathItemMutator) Do() error

Do finalizes the matuation process for PathItem and returns the result

func (*PathItemMutator) Get

func (*PathItemMutator) Head

func (*PathItemMutator) Name

Name sets the Name field for object PathItem.

func (*PathItemMutator) Options

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

func (*PathItemMutator) Parameter

func (b *PathItemMutator) Parameter(value Parameter) *PathItemMutator

func (*PathItemMutator) Patch

func (*PathItemMutator) Path

Path sets the Path field for object PathItem.

func (*PathItemMutator) Post

func (*PathItemMutator) Put

func (*PathItemMutator) Server

func (b *PathItemMutator) Server(value Server) *PathItemMutator

func (*PathItemMutator) Summary

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

Summary sets the Summary field for object PathItem.

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
	MarshalJSON() ([]byte, error)
	Clone() Paths
	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

func NewPaths

func NewPaths() *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

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 map[string]PathItem) *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 `Do()` after providing all the necessary information to the new instance of Paths with new values

func MutatePaths

func MutatePaths(v Paths) *PathsMutator

MutatePaths creates a new mutator object for Paths

func (*PathsMutator) Do

func (b *PathsMutator) Do() error

Do finalizes the matuation process for Paths and returns the result

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"
	Null    PrimitiveType = "null"
)

type QueryJSONer

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

type RequestBody

type RequestBody interface {
	Name() string
	Description() string
	Content() *MediaTypeMapIterator
	Required() bool
	MarshalJSON() ([]byte, error)
	Clone() RequestBody
	Validator
	// contains filtered or unexported methods
}

type RequestBodyBuilder

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

RequestBodyBuilder is used to build an instance of RequestBody. The user must call `Build()` after providing all the necessary information to build an instance of RequestBody

func NewRequestBody

func NewRequestBody() *RequestBodyBuilder

NewRequestBody creates a new builder object for RequestBody

func (*RequestBodyBuilder) Build

func (b *RequestBodyBuilder) Build(options ...Option) (RequestBody, error)

Build finalizes the building process for RequestBody and returns the result

func (*RequestBodyBuilder) Content

Content sets the Content field for object RequestBody.

func (*RequestBodyBuilder) Description

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

Description sets the Description field for object RequestBody.

func (*RequestBodyBuilder) MustBuild

func (b *RequestBodyBuilder) MustBuild(options ...Option) RequestBody

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

func (*RequestBodyBuilder) Reference

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

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

func (*RequestBodyBuilder) Required

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

Required sets the Required field for object RequestBody.

type RequestBodyMap

type RequestBodyMap map[RequestBodyMapKey]RequestBody

func (*RequestBodyMap) Clear

func (v *RequestBodyMap) Clear() error

func (RequestBodyMap) QueryJSON

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

func (*RequestBodyMap) UnmarshalJSON

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

func (*RequestBodyMap) Validate

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

Validate checks the correctness of values in RequestBodyMap

type RequestBodyMapIterator

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

func (*RequestBodyMapIterator) Item

func (iter *RequestBodyMapIterator) Item() (string, RequestBody)

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

func (*RequestBodyMapIterator) Next

func (iter *RequestBodyMapIterator) Next() bool

type RequestBodyMapKey

type RequestBodyMapKey = string

type RequestBodyMutator

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

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

func MutateRequestBody

func MutateRequestBody(v RequestBody) *RequestBodyMutator

MutateRequestBody creates a new mutator object for RequestBody

func (*RequestBodyMutator) Content

Content sets the Content field for object RequestBody.

func (*RequestBodyMutator) Description

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

Description sets the Description field for object RequestBody.

func (*RequestBodyMutator) Do

func (b *RequestBodyMutator) Do() error

Do finalizes the matuation process for RequestBody and returns the result

func (*RequestBodyMutator) Name

Name sets the Name field for object RequestBody.

func (*RequestBodyMutator) Required

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

Required sets the Required field for object RequestBody.

type RequestBodyVisitor

type RequestBodyVisitor interface {
	VisitRequestBody(context.Context, RequestBody) error
}

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

type Resolver

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

func NewResolver

func NewResolver(ctx OpenAPI) *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(path string) (interface{}, error)

type Response

type Response interface {
	Name() string
	Description() string
	Headers() *HeaderMapIterator
	Content() *MediaTypeMapIterator
	Links() *LinkMapIterator
	MarshalJSON() ([]byte, error)
	Clone() Response
	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

func NewResponse

func NewResponse(description string) *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

func (*ResponseBuilder) Content

func (b *ResponseBuilder) Content(mime string, desc MediaType) *ResponseBuilder

Content sets th content type `mime` to `desc`

func (*ResponseBuilder) Header

func (b *ResponseBuilder) Header(name string, hdr Header) *ResponseBuilder

Header sets the header `name` to `hdr`

func (*ResponseBuilder) Headers

func (b *ResponseBuilder) Headers(v map[string]Header) *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) Reference

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

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

type ResponseMap

type ResponseMap map[ResponseMapKey]Response

func (*ResponseMap) Clear

func (v *ResponseMap) Clear() error

func (ResponseMap) QueryJSON

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

func (*ResponseMap) UnmarshalJSON

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

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

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 `Do()` after providing all the necessary information to the new instance of Response with new values

func MutateResponse

func MutateResponse(v Response) *ResponseMutator

MutateResponse creates a new mutator object for Response

func (*ResponseMutator) ClearContent

func (b *ResponseMutator) ClearContent() *ResponseMutator

func (*ResponseMutator) ClearHeaders

func (b *ResponseMutator) ClearHeaders() *ResponseMutator
func (b *ResponseMutator) ClearLinks() *ResponseMutator

func (*ResponseMutator) Content

func (b *ResponseMutator) Content(key MediaTypeMapKey, value MediaType) *ResponseMutator

func (*ResponseMutator) Description

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

Description sets the Description field for object Response.

func (*ResponseMutator) Do

func (b *ResponseMutator) Do() error

Do finalizes the matuation process for Response and returns the result

func (*ResponseMutator) Header

func (b *ResponseMutator) Header(key HeaderMapKey, value Header) *ResponseMutator
func (b *ResponseMutator) Link(key LinkMapKey, value Link) *ResponseMutator

func (*ResponseMutator) Name

Name sets the Name 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
	MarshalJSON() ([]byte, error)
	Clone() Responses
	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

func NewResponses

func NewResponses() *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

func (*ResponsesBuilder) Default

Default sets the Default field for object Responses.

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`

type ResponsesMutator

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

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

func MutateResponses

func MutateResponses(v Responses) *ResponsesMutator

MutateResponses creates a new mutator object for Responses

func (*ResponsesMutator) ClearResponses

func (b *ResponsesMutator) ClearResponses() *ResponsesMutator

func (*ResponsesMutator) Default

Default sets the Default field for object Responses.

func (*ResponsesMutator) Do

func (b *ResponsesMutator) Do() error

Do finalizes the matuation process for Responses and returns the result

func (*ResponsesMutator) Response

func (b *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
	Title() string
	MultipleOf() float64
	Maximum() float64
	ExclusiveMaximum() float64
	Minimum() float64
	ExclusiveMinimum() float64
	MaxLength() int
	MinLength() int
	Pattern() string
	MaxItems() int
	MinItems() int
	UniqueItems() bool
	MaxProperties() int
	MinProperties() int
	Required() *StringListIterator
	Enum() *InterfaceListIterator
	AllOf() *SchemaListIterator
	OneOf() *SchemaListIterator
	AnyOf() *SchemaListIterator
	Not() Schema
	Items() Schema
	Properties() *SchemaMapIterator
	Format() string
	Default() interface{}
	Nullable() bool
	Discriminator() Discriminator
	ReadOnly() bool
	WriteOnly() bool
	ExternalDocs() ExternalDocumentation
	Example() interface{}
	Deprecated() bool
	MarshalJSON() ([]byte, error)
	Clone() Schema
	Validator
	Type() PrimitiveType
	// contains filtered or unexported methods
}

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

func NewSchema

func NewSchema() *SchemaBuilder

NewSchema creates a new builder object for Schema

func (*SchemaBuilder) AllOf

func (b *SchemaBuilder) AllOf(v []Schema) *SchemaBuilder

AllOf sets the AllOf field for object Schema.

func (*SchemaBuilder) AnyOf

func (b *SchemaBuilder) AnyOf(v []Schema) *SchemaBuilder

AnyOf sets the AnyOf 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

func (*SchemaBuilder) Default

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

Default sets the Default 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 Discriminator) *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) 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) Not

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

Not sets the Not field for object Schema.

func (*SchemaBuilder) Nullable

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

Nullable sets the Nullable field for object Schema.

func (*SchemaBuilder) OneOf

func (b *SchemaBuilder) OneOf(v []Schema) *SchemaBuilder

OneOf sets the OneOf field for object Schema.

func (*SchemaBuilder) Pattern

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

Pattern sets the Pattern field for object Schema.

func (*SchemaBuilder) Properties

func (b *SchemaBuilder) Properties(v map[string]Schema) *SchemaBuilder

Properties sets the Properties field for object Schema.

func (*SchemaBuilder) Property

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

Property sets property `name` to `s`

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 Type field for object Schema.

func (*SchemaBuilder) UniqueItems

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

UniqueItems sets the UniqueItems field for object Schema.

func (*SchemaBuilder) WriteOnly

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

WriteOnly sets the WriteOnly field for object Schema.

type SchemaList

type SchemaList []Schema

func (*SchemaList) Clear

func (v *SchemaList) Clear() error

func (*SchemaList) UnmarshalJSON

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

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

type SchemaMap

type SchemaMap map[SchemaMapKey]Schema

func (*SchemaMap) Clear

func (v *SchemaMap) Clear() error

func (SchemaMap) QueryJSON

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

func (*SchemaMap) UnmarshalJSON

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

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

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 `Do()` after providing all the necessary information to the new instance of Schema with new values

func MutateSchema

func MutateSchema(v Schema) *SchemaMutator

MutateSchema creates a new mutator object for Schema

func (*SchemaMutator) AllOf

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

func (*SchemaMutator) AnyOf

func (b *SchemaMutator) AnyOf(value Schema) *SchemaMutator

func (*SchemaMutator) ClearAllOf

func (b *SchemaMutator) ClearAllOf() *SchemaMutator

func (*SchemaMutator) ClearAnyOf

func (b *SchemaMutator) ClearAnyOf() *SchemaMutator

func (*SchemaMutator) ClearEnum

func (b *SchemaMutator) ClearEnum() *SchemaMutator

func (*SchemaMutator) ClearOneOf

func (b *SchemaMutator) ClearOneOf() *SchemaMutator

func (*SchemaMutator) ClearProperties

func (b *SchemaMutator) ClearProperties() *SchemaMutator

func (*SchemaMutator) ClearRequired

func (b *SchemaMutator) ClearRequired() *SchemaMutator

func (*SchemaMutator) Default

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

Default sets the Default field for object Schema.

func (*SchemaMutator) Deprecated

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

Deprecated sets the Deprecated field for object Schema.

func (*SchemaMutator) Discriminator

func (b *SchemaMutator) Discriminator(v Discriminator) *SchemaMutator

Discriminator sets the Discriminator field for object Schema.

func (*SchemaMutator) Do

func (b *SchemaMutator) Do() error

Do finalizes the matuation process for Schema and returns the result

func (*SchemaMutator) Enum

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

func (*SchemaMutator) Example

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

Example sets the Example field for object Schema.

func (*SchemaMutator) ExclusiveMaximum

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

ExclusiveMaximum sets the ExclusiveMaximum field for object Schema.

func (*SchemaMutator) ExclusiveMinimum

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

ExclusiveMinimum sets the ExclusiveMinimum field for object Schema.

func (*SchemaMutator) ExternalDocs

ExternalDocs sets the ExternalDocs field for object Schema.

func (*SchemaMutator) Format

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

Format sets the Format field for object Schema.

func (*SchemaMutator) Items

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

Items sets the Items field for object Schema.

func (*SchemaMutator) MaxItems

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

MaxItems sets the MaxItems field for object Schema.

func (*SchemaMutator) MaxLength

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

MaxLength sets the MaxLength field for object Schema.

func (*SchemaMutator) MaxProperties

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

MaxProperties sets the MaxProperties field for object Schema.

func (*SchemaMutator) Maximum

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

Maximum sets the Maximum field for object Schema.

func (*SchemaMutator) MinItems

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

MinItems sets the MinItems field for object Schema.

func (*SchemaMutator) MinLength

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

MinLength sets the MinLength field for object Schema.

func (*SchemaMutator) MinProperties

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

MinProperties sets the MinProperties field for object Schema.

func (*SchemaMutator) Minimum

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

Minimum sets the Minimum field for object Schema.

func (*SchemaMutator) MultipleOf

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

MultipleOf sets the MultipleOf field for object Schema.

func (*SchemaMutator) Name

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

Name sets the Name field for object Schema.

func (*SchemaMutator) Not

func (b *SchemaMutator) Not(v Schema) *SchemaMutator

Not sets the Not field for object Schema.

func (*SchemaMutator) Nullable

func (b *SchemaMutator) Nullable(v bool) *SchemaMutator

Nullable sets the Nullable field for object Schema.

func (*SchemaMutator) OneOf

func (b *SchemaMutator) OneOf(value Schema) *SchemaMutator

func (*SchemaMutator) Pattern

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

Pattern sets the Pattern field for object Schema.

func (*SchemaMutator) Property

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

func (*SchemaMutator) ReadOnly

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

ReadOnly sets the ReadOnly field for object Schema.

func (*SchemaMutator) Required

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

func (*SchemaMutator) Title

func (b *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 (b *SchemaMutator) UniqueItems(v bool) *SchemaMutator

UniqueItems sets the UniqueItems field for object Schema.

func (*SchemaMutator) WriteOnly

func (b *SchemaMutator) WriteOnly(v bool) *SchemaMutator

WriteOnly sets the WriteOnly 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 ScopeMap

type ScopeMap map[ScopeMapKey]string

func (*ScopeMap) Clear

func (v *ScopeMap) Clear() error

func (ScopeMap) QueryJSON

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

func (*ScopeMap) Validate

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

Validate checks the correctness of values in ScopeMap

type ScopeMapIterator

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

func (*ScopeMapIterator) Item

func (iter *ScopeMapIterator) 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 (*ScopeMapIterator) Next

func (iter *ScopeMapIterator) Next() bool

type ScopeMapKey

type ScopeMapKey = string

type SecurityRequirement

type SecurityRequirement interface {
	Schemes() *StringListMapIterator
	MarshalJSON() ([]byte, error)
	Clone() SecurityRequirement
	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

func NewSecurityRequirement

func NewSecurityRequirement() *SecurityRequirementBuilder

NewSecurityRequirement creates a new builder object for SecurityRequirement

func (*SecurityRequirementBuilder) Build

Build finalizes the building process for SecurityRequirement and returns the result

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) Reference

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

func (*SecurityRequirementBuilder) Schemes

Schemes sets the Schemes field for object SecurityRequirement.

type SecurityRequirementList

type SecurityRequirementList []SecurityRequirement

func (*SecurityRequirementList) Clear

func (v *SecurityRequirementList) Clear() error

func (*SecurityRequirementList) UnmarshalJSON

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

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

type SecurityRequirementMutator

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

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

func MutateSecurityRequirement

func MutateSecurityRequirement(v SecurityRequirement) *SecurityRequirementMutator

MutateSecurityRequirement creates a new mutator object for SecurityRequirement

func (*SecurityRequirementMutator) ClearSchemes

func (*SecurityRequirementMutator) Do

Do finalizes the matuation process for SecurityRequirement and returns the result

func (*SecurityRequirementMutator) Scheme

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
	Scheme() string
	BearerFormat() string
	Flows() OAuthFlows
	OpenIDConnectURL() string
	MarshalJSON() ([]byte, error)
	Clone() SecurityScheme
	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

func NewSecurityScheme

func NewSecurityScheme(typ string, name string, in string, scheme string, flows OAuthFlows, openIDConnectURL string) *SecuritySchemeBuilder

NewSecurityScheme creates a new builder object for SecurityScheme

func (*SecuritySchemeBuilder) BearerFormat

BearerFormat sets the BearerFormat 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

func (*SecuritySchemeBuilder) Description

Description sets the Description 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) Reference

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

type SecuritySchemeMap

type SecuritySchemeMap map[SecuritySchemeMapKey]SecurityScheme

func (*SecuritySchemeMap) Clear

func (v *SecuritySchemeMap) Clear() error

func (SecuritySchemeMap) QueryJSON

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

func (*SecuritySchemeMap) UnmarshalJSON

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

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

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 `Do()` after providing all the necessary information to the new instance of SecurityScheme with new values

func MutateSecurityScheme

func MutateSecurityScheme(v SecurityScheme) *SecuritySchemeMutator

MutateSecurityScheme creates a new mutator object for SecurityScheme

func (*SecuritySchemeMutator) BearerFormat

BearerFormat sets the BearerFormat field for object SecurityScheme.

func (*SecuritySchemeMutator) Description

Description sets the Description field for object SecurityScheme.

func (*SecuritySchemeMutator) Do

func (b *SecuritySchemeMutator) Do() error

Do finalizes the matuation process for SecurityScheme and returns the result

func (*SecuritySchemeMutator) Flows

Flows sets the Flows 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) OpenIDConnectURL

func (b *SecuritySchemeMutator) OpenIDConnectURL(v string) *SecuritySchemeMutator

OpenIDConnectURL sets the OpenIDConnectURL field for object SecurityScheme.

func (*SecuritySchemeMutator) Scheme

Scheme sets the Scheme 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 Server

type Server interface {
	URL() string
	Description() string
	Variables() *ServerVariableMapIterator
	MarshalJSON() ([]byte, error)
	Clone() Server
	Validator
}

type ServerBuilder

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

ServerBuilder is used to build an instance of Server. The user must call `Build()` after providing all the necessary information to build an instance of Server

func NewServer

func NewServer(url string) *ServerBuilder

NewServer creates a new builder object for Server

func (*ServerBuilder) Build

func (b *ServerBuilder) Build(options ...Option) (Server, error)

Build finalizes the building process for Server and returns the result

func (*ServerBuilder) Description

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

Description sets the Description field for object Server.

func (*ServerBuilder) MustBuild

func (b *ServerBuilder) MustBuild(options ...Option) Server

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

func (*ServerBuilder) Reference

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

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

func (*ServerBuilder) Variables

func (b *ServerBuilder) Variables(v map[string]ServerVariable) *ServerBuilder

Variables sets the Variables field for object Server.

type ServerList

type ServerList []Server

func (*ServerList) Clear

func (v *ServerList) Clear() error

func (*ServerList) UnmarshalJSON

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

func (*ServerList) Validate

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

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

type ServerListIterator

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

func (*ServerListIterator) Item

func (iter *ServerListIterator) Item() Server

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

func (*ServerListIterator) Next

func (iter *ServerListIterator) Next() bool

Next returns true if there are more elements in this iterator

type ServerMutator

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

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

func MutateServer

func MutateServer(v Server) *ServerMutator

MutateServer creates a new mutator object for Server

func (*ServerMutator) ClearVariables

func (b *ServerMutator) ClearVariables() *ServerMutator

func (*ServerMutator) Description

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

Description sets the Description field for object Server.

func (*ServerMutator) Do

func (b *ServerMutator) Do() error

Do finalizes the matuation process for Server and returns the result

func (*ServerMutator) URL

func (b *ServerMutator) URL(v string) *ServerMutator

URL sets the URL field for object Server.

func (*ServerMutator) Variable

type ServerVariable

type ServerVariable interface {
	Name() string
	Enum() *StringListIterator
	Default() string
	Description() string
	MarshalJSON() ([]byte, error)
	Clone() ServerVariable
	Validator
	// contains filtered or unexported methods
}

type ServerVariableBuilder

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

ServerVariableBuilder is used to build an instance of ServerVariable. The user must call `Build()` after providing all the necessary information to build an instance of ServerVariable

func NewServerVariable

func NewServerVariable(defaultValue string) *ServerVariableBuilder

NewServerVariable creates a new builder object for ServerVariable

func (*ServerVariableBuilder) Build

func (b *ServerVariableBuilder) Build(options ...Option) (ServerVariable, error)

Build finalizes the building process for ServerVariable and returns the result

func (*ServerVariableBuilder) Description

Description sets the Description field for object ServerVariable.

func (*ServerVariableBuilder) Enum

Enum sets the Enum field for object ServerVariable.

func (*ServerVariableBuilder) MustBuild

func (b *ServerVariableBuilder) MustBuild(options ...Option) ServerVariable

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

func (*ServerVariableBuilder) Reference

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

type ServerVariableMap

type ServerVariableMap map[ServerVariableMapKey]ServerVariable

func (*ServerVariableMap) Clear

func (v *ServerVariableMap) Clear() error

func (ServerVariableMap) QueryJSON

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

func (*ServerVariableMap) UnmarshalJSON

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

func (*ServerVariableMap) Validate

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

Validate checks the correctness of values in ServerVariableMap

type ServerVariableMapIterator

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

func (*ServerVariableMapIterator) 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 (*ServerVariableMapIterator) Next

func (iter *ServerVariableMapIterator) Next() bool

type ServerVariableMapKey

type ServerVariableMapKey = string

type ServerVariableMutator

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

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

func MutateServerVariable

func MutateServerVariable(v ServerVariable) *ServerVariableMutator

MutateServerVariable creates a new mutator object for ServerVariable

func (*ServerVariableMutator) ClearEnum

func (*ServerVariableMutator) Default

Default sets the Default field for object ServerVariable.

func (*ServerVariableMutator) Description

Description sets the Description field for object ServerVariable.

func (*ServerVariableMutator) Do

func (b *ServerVariableMutator) Do() error

Do finalizes the matuation process for ServerVariable and returns the result

func (*ServerVariableMutator) Enum

func (*ServerVariableMutator) Name

Name sets the Name field for object ServerVariable.

type ServerVariableVisitor

type ServerVariableVisitor interface {
	VisitServerVariable(context.Context, ServerVariable) error
}

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

type ServerVisitor

type ServerVisitor interface {
	VisitServer(context.Context, Server) error
}

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

type SliceQueryJSON

type SliceQueryJSON []interface{}

type StringList

type StringList []string

func (*StringList) Clear

func (v *StringList) Clear() error

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

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

type StringListMap

type StringListMap map[StringListMapKey][]string

func (*StringListMap) Clear

func (v *StringListMap) Clear() error

func (StringListMap) QueryJSON

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

func (*StringListMap) Validate

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

Validate checks the correctness of values in StringListMap

type StringListMapIterator

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

func (*StringListMapIterator) Item

func (iter *StringListMapIterator) 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 (*StringListMapIterator) Next

func (iter *StringListMapIterator) Next() bool

type StringListMapKey

type StringListMapKey = string

type StringMap

type StringMap map[StringMapKey]string

func (*StringMap) Clear

func (v *StringMap) Clear() error

func (StringMap) QueryJSON

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

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

type StringMapKey

type StringMapKey = string

type Tag

type Tag interface {
	Name() string
	Description() string
	ExternalDocs() ExternalDocumentation
	MarshalJSON() ([]byte, error)
	Clone() Tag
	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

func NewTag

func NewTag(name string) *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

func (*TagBuilder) Description

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

Description sets the Description field for object Tag.

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

func (*TagList) UnmarshalJSON

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

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

type TagMutator

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

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

func MutateTag

func MutateTag(v Tag) *TagMutator

MutateTag creates a new mutator object for Tag

func (*TagMutator) Description

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

Description sets the Description field for object Tag.

func (*TagMutator) Do

func (b *TagMutator) Do() error

Do finalizes the matuation process for Tag and returns the result

func (*TagMutator) ExternalDocs

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

ExternalDocs sets the ExternalDocs field for object Tag.

func (*TagMutator) Name

func (b *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.

Source Files

Directories

Path Synopsis
internal
types
This file serves as the base template of openapi/v3/interface_gen.go.
This file serves as the base template of openapi/v3/interface_gen.go.

Jump to

Keyboard shortcuts

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