openapi30

package
v0.1.1-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Callback is a map of possible out-of-band callbacks related to the parent operation. https://spec.openapis.org/oas/v3.0.3#callback-object

func NewCallback

func NewCallback(paths map[string]*PathItem) *Callback

NewCallback creates a new Callback instance.

func (*Callback) MarshalFields

func (c *Callback) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Callback) MarshalJSON

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

MarshalJSON serializes Callback as a flat object with runtime expression keys.

func (*Callback) MarshalYAML

func (c *Callback) MarshalYAML() (interface{}, error)

MarshalYAML serializes Callback as a flat YAML mapping.

func (*Callback) Paths

func (c *Callback) Paths() map[string]*PathItem

func (*Callback) SetPaths

func (c *Callback) SetPaths(paths map[string]*PathItem) error

type Components

type Components struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Components holds reusable objects for the specification. https://spec.openapis.org/oas/v3.0.3#components-object

func NewComponents

func NewComponents(
	schemas map[string]*RefSchema,
	responses map[string]*RefResponse,
	parameters map[string]*RefParameter,
	examples map[string]*RefExample,
	requestBodies map[string]*RefRequestBody,
	headers map[string]*RefHeader,
	securitySchemes map[string]*RefSecurityScheme,
	links map[string]*RefLink,
	callbacks map[string]*RefCallback,
) *Components

NewComponents creates a new Components instance.

func (*Components) Callbacks

func (c *Components) Callbacks() map[string]*RefCallback

func (*Components) Examples

func (c *Components) Examples() map[string]*RefExample

func (*Components) Headers

func (c *Components) Headers() map[string]*RefHeader
func (c *Components) Links() map[string]*RefLink

func (*Components) MarshalFields

func (c *Components) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Components) MarshalJSON

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

func (*Components) MarshalYAML

func (c *Components) MarshalYAML() (interface{}, error)

func (*Components) Parameters

func (c *Components) Parameters() map[string]*RefParameter

func (*Components) RequestBodies

func (c *Components) RequestBodies() map[string]*RefRequestBody

func (*Components) Responses

func (c *Components) Responses() map[string]*RefResponse

func (*Components) Schemas

func (c *Components) Schemas() map[string]*RefSchema

func (*Components) SecuritySchemes

func (c *Components) SecuritySchemes() map[string]*RefSecurityScheme

func (*Components) SetCallbacks

func (c *Components) SetCallbacks(callbacks map[string]*RefCallback) error

func (*Components) SetExamples

func (c *Components) SetExamples(examples map[string]*RefExample) error

func (*Components) SetHeaders

func (c *Components) SetHeaders(headers map[string]*RefHeader) error
func (c *Components) SetLinks(links map[string]*RefLink) error

func (*Components) SetParameters

func (c *Components) SetParameters(parameters map[string]*RefParameter) error

func (*Components) SetRequestBodies

func (c *Components) SetRequestBodies(requestBodies map[string]*RefRequestBody) error

func (*Components) SetResponses

func (c *Components) SetResponses(responses map[string]*RefResponse) error

func (*Components) SetSchemas

func (c *Components) SetSchemas(schemas map[string]*RefSchema) error

func (*Components) SetSecuritySchemes

func (c *Components) SetSecuritySchemes(securitySchemes map[string]*RefSecurityScheme) error

type Contact

type Contact struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Contact provides contact information for the API. https://spec.openapis.org/oas/v3.0.3#contact-object

func NewContact

func NewContact(name, url, email string) *Contact

NewContact creates a new Contact instance.

func (*Contact) Email

func (c *Contact) Email() string

Email returns the email address of the contact person/organization.

func (*Contact) MarshalFields

func (c *Contact) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Contact) MarshalJSON

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

func (*Contact) MarshalYAML

func (c *Contact) MarshalYAML() (interface{}, error)

func (*Contact) Name

func (c *Contact) Name() string

Name returns the identifying name of the contact person/organization.

func (*Contact) SetEmail

func (c *Contact) SetEmail(email string) error

func (*Contact) SetName

func (c *Contact) SetName(name string) error

func (*Contact) SetURL

func (c *Contact) SetURL(url string) error

func (*Contact) URL

func (c *Contact) URL() string

URL returns the URL pointing to the contact information.

type Discriminator

type Discriminator struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Discriminator is used for polymorphism support. https://spec.openapis.org/oas/v3.0.3#discriminator-object

func NewDiscriminator

func NewDiscriminator(propertyName string, mapping map[string]string) *Discriminator

NewDiscriminator creates a new Discriminator instance.

func (*Discriminator) Mapping

func (d *Discriminator) Mapping() map[string]string

func (*Discriminator) MarshalFields

func (d *Discriminator) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Discriminator) MarshalJSON

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

func (*Discriminator) MarshalYAML

func (d *Discriminator) MarshalYAML() (interface{}, error)

func (*Discriminator) PropertyName

func (d *Discriminator) PropertyName() string

func (*Discriminator) SetMapping

func (d *Discriminator) SetMapping(mapping map[string]string) error

func (*Discriminator) SetPropertyName

func (d *Discriminator) SetPropertyName(propertyName string) error

type ElementBase

type ElementBase struct {
	VendorExtensions map[string]interface{} `json:"-" yaml:"-"`
	Trix             Trix                   `json:"-" yaml:"-"`
}

ElementBase is embedded in all v30 types to provide vendor extensions and library metadata.

type Encoding

type Encoding struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Encoding defines encoding for a single schema property. https://spec.openapis.org/oas/v3.0.3#encoding-object

func NewEncoding

func NewEncoding(contentType string, headers map[string]*RefHeader, style string, explode *bool, allowReserved bool) *Encoding

NewEncoding creates a new Encoding instance.

func (*Encoding) AllowReserved

func (e *Encoding) AllowReserved() bool

func (*Encoding) ContentType

func (e *Encoding) ContentType() string

func (*Encoding) Explode

func (e *Encoding) Explode() *bool

func (*Encoding) Headers

func (e *Encoding) Headers() map[string]*RefHeader

func (*Encoding) MarshalFields

func (e *Encoding) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Encoding) MarshalJSON

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

func (*Encoding) MarshalYAML

func (e *Encoding) MarshalYAML() (interface{}, error)

func (*Encoding) SetAllowReserved

func (e *Encoding) SetAllowReserved(allowReserved bool) error

func (*Encoding) SetContentType

func (e *Encoding) SetContentType(contentType string) error

func (*Encoding) SetExplode

func (e *Encoding) SetExplode(explode *bool) error

func (*Encoding) SetHeaders

func (e *Encoding) SetHeaders(headers map[string]*RefHeader) error

func (*Encoding) SetStyle

func (e *Encoding) SetStyle(style string) error

func (*Encoding) Style

func (e *Encoding) Style() string

type Example

type Example struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Example represents an example of a media type. https://spec.openapis.org/oas/v3.0.3#example-object

func NewExample

func NewExample(summary, description string, value interface{}, externalValue string) *Example

NewExample creates a new Example instance.

func (*Example) Description

func (e *Example) Description() string

func (*Example) ExternalValue

func (e *Example) ExternalValue() string

func (*Example) MarshalFields

func (e *Example) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Example) MarshalJSON

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

func (*Example) MarshalYAML

func (e *Example) MarshalYAML() (interface{}, error)

func (*Example) SetDescription

func (e *Example) SetDescription(description string) error

func (*Example) SetExternalValue

func (e *Example) SetExternalValue(externalValue string) error

func (*Example) SetSummary

func (e *Example) SetSummary(summary string) error

func (*Example) SetValue

func (e *Example) SetValue(value interface{}) error

func (*Example) Summary

func (e *Example) Summary() string

func (*Example) Value

func (e *Example) Value() interface{}

type ExternalDocumentation

type ExternalDocumentation struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

ExternalDocumentation allows referencing external documentation. https://spec.openapis.org/oas/v3.0.3#external-documentation-object

func NewExternalDocumentation

func NewExternalDocumentation(url, description string) *ExternalDocumentation

NewExternalDocumentation creates a new ExternalDocumentation instance.

func (*ExternalDocumentation) Description

func (e *ExternalDocumentation) Description() string

func (*ExternalDocumentation) MarshalFields

func (e *ExternalDocumentation) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*ExternalDocumentation) MarshalJSON

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

func (*ExternalDocumentation) MarshalYAML

func (e *ExternalDocumentation) MarshalYAML() (interface{}, error)

func (*ExternalDocumentation) SetDescription

func (e *ExternalDocumentation) SetDescription(description string) error

func (*ExternalDocumentation) SetURL

func (e *ExternalDocumentation) SetURL(url string) error

func (*ExternalDocumentation) URL

func (e *ExternalDocumentation) URL() string
type Header struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Header represents a Header Object. https://spec.openapis.org/oas/v3.0.3#header-object

func NewHeader

func NewHeader(
	description string, required, deprecated, allowEmptyValue bool,
	style string, explode *bool, allowReserved bool,
	schema *RefSchema, example interface{}, examples map[string]*RefExample,
	content map[string]*MediaType,
) *Header

NewHeader creates a new Header instance.

func (*Header) AllowEmptyValue

func (h *Header) AllowEmptyValue() bool

func (*Header) AllowReserved

func (h *Header) AllowReserved() bool

func (*Header) Content

func (h *Header) Content() map[string]*MediaType

func (*Header) Deprecated

func (h *Header) Deprecated() bool

func (*Header) Description

func (h *Header) Description() string

func (*Header) Example

func (h *Header) Example() interface{}

func (*Header) Examples

func (h *Header) Examples() map[string]*RefExample

func (*Header) Explode

func (h *Header) Explode() *bool

func (*Header) MarshalFields

func (h *Header) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Header) MarshalJSON

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

func (*Header) MarshalYAML

func (h *Header) MarshalYAML() (interface{}, error)

func (*Header) Required

func (h *Header) Required() bool

func (*Header) Schema

func (h *Header) Schema() *RefSchema

func (*Header) SetAllowEmptyValue

func (h *Header) SetAllowEmptyValue(allowEmptyValue bool) error

func (*Header) SetAllowReserved

func (h *Header) SetAllowReserved(allowReserved bool) error

func (*Header) SetContent

func (h *Header) SetContent(content map[string]*MediaType) error

func (*Header) SetDeprecated

func (h *Header) SetDeprecated(deprecated bool) error

func (*Header) SetDescription

func (h *Header) SetDescription(description string) error

func (*Header) SetExample

func (h *Header) SetExample(example interface{}) error

func (*Header) SetExamples

func (h *Header) SetExamples(examples map[string]*RefExample) error

func (*Header) SetExplode

func (h *Header) SetExplode(explode *bool) error

func (*Header) SetRequired

func (h *Header) SetRequired(required bool) error

func (*Header) SetSchema

func (h *Header) SetSchema(schema *RefSchema) error

func (*Header) SetStyle

func (h *Header) SetStyle(style string) error

func (*Header) Style

func (h *Header) Style() string

type Info

type Info struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Info provides metadata about the API. https://spec.openapis.org/oas/v3.0.3#info-object

func NewInfo

func NewInfo(title, description, termsOfService, version string, contact *Contact, license *License) *Info

NewInfo creates a new Info instance with all spec-defined fields.

func (*Info) Contact

func (i *Info) Contact() *Contact

Contact returns the contact information for the API.

func (*Info) Description

func (i *Info) Description() string

Description returns the description of the API.

func (*Info) License

func (i *Info) License() *License

License returns the license information for the API.

func (*Info) MarshalFields

func (i *Info) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Info) MarshalJSON

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

func (*Info) MarshalYAML

func (i *Info) MarshalYAML() (interface{}, error)

func (*Info) SetContact

func (i *Info) SetContact(contact *Contact) error

func (*Info) SetDescription

func (i *Info) SetDescription(description string) error

func (*Info) SetLicense

func (i *Info) SetLicense(license *License) error

func (*Info) SetTermsOfService

func (i *Info) SetTermsOfService(termsOfService string) error

func (*Info) SetTitle

func (i *Info) SetTitle(title string) error

func (*Info) SetVersion

func (i *Info) SetVersion(version string) error

func (*Info) TermsOfService

func (i *Info) TermsOfService() string

TermsOfService returns the URL to the Terms of Service.

func (*Info) Title

func (i *Info) Title() string

Title returns the title of the API.

func (*Info) Version

func (i *Info) Version() string

Version returns the version of the API.

type License

type License struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

License provides license information for the API. https://spec.openapis.org/oas/v3.0.3#license-object

func NewLicense

func NewLicense(name, url string) *License

NewLicense creates a new License instance.

func (*License) MarshalFields

func (l *License) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*License) MarshalJSON

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

func (*License) MarshalYAML

func (l *License) MarshalYAML() (interface{}, error)

func (*License) Name

func (l *License) Name() string

Name returns the license name used for the API.

func (*License) SetName

func (l *License) SetName(name string) error

func (*License) SetURL

func (l *License) SetURL(url string) error

func (*License) URL

func (l *License) URL() string

URL returns the URL to the license used for the API.

type Link struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Link represents a possible design-time link for a response. https://spec.openapis.org/oas/v3.0.3#link-object

func NewLink(operationRef, operationID string, parameters map[string]interface{}, requestBody interface{}, description string, server *Server) *Link

NewLink creates a new Link instance.

func (*Link) Description

func (l *Link) Description() string

func (*Link) MarshalFields

func (l *Link) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Link) MarshalJSON

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

func (*Link) MarshalYAML

func (l *Link) MarshalYAML() (interface{}, error)

func (*Link) OperationID

func (l *Link) OperationID() string

func (*Link) OperationRef

func (l *Link) OperationRef() string

func (*Link) Parameters

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

func (*Link) RequestBody

func (l *Link) RequestBody() interface{}

func (*Link) Server

func (l *Link) Server() *Server

func (*Link) SetDescription

func (l *Link) SetDescription(description string) error

func (*Link) SetOperationID

func (l *Link) SetOperationID(operationID string) error

func (*Link) SetOperationRef

func (l *Link) SetOperationRef(operationRef string) error

func (*Link) SetParameters

func (l *Link) SetParameters(parameters map[string]interface{}) error

func (*Link) SetRequestBody

func (l *Link) SetRequestBody(requestBody interface{}) error

func (*Link) SetServer

func (l *Link) SetServer(server *Server) error

type Location

type Location = shared.Location

Location represents a position in the source file.

type MediaType

type MediaType struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

MediaType provides schema and examples for a media type. https://spec.openapis.org/oas/v3.0.3#media-type-object

func NewMediaType

func NewMediaType(schema *RefSchema, example interface{}, examples map[string]*RefExample, encoding map[string]*Encoding) *MediaType

NewMediaType creates a new MediaType instance.

func (*MediaType) Encoding

func (mt *MediaType) Encoding() map[string]*Encoding

func (*MediaType) Example

func (mt *MediaType) Example() interface{}

func (*MediaType) Examples

func (mt *MediaType) Examples() map[string]*RefExample

func (*MediaType) MarshalFields

func (mt *MediaType) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*MediaType) MarshalJSON

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

func (*MediaType) MarshalYAML

func (mt *MediaType) MarshalYAML() (interface{}, error)

func (*MediaType) Schema

func (mt *MediaType) Schema() *RefSchema

func (*MediaType) SetEncoding

func (mt *MediaType) SetEncoding(encoding map[string]*Encoding) error

func (*MediaType) SetExample

func (mt *MediaType) SetExample(example interface{}) error

func (*MediaType) SetExamples

func (mt *MediaType) SetExamples(examples map[string]*RefExample) error

func (*MediaType) SetSchema

func (mt *MediaType) SetSchema(schema *RefSchema) error

type NodeSource

type NodeSource = shared.NodeSource

NodeSource contains source location and raw parsed data for a node.

type OAuthFlow

type OAuthFlow struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

OAuthFlow represents configuration for an OAuth flow. https://spec.openapis.org/oas/v3.0.3#oauth-flow-object

func NewOAuthFlow

func NewOAuthFlow(authorizationURL, tokenURL, refreshURL string, scopes map[string]string) *OAuthFlow

NewOAuthFlow creates a new OAuthFlow instance.

func (*OAuthFlow) AuthorizationURL

func (f *OAuthFlow) AuthorizationURL() string

func (*OAuthFlow) MarshalFields

func (f *OAuthFlow) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*OAuthFlow) MarshalJSON

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

func (*OAuthFlow) MarshalYAML

func (f *OAuthFlow) MarshalYAML() (interface{}, error)

func (*OAuthFlow) RefreshURL

func (f *OAuthFlow) RefreshURL() string

func (*OAuthFlow) Scopes

func (f *OAuthFlow) Scopes() map[string]string

func (*OAuthFlow) SetAuthorizationURL

func (f *OAuthFlow) SetAuthorizationURL(authorizationURL string) error

func (*OAuthFlow) SetRefreshURL

func (f *OAuthFlow) SetRefreshURL(refreshURL string) error

func (*OAuthFlow) SetScopes

func (f *OAuthFlow) SetScopes(scopes map[string]string) error

func (*OAuthFlow) SetTokenURL

func (f *OAuthFlow) SetTokenURL(tokenURL string) error

func (*OAuthFlow) TokenURL

func (f *OAuthFlow) TokenURL() string

type OAuthFlows

type OAuthFlows struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

OAuthFlows allows configuration of supported OAuth flows. https://spec.openapis.org/oas/v3.0.3#oauth-flows-object

func NewOAuthFlows

func NewOAuthFlows(implicit, password, clientCredentials, authorizationCode *OAuthFlow) *OAuthFlows

NewOAuthFlows creates a new OAuthFlows instance.

func (*OAuthFlows) AuthorizationCode

func (f *OAuthFlows) AuthorizationCode() *OAuthFlow

func (*OAuthFlows) ClientCredentials

func (f *OAuthFlows) ClientCredentials() *OAuthFlow

func (*OAuthFlows) Implicit

func (f *OAuthFlows) Implicit() *OAuthFlow

func (*OAuthFlows) MarshalFields

func (f *OAuthFlows) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*OAuthFlows) MarshalJSON

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

func (*OAuthFlows) MarshalYAML

func (f *OAuthFlows) MarshalYAML() (interface{}, error)

func (*OAuthFlows) Password

func (f *OAuthFlows) Password() *OAuthFlow

func (*OAuthFlows) SetAuthorizationCode

func (f *OAuthFlows) SetAuthorizationCode(authorizationCode *OAuthFlow) error

func (*OAuthFlows) SetClientCredentials

func (f *OAuthFlows) SetClientCredentials(clientCredentials *OAuthFlow) error

func (*OAuthFlows) SetImplicit

func (f *OAuthFlows) SetImplicit(implicit *OAuthFlow) error

func (*OAuthFlows) SetPassword

func (f *OAuthFlows) SetPassword(password *OAuthFlow) error

type OpenAPI

type OpenAPI struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

OpenAPI is the root document object of the OpenAPI specification. https://spec.openapis.org/oas/v3.0.3#openapi-object

func NewOpenAPI

func NewOpenAPI(version string, info *Info) *OpenAPI

NewOpenAPI creates a new OpenAPI root document instance.

func (*OpenAPI) Components

func (o *OpenAPI) Components() *Components

func (*OpenAPI) ExternalDocs

func (o *OpenAPI) ExternalDocs() *ExternalDocumentation

func (*OpenAPI) Info

func (o *OpenAPI) Info() *Info

func (*OpenAPI) MarshalFields

func (o *OpenAPI) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*OpenAPI) MarshalJSON

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

func (*OpenAPI) MarshalYAML

func (o *OpenAPI) MarshalYAML() (interface{}, error)

func (*OpenAPI) OpenAPIVersion

func (o *OpenAPI) OpenAPIVersion() string

func (*OpenAPI) Paths

func (o *OpenAPI) Paths() *Paths

func (*OpenAPI) Security

func (o *OpenAPI) Security() []SecurityRequirement

func (*OpenAPI) Servers

func (o *OpenAPI) Servers() []*Server

func (*OpenAPI) SetComponents

func (o *OpenAPI) SetComponents(components *Components) error

func (*OpenAPI) SetExternalDocs

func (o *OpenAPI) SetExternalDocs(externalDocs *ExternalDocumentation) error

func (*OpenAPI) SetInfo

func (o *OpenAPI) SetInfo(info *Info) error

func (*OpenAPI) SetOpenAPIVersion

func (o *OpenAPI) SetOpenAPIVersion(openAPI string) error

func (*OpenAPI) SetPaths

func (o *OpenAPI) SetPaths(paths *Paths) error

func (*OpenAPI) SetProperty

func (o *OpenAPI) SetProperty(name string, value interface{})

SetProperty sets a named property on the OpenAPI document. This is used by parsers for post-construction field assignment.

func (*OpenAPI) SetSecurity

func (o *OpenAPI) SetSecurity(security []SecurityRequirement) error

func (*OpenAPI) SetServers

func (o *OpenAPI) SetServers(servers []*Server) error

func (*OpenAPI) SetTags

func (o *OpenAPI) SetTags(tags []*Tag) error

func (*OpenAPI) Tags

func (o *OpenAPI) Tags() []*Tag

type Operation

type Operation struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Operation describes a single API operation on a path. https://spec.openapis.org/oas/v3.0.3#operation-object

func NewOperation

func NewOperation(
	tags []string, summary, description string, externalDocs *ExternalDocumentation,
	operationID string, parameters []*RefParameter, requestBody *RefRequestBody,
	responses *Responses, callbacks map[string]*RefCallback, deprecated bool,
	security []SecurityRequirement, servers []*Server,
) *Operation

NewOperation creates a new Operation instance.

func (*Operation) Callbacks

func (o *Operation) Callbacks() map[string]*RefCallback

func (*Operation) Deprecated

func (o *Operation) Deprecated() bool

func (*Operation) Description

func (o *Operation) Description() string

func (*Operation) ExternalDocs

func (o *Operation) ExternalDocs() *ExternalDocumentation

func (*Operation) MarshalFields

func (o *Operation) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Operation) MarshalJSON

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

func (*Operation) MarshalYAML

func (o *Operation) MarshalYAML() (interface{}, error)

func (*Operation) OperationID

func (o *Operation) OperationID() string

func (*Operation) Parameters

func (o *Operation) Parameters() []*RefParameter

func (*Operation) RequestBody

func (o *Operation) RequestBody() *RefRequestBody

func (*Operation) Responses

func (o *Operation) Responses() *Responses

func (*Operation) Security

func (o *Operation) Security() []SecurityRequirement

func (*Operation) Servers

func (o *Operation) Servers() []*Server

func (*Operation) SetCallbacks

func (o *Operation) SetCallbacks(callbacks map[string]*RefCallback) error

func (*Operation) SetDeprecated

func (o *Operation) SetDeprecated(deprecated bool) error

func (*Operation) SetDescription

func (o *Operation) SetDescription(description string) error

func (*Operation) SetExternalDocs

func (o *Operation) SetExternalDocs(externalDocs *ExternalDocumentation) error

func (*Operation) SetOperationID

func (o *Operation) SetOperationID(operationID string) error

func (*Operation) SetParameters

func (o *Operation) SetParameters(parameters []*RefParameter) error

func (*Operation) SetRequestBody

func (o *Operation) SetRequestBody(requestBody *RefRequestBody) error

func (*Operation) SetResponses

func (o *Operation) SetResponses(responses *Responses) error

func (*Operation) SetSecurity

func (o *Operation) SetSecurity(security []SecurityRequirement) error

func (*Operation) SetServers

func (o *Operation) SetServers(servers []*Server) error

func (*Operation) SetSummary

func (o *Operation) SetSummary(summary string) error

func (*Operation) SetTags

func (o *Operation) SetTags(tags []string) error

func (*Operation) Summary

func (o *Operation) Summary() string

func (*Operation) Tags

func (o *Operation) Tags() []string

type Parameter

type Parameter struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Parameter describes a single operation parameter. https://spec.openapis.org/oas/v3.0.3#parameter-object

func NewParameter

func NewParameter(
	name, in, description string, required, deprecated, allowEmptyValue bool,
	style string, explode *bool, allowReserved bool,
	schema *RefSchema, example interface{}, examples map[string]*RefExample,
	content map[string]*MediaType,
) *Parameter

NewParameter creates a new Parameter instance.

func (*Parameter) AllowEmptyValue

func (p *Parameter) AllowEmptyValue() bool

func (*Parameter) AllowReserved

func (p *Parameter) AllowReserved() bool

func (*Parameter) Content

func (p *Parameter) Content() map[string]*MediaType

func (*Parameter) Deprecated

func (p *Parameter) Deprecated() bool

func (*Parameter) Description

func (p *Parameter) Description() string

func (*Parameter) Example

func (p *Parameter) Example() interface{}

func (*Parameter) Examples

func (p *Parameter) Examples() map[string]*RefExample

func (*Parameter) Explode

func (p *Parameter) Explode() *bool

func (*Parameter) In

func (p *Parameter) In() string

func (*Parameter) MarshalFields

func (p *Parameter) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Parameter) MarshalJSON

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

func (*Parameter) MarshalYAML

func (p *Parameter) MarshalYAML() (interface{}, error)

func (*Parameter) Name

func (p *Parameter) Name() string

func (*Parameter) Required

func (p *Parameter) Required() bool

func (*Parameter) Schema

func (p *Parameter) Schema() *RefSchema

func (*Parameter) SetAllowEmptyValue

func (p *Parameter) SetAllowEmptyValue(allowEmptyValue bool) error

func (*Parameter) SetAllowReserved

func (p *Parameter) SetAllowReserved(allowReserved bool) error

func (*Parameter) SetContent

func (p *Parameter) SetContent(content map[string]*MediaType) error

func (*Parameter) SetDeprecated

func (p *Parameter) SetDeprecated(deprecated bool) error

func (*Parameter) SetDescription

func (p *Parameter) SetDescription(description string) error

func (*Parameter) SetExample

func (p *Parameter) SetExample(example interface{}) error

func (*Parameter) SetExamples

func (p *Parameter) SetExamples(examples map[string]*RefExample) error

func (*Parameter) SetExplode

func (p *Parameter) SetExplode(explode *bool) error

func (*Parameter) SetIn

func (p *Parameter) SetIn(in string) error

func (*Parameter) SetName

func (p *Parameter) SetName(name string) error

func (*Parameter) SetRequired

func (p *Parameter) SetRequired(required bool) error

func (*Parameter) SetSchema

func (p *Parameter) SetSchema(schema *RefSchema) error

func (*Parameter) SetStyle

func (p *Parameter) SetStyle(style string) error

func (*Parameter) Style

func (p *Parameter) Style() string

type ParseError

type ParseError = shared.ParseError

ParseError represents a parsing error associated with a specific node.

type PathItem

type PathItem struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

PathItem describes operations available on a single path. https://spec.openapis.org/oas/v3.0.3#path-item-object

func NewPathItem

func NewPathItem(
	ref, summary, description string,
	get, put, post, del, options, head, patch, trace *Operation,
	servers []*Server, parameters []*RefParameter,
) *PathItem

NewPathItem creates a new PathItem instance.

func (*PathItem) Delete

func (pi *PathItem) Delete() *Operation

func (*PathItem) Description

func (pi *PathItem) Description() string

func (*PathItem) Get

func (pi *PathItem) Get() *Operation

func (*PathItem) Head

func (pi *PathItem) Head() *Operation

func (*PathItem) MarshalFields

func (pi *PathItem) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*PathItem) MarshalJSON

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

func (*PathItem) MarshalYAML

func (pi *PathItem) MarshalYAML() (interface{}, error)

func (*PathItem) Options

func (pi *PathItem) Options() *Operation

func (*PathItem) Parameters

func (pi *PathItem) Parameters() []*RefParameter

func (*PathItem) Patch

func (pi *PathItem) Patch() *Operation

func (*PathItem) Post

func (pi *PathItem) Post() *Operation

func (*PathItem) Put

func (pi *PathItem) Put() *Operation

func (*PathItem) Ref

func (pi *PathItem) Ref() string

func (*PathItem) Servers

func (pi *PathItem) Servers() []*Server

func (*PathItem) SetDelete

func (pi *PathItem) SetDelete(delete *Operation) error

func (*PathItem) SetDescription

func (pi *PathItem) SetDescription(description string) error

func (*PathItem) SetGet

func (pi *PathItem) SetGet(get *Operation) error

func (*PathItem) SetHead

func (pi *PathItem) SetHead(head *Operation) error

func (*PathItem) SetOptions

func (pi *PathItem) SetOptions(options *Operation) error

func (*PathItem) SetParameters

func (pi *PathItem) SetParameters(parameters []*RefParameter) error

func (*PathItem) SetPatch

func (pi *PathItem) SetPatch(patch *Operation) error

func (*PathItem) SetPost

func (pi *PathItem) SetPost(post *Operation) error

func (*PathItem) SetPut

func (pi *PathItem) SetPut(put *Operation) error

func (*PathItem) SetRef

func (pi *PathItem) SetRef(ref string) error

func (*PathItem) SetServers

func (pi *PathItem) SetServers(servers []*Server) error

func (*PathItem) SetSummary

func (pi *PathItem) SetSummary(summary string) error

func (*PathItem) SetTrace

func (pi *PathItem) SetTrace(trace *Operation) error

func (*PathItem) Summary

func (pi *PathItem) Summary() string

func (*PathItem) Trace

func (pi *PathItem) Trace() *Operation

type Paths

type Paths struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Paths holds the relative paths to individual endpoints. https://spec.openapis.org/oas/v3.0.3#paths-object

func NewPaths

func NewPaths(items map[string]*PathItem) *Paths

NewPaths creates a new Paths instance with the given items map.

func (*Paths) Items

func (p *Paths) Items() map[string]*PathItem

func (*Paths) MarshalFields

func (p *Paths) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Paths) MarshalJSON

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

MarshalJSON serializes Paths as a flat JSON object with path keys.

func (*Paths) MarshalYAML

func (p *Paths) MarshalYAML() (interface{}, error)

MarshalYAML serializes Paths as a flat YAML mapping with path keys.

func (*Paths) SetItems

func (p *Paths) SetItems(items map[string]*PathItem) error

type RefCallback

type RefCallback = shared.Ref[Callback]

func NewRefCallback

func NewRefCallback(ref string) *RefCallback

type RefExample

type RefExample = shared.Ref[Example]

func NewRefExample

func NewRefExample(ref string) *RefExample

type RefHeader

type RefHeader = shared.Ref[Header]

func NewRefHeader

func NewRefHeader(ref string) *RefHeader
type RefLink = shared.Ref[Link]
func NewRefLink(ref string) *RefLink

type RefParameter

type RefParameter = shared.Ref[Parameter]

func NewRefParameter

func NewRefParameter(ref string) *RefParameter

type RefPathItem

type RefPathItem = shared.Ref[PathItem]

func NewRefPathItem

func NewRefPathItem(ref string) *RefPathItem

type RefRequestBody

type RefRequestBody = shared.Ref[RequestBody]

func NewRefRequestBody

func NewRefRequestBody(ref string) *RefRequestBody

type RefResponse

type RefResponse = shared.Ref[Response]

func NewRefResponse

func NewRefResponse(ref string) *RefResponse

type RefSchema

type RefSchema = shared.Ref[Schema]

Ref type aliases — use these instead of shared.Ref[T] throughout the package.

func NewRefSchema

func NewRefSchema(ref string) *RefSchema

type RefSecurityScheme

type RefSecurityScheme = shared.Ref[SecurityScheme]

func NewRefSecurityScheme

func NewRefSecurityScheme(ref string) *RefSecurityScheme

type RequestBody

type RequestBody struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

RequestBody describes a single request body. https://spec.openapis.org/oas/v3.0.3#request-body-object

func NewRequestBody

func NewRequestBody(description string, content map[string]*MediaType, required bool) *RequestBody

NewRequestBody creates a new RequestBody instance.

func (*RequestBody) Content

func (rb *RequestBody) Content() map[string]*MediaType

func (*RequestBody) Description

func (rb *RequestBody) Description() string

func (*RequestBody) MarshalFields

func (rb *RequestBody) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*RequestBody) MarshalJSON

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

func (*RequestBody) MarshalYAML

func (rb *RequestBody) MarshalYAML() (interface{}, error)

func (*RequestBody) Required

func (rb *RequestBody) Required() bool

func (*RequestBody) SetContent

func (rb *RequestBody) SetContent(content map[string]*MediaType) error

func (*RequestBody) SetDescription

func (rb *RequestBody) SetDescription(description string) error

func (*RequestBody) SetRequired

func (rb *RequestBody) SetRequired(required bool) error

type Response

type Response struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Response describes a single response from an API operation. https://spec.openapis.org/oas/v3.0.3#response-object

func NewResponse

func NewResponse(description string, headers map[string]*RefHeader, content map[string]*MediaType, links map[string]*RefLink) *Response

NewResponse creates a new Response instance.

func (*Response) Content

func (r *Response) Content() map[string]*MediaType

func (*Response) Description

func (r *Response) Description() string

func (*Response) Headers

func (r *Response) Headers() map[string]*RefHeader
func (r *Response) Links() map[string]*RefLink

func (*Response) MarshalFields

func (r *Response) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Response) MarshalJSON

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

func (*Response) MarshalYAML

func (r *Response) MarshalYAML() (interface{}, error)

func (*Response) SetContent

func (r *Response) SetContent(content map[string]*MediaType) error

func (*Response) SetDescription

func (r *Response) SetDescription(description string) error

func (*Response) SetHeaders

func (r *Response) SetHeaders(headers map[string]*RefHeader) error
func (r *Response) SetLinks(links map[string]*RefLink) error

type Responses

type Responses struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Responses is a container for expected responses of an operation. https://spec.openapis.org/oas/v3.0.3#responses-object

func NewResponses

func NewResponses(defaultResp *RefResponse, codes map[string]*RefResponse) *Responses

NewResponses creates a new Responses instance.

func (*Responses) Codes

func (r *Responses) Codes() map[string]*RefResponse

func (*Responses) Default

func (r *Responses) Default() *RefResponse

func (*Responses) MarshalFields

func (r *Responses) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Responses) MarshalJSON

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

MarshalJSON serializes Responses as a flat object: "default" first, then status codes sorted.

func (*Responses) MarshalYAML

func (r *Responses) MarshalYAML() (interface{}, error)

MarshalYAML serializes Responses as a flat YAML mapping.

func (*Responses) SetCodes

func (r *Responses) SetCodes(codes map[string]*RefResponse) error

func (*Responses) SetDefault

func (r *Responses) SetDefault(defaultResp *RefResponse) error

type Schema

type Schema struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Schema represents the OpenAPI 3.0 Schema Object. https://spec.openapis.org/oas/v3.0.3#schema-object

func NewSchema

func NewSchema(f SchemaFields) *Schema

NewSchema creates a new Schema instance. Due to the large number of fields, callers should use NewSchemaFields.

func (*Schema) AdditionalProperties

func (s *Schema) AdditionalProperties() *RefSchema

func (*Schema) AdditionalPropertiesAllowed

func (s *Schema) AdditionalPropertiesAllowed() *bool

func (*Schema) AllOf

func (s *Schema) AllOf() []*RefSchema

func (*Schema) AnyOf

func (s *Schema) AnyOf() []*RefSchema

func (*Schema) Default

func (s *Schema) Default() interface{}

func (*Schema) Deprecated

func (s *Schema) Deprecated() bool

func (*Schema) Description

func (s *Schema) Description() string

func (*Schema) Discriminator

func (s *Schema) Discriminator() *Discriminator

func (*Schema) Enum

func (s *Schema) Enum() []interface{}

func (*Schema) Example

func (s *Schema) Example() interface{}

func (*Schema) ExclusiveMaximum

func (s *Schema) ExclusiveMaximum() bool

func (*Schema) ExclusiveMinimum

func (s *Schema) ExclusiveMinimum() bool

func (*Schema) ExternalDocs

func (s *Schema) ExternalDocs() *ExternalDocumentation

func (*Schema) Format

func (s *Schema) Format() string

func (*Schema) Items

func (s *Schema) Items() *RefSchema

func (*Schema) MarshalFields

func (s *Schema) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Schema) MarshalJSON

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

func (*Schema) MarshalYAML

func (s *Schema) MarshalYAML() (interface{}, error)

func (*Schema) MaxItems

func (s *Schema) MaxItems() *uint64

func (*Schema) MaxLength

func (s *Schema) MaxLength() *uint64

func (*Schema) MaxProperties

func (s *Schema) MaxProperties() *uint64

func (*Schema) Maximum

func (s *Schema) Maximum() *float64

func (*Schema) MinItems

func (s *Schema) MinItems() *uint64

func (*Schema) MinLength

func (s *Schema) MinLength() *uint64

func (*Schema) MinProperties

func (s *Schema) MinProperties() *uint64

func (*Schema) Minimum

func (s *Schema) Minimum() *float64

func (*Schema) MultipleOf

func (s *Schema) MultipleOf() *float64

func (*Schema) Not

func (s *Schema) Not() *RefSchema

func (*Schema) Nullable

func (s *Schema) Nullable() bool

func (*Schema) OneOf

func (s *Schema) OneOf() []*RefSchema

func (*Schema) Pattern

func (s *Schema) Pattern() string

func (*Schema) Properties

func (s *Schema) Properties() map[string]*RefSchema

func (*Schema) ReadOnly

func (s *Schema) ReadOnly() bool

func (*Schema) Required

func (s *Schema) Required() []string

func (*Schema) SetAdditionalProperties

func (s *Schema) SetAdditionalProperties(additionalProperties *RefSchema) error

func (*Schema) SetAdditionalPropertiesAllowed

func (s *Schema) SetAdditionalPropertiesAllowed(additionalPropertiesAllowed *bool) error

func (*Schema) SetAllOf

func (s *Schema) SetAllOf(allOf []*RefSchema) error

func (*Schema) SetAnyOf

func (s *Schema) SetAnyOf(anyOf []*RefSchema) error

func (*Schema) SetDefault

func (s *Schema) SetDefault(defaultVal interface{}) error

func (*Schema) SetDeprecated

func (s *Schema) SetDeprecated(deprecated bool) error

func (*Schema) SetDescription

func (s *Schema) SetDescription(description string) error

func (*Schema) SetDiscriminator

func (s *Schema) SetDiscriminator(discriminator *Discriminator) error

func (*Schema) SetEnum

func (s *Schema) SetEnum(enum []interface{}) error

func (*Schema) SetExample

func (s *Schema) SetExample(example interface{}) error

func (*Schema) SetExclusiveMaximum

func (s *Schema) SetExclusiveMaximum(exclusiveMaximum bool) error

func (*Schema) SetExclusiveMinimum

func (s *Schema) SetExclusiveMinimum(exclusiveMinimum bool) error

func (*Schema) SetExternalDocs

func (s *Schema) SetExternalDocs(externalDocs *ExternalDocumentation) error

func (*Schema) SetFormat

func (s *Schema) SetFormat(format string) error

func (*Schema) SetItems

func (s *Schema) SetItems(items *RefSchema) error

func (*Schema) SetMaxItems

func (s *Schema) SetMaxItems(maxItems *uint64) error

func (*Schema) SetMaxLength

func (s *Schema) SetMaxLength(maxLength *uint64) error

func (*Schema) SetMaxProperties

func (s *Schema) SetMaxProperties(maxProperties *uint64) error

func (*Schema) SetMaximum

func (s *Schema) SetMaximum(maximum *float64) error

func (*Schema) SetMinItems

func (s *Schema) SetMinItems(minItems *uint64) error

func (*Schema) SetMinLength

func (s *Schema) SetMinLength(minLength *uint64) error

func (*Schema) SetMinProperties

func (s *Schema) SetMinProperties(minProperties *uint64) error

func (*Schema) SetMinimum

func (s *Schema) SetMinimum(minimum *float64) error

func (*Schema) SetMultipleOf

func (s *Schema) SetMultipleOf(multipleOf *float64) error

func (*Schema) SetNot

func (s *Schema) SetNot(not *RefSchema) error

func (*Schema) SetNullable

func (s *Schema) SetNullable(nullable bool) error

func (*Schema) SetOneOf

func (s *Schema) SetOneOf(oneOf []*RefSchema) error

func (*Schema) SetPattern

func (s *Schema) SetPattern(pattern string) error

func (*Schema) SetProperties

func (s *Schema) SetProperties(properties map[string]*RefSchema) error

func (*Schema) SetReadOnly

func (s *Schema) SetReadOnly(readOnly bool) error

func (*Schema) SetRequired

func (s *Schema) SetRequired(required []string) error

func (*Schema) SetTitle

func (s *Schema) SetTitle(title string) error

func (*Schema) SetType

func (s *Schema) SetType(schemaType string) error

func (*Schema) SetUniqueItems

func (s *Schema) SetUniqueItems(uniqueItems bool) error

func (*Schema) SetWriteOnly

func (s *Schema) SetWriteOnly(writeOnly bool) error

func (*Schema) SetXML

func (s *Schema) SetXML(xml *XML) error

func (*Schema) Title

func (s *Schema) Title() string

func (*Schema) Type

func (s *Schema) Type() string

func (*Schema) UniqueItems

func (s *Schema) UniqueItems() bool

func (*Schema) WriteOnly

func (s *Schema) WriteOnly() bool

func (*Schema) XML

func (s *Schema) XML() *XML

type SchemaFields

type SchemaFields struct {
	Title            string
	MultipleOf       *float64
	Maximum          *float64
	ExclusiveMaximum bool
	Minimum          *float64
	ExclusiveMinimum bool
	MaxLength        *uint64
	MinLength        *uint64
	Pattern          string
	MaxItems         *uint64
	MinItems         *uint64
	UniqueItems      bool
	MaxProperties    *uint64
	MinProperties    *uint64
	Required         []string
	Enum             []interface{}
	Type             string
	AllOf            []*RefSchema
	OneOf            []*RefSchema
	AnyOf            []*RefSchema
	Not              *RefSchema
	Items            *RefSchema
	Properties       map[string]*RefSchema
	Description      string
	Format           string
	Default          interface{}

	AdditionalProperties        *RefSchema
	AdditionalPropertiesAllowed *bool

	Nullable      bool
	Discriminator *Discriminator
	ReadOnly      bool
	WriteOnly     bool
	XML           *XML
	ExternalDocs  *ExternalDocumentation
	Example       interface{}
	Deprecated    bool
}

SchemaFields holds all fields for constructing a Schema. Using a struct avoids a 44-parameter constructor.

type SecurityRequirement

type SecurityRequirement map[string][]string

SecurityRequirement lists required security schemes to execute an operation. https://spec.openapis.org/oas/v3.0.3#security-requirement-object

type SecurityScheme

type SecurityScheme struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

SecurityScheme defines a security scheme for the API. https://spec.openapis.org/oas/v3.0.3#security-scheme-object

func NewSecurityScheme

func NewSecurityScheme(secType, description, name, in, scheme, bearerFormat string, flows *OAuthFlows, openIDConnectURL string) *SecurityScheme

NewSecurityScheme creates a new SecurityScheme instance.

func (*SecurityScheme) BearerFormat

func (ss *SecurityScheme) BearerFormat() string

func (*SecurityScheme) Description

func (ss *SecurityScheme) Description() string

func (*SecurityScheme) Flows

func (ss *SecurityScheme) Flows() *OAuthFlows

func (*SecurityScheme) In

func (ss *SecurityScheme) In() string

func (*SecurityScheme) MarshalFields

func (ss *SecurityScheme) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*SecurityScheme) MarshalJSON

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

func (*SecurityScheme) MarshalYAML

func (ss *SecurityScheme) MarshalYAML() (interface{}, error)

func (*SecurityScheme) Name

func (ss *SecurityScheme) Name() string

func (*SecurityScheme) OpenIDConnectURL

func (ss *SecurityScheme) OpenIDConnectURL() string

func (*SecurityScheme) Scheme

func (ss *SecurityScheme) Scheme() string

func (*SecurityScheme) SetBearerFormat

func (ss *SecurityScheme) SetBearerFormat(bearerFormat string) error

func (*SecurityScheme) SetDescription

func (ss *SecurityScheme) SetDescription(description string) error

func (*SecurityScheme) SetFlows

func (ss *SecurityScheme) SetFlows(flows *OAuthFlows) error

func (*SecurityScheme) SetIn

func (ss *SecurityScheme) SetIn(in string) error

func (*SecurityScheme) SetName

func (ss *SecurityScheme) SetName(name string) error

func (*SecurityScheme) SetOpenIDConnectURL

func (ss *SecurityScheme) SetOpenIDConnectURL(openIDConnectURL string) error

func (*SecurityScheme) SetScheme

func (ss *SecurityScheme) SetScheme(scheme string) error

func (*SecurityScheme) SetType

func (ss *SecurityScheme) SetType(secType string) error

func (*SecurityScheme) Type

func (ss *SecurityScheme) Type() string

type Server

type Server struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Server represents a server. https://spec.openapis.org/oas/v3.0.3#server-object

func NewServer

func NewServer(url, description string, variables map[string]*ServerVariable) *Server

NewServer creates a new Server instance.

func (*Server) Description

func (s *Server) Description() string

func (*Server) MarshalFields

func (s *Server) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Server) MarshalJSON

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

func (*Server) MarshalYAML

func (s *Server) MarshalYAML() (interface{}, error)

func (*Server) SetDescription

func (s *Server) SetDescription(description string) error

func (*Server) SetURL

func (s *Server) SetURL(url string) error

func (*Server) SetVariables

func (s *Server) SetVariables(variables map[string]*ServerVariable) error

func (*Server) URL

func (s *Server) URL() string

func (*Server) Variables

func (s *Server) Variables() map[string]*ServerVariable

type ServerVariable

type ServerVariable struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

ServerVariable represents a server variable for URL template substitution. https://spec.openapis.org/oas/v3.0.3#server-variable-object

func NewServerVariable

func NewServerVariable(defaultValue, description string, enum []string) *ServerVariable

NewServerVariable creates a new ServerVariable instance.

func (*ServerVariable) Default

func (sv *ServerVariable) Default() string

func (*ServerVariable) Description

func (sv *ServerVariable) Description() string

func (*ServerVariable) Enum

func (sv *ServerVariable) Enum() []string

func (*ServerVariable) MarshalFields

func (sv *ServerVariable) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*ServerVariable) MarshalJSON

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

func (*ServerVariable) MarshalYAML

func (sv *ServerVariable) MarshalYAML() (interface{}, error)

func (*ServerVariable) SetDefault

func (sv *ServerVariable) SetDefault(defaultVal string) error

func (*ServerVariable) SetDescription

func (sv *ServerVariable) SetDescription(description string) error

func (*ServerVariable) SetEnum

func (sv *ServerVariable) SetEnum(enum []string) error

type Tag

type Tag struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

Tag adds metadata to a single tag used by the Operation Object. https://spec.openapis.org/oas/v3.0.3#tag-object

func NewTag

func NewTag(name, description string, externalDocs *ExternalDocumentation) *Tag

NewTag creates a new Tag instance.

func (*Tag) Description

func (t *Tag) Description() string

func (*Tag) ExternalDocs

func (t *Tag) ExternalDocs() *ExternalDocumentation

func (*Tag) MarshalFields

func (t *Tag) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*Tag) MarshalJSON

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

func (*Tag) MarshalYAML

func (t *Tag) MarshalYAML() (interface{}, error)

func (*Tag) Name

func (t *Tag) Name() string

func (*Tag) SetDescription

func (t *Tag) SetDescription(description string) error

func (*Tag) SetExternalDocs

func (t *Tag) SetExternalDocs(externalDocs *ExternalDocumentation) error

func (*Tag) SetName

func (t *Tag) SetName(name string) error

type Trix

type Trix struct {
	shared.Trix // promotes Source, Errors, OnSet, RunHooks

	// ResolvedMapping holds discriminator mapping values resolved to schema refs (Discriminator only).
	ResolvedMapping map[string]*RefSchema `json:"-" yaml:"-"`

	// ResolvedOperation holds the operation resolved from operationRef (Link only).
	ResolvedOperation *Operation `json:"-" yaml:"-"`
}

Trix contains all library-level metadata and functionality. Everything under Trix is provided by the apitrix library, not part of the OpenAPI specification itself.

type XML

type XML struct {
	ElementBase // embedded - provides VendorExtensions and Trix
	// contains filtered or unexported fields
}

XML provides additional metadata for XML serialization. https://spec.openapis.org/oas/v3.0.3#xml-object

func NewXML

func NewXML(name, namespace, prefix string, attribute, wrapped bool) *XML

NewXML creates a new XML instance.

func (*XML) Attribute

func (x *XML) Attribute() bool

func (*XML) MarshalFields

func (x *XML) MarshalFields() []shared.Field

MarshalFields implements shared.MarshalFieldsProvider for export.

func (*XML) MarshalJSON

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

func (*XML) MarshalYAML

func (x *XML) MarshalYAML() (interface{}, error)

func (*XML) Name

func (x *XML) Name() string

func (*XML) Namespace

func (x *XML) Namespace() string

func (*XML) Prefix

func (x *XML) Prefix() string

func (*XML) SetAttribute

func (x *XML) SetAttribute(attribute bool) error

func (*XML) SetName

func (x *XML) SetName(name string) error

func (*XML) SetNamespace

func (x *XML) SetNamespace(namespace string) error

func (*XML) SetPrefix

func (x *XML) SetPrefix(prefix string) error

func (*XML) SetWrapped

func (x *XML) SetWrapped(wrapped bool) error

func (*XML) Wrapped

func (x *XML) Wrapped() bool

Jump to

Keyboard shortcuts

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