spec

package
v0.1.14 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 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 {
	// A Path Item Object used to define a callback request and expected responses.
	PathItems map[string]*PathItem `json:"-" yaml:"-"`
}

A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the Path Item Object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.

See: https://spec.openapis.org/oas/v3.0.4.html#callback-object

func (*Callback) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface. It marshals the PathItems map directly as the Callback object.

func (*Callback) MarshalYAML

func (c *Callback) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface. It marshals the PathItems map directly as the Callback object.

func (*Callback) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaler interface. It unmarshals the JSON directly into the PathItems map.

func (*Callback) UnmarshalYAML

func (c *Callback) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface. It unmarshals the YAML directly into the PathItems map.

type Components

type Components struct {
	// An object to hold reusable Schema Objects.
	Schemas map[string]*Schema `json:"schemas,omitempty" yaml:"schemas,omitempty"`
	// An object to hold reusable Response Objects.
	Responses map[string]*Response `json:"responses,omitempty" yaml:"responses,omitempty"`
	// An object to hold reusable Parameter Objects.
	Parameters map[string]*Parameter `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	// An object to hold reusable Example Objects.
	Examples map[string]*Example `json:"examples,omitempty" yaml:"examples,omitempty"`
	// An object to hold reusable Request Body Objects.
	RequestBodies map[string]*RequestBody `json:"requestBodies,omitempty" yaml:"requestBodies,omitempty"`
	// An object to hold reusable Header Objects.
	Headers map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
	// An object to hold reusable Security Scheme Objects.
	SecuritySchemes map[string]*SecurityScheme `json:"securitySchemes,omitempty" yaml:"securitySchemes,omitempty"`
	// An object to hold reusable Link Objects.
	Links map[string]*Link `json:"links,omitempty" yaml:"links,omitempty"`
	// An object to hold reusable Callback Objects.
	Callbacks map[string]*Callback `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
	// An object to hold reusable Path Item Objects.
	PathItems map[string]*PathItem `json:"pathItems,omitempty" yaml:"pathItems,omitempty"`
}

Holds a set of reusable objects for different aspects of the OAS. All objects defined within the Components Object will have no effect on the API unless they are explicitly referenced from outside the Components Object.

See: https://spec.openapis.org/oas/v3.1.1.html#components-object

type Contact

type Contact struct {
	// The identifying name of the contact person/organization.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// The URL for the contact information. This MUST be in the form of a URL.
	URL string `json:"url,omitempty" yaml:"url,omitempty"`
	// The email address of the contact person/organization. This MUST be in the form of an email address.
	Email string `json:"email,omitempty" yaml:"email,omitempty"`
}

Contact information for the exposed API.

See: https://spec.openapis.org/oas/v3.0.4.html#contact-object

type Discriminator

type Discriminator struct {
	// REQUIRED. The name of the property in the payload that will hold the discriminating value.
	// This property SHOULD be required in the payload schema, as the behavior when the property
	// is absent is undefined.
	PropertyName string `json:"propertyName" yaml:"propertyName"`
	// An object to hold mappings between payload values and schema names or URI references.
	Mapping map[string]string `json:"mapping,omitempty" yaml:"mapping,omitempty"`
}

Discriminator Object

When request bodies or response payloads may be one of a number of different schemas, a Discriminator Object gives a hint about the expected schema of the document. This hint can be used to aid in serialization, deserialization, and validation. The Discriminator Object does this by implicitly or explicitly associating the possible values of a named property with alternative schemas.

Note that discriminator MUST NOT change the validation outcome of the schema.

See: https://spec.openapis.org/oas/v3.0.4.html#discriminator-object

type Encoding

type Encoding struct {
	// The Content-Type for encoding a specific property. The value is a comma-separated list, each
	// element of which is either a specific media type (e.g. image/png) or a wildcard media type
	// (e.g. image/*). Default value depends on the property type.
	ContentType string `json:"contentType,omitempty" yaml:"contentType,omitempty"`
	// A map allowing additional information to be provided as headers. Content-Type is described
	// separately and SHALL be ignored in this section. This field SHALL be ignored if the request
	// body media type is not a multipart.
	Headers map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
	// Describes how a specific property value will be serialized depending on its type. See Parameter
	// Object for details on the style field. The behavior follows the same values as query parameters,
	// including default values. This field SHALL be ignored if the request body media type is not
	// application/x-www-form-urlencoded.
	Style string `json:"style,omitempty" yaml:"style,omitempty"`
	// When this is true, property values of type array or object generate separate parameters for each
	// value of the array, or key-value-pair of the map. For other types of properties this field has
	// no effect. When style is "form", the default value is true. For all other styles, the default
	// value is false. This field SHALL be ignored if the request body media type is not
	// application/x-www-form-urlencoded.
	Explode bool `json:"explode,omitempty" yaml:"explode,omitempty"`
	// When this is true, parameter values are serialized using reserved expansion, as defined by
	// RFC6570, which allows RFC3986's reserved character set, as well as percent-encoded triples, to
	// pass through unchanged. The default value is false. This field SHALL be ignored if the request
	// body media type is not application/x-www-form-urlencoded.
	AllowReserved bool `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
}

A single encoding definition applied to a single schema property.

See: https://spec.openapis.org/oas/v3.0.4.html#encoding-object

type Example

type Example struct {
	// Short description for the example.
	Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
	// Long description for the example. CommonMark syntax MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Embedded literal example. The value field and externalValue field are mutually exclusive. To
	// represent examples of media types that cannot naturally represented in JSON or YAML, use a
	// string value to contain the example, escaping where necessary.
	Value any `json:"value,omitempty" yaml:"value,omitempty"`
	// A URL that points to the literal example. This provides the capability to reference examples
	// that cannot easily be included in JSON or YAML documents. The value field and externalValue
	// field are mutually exclusive.
	ExternalValue string `json:"externalValue,omitempty" yaml:"externalValue,omitempty"`
}

An object grouping an internal or external example value with basic summary and description metadata. This object is typically used in fields named examples (plural), and is a referenceable alternative to older example (singular) fields that do not support referencing or metadata.

See: https://spec.openapis.org/oas/v3.0.4.html#example-object

type ExternalDocs

type ExternalDocs struct {
	// A description of the target documentation. CommonMark syntax MAY be used for rich text
	// representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// REQUIRED. The URL for the target documentation. This MUST be in the form of a URL.
	URL string `json:"url" yaml:"url"`
}

Allows referencing an external resource for extended documentation.

See: https://spec.openapis.org/oas/v3.0.4.html#external-documentation-object

type Header struct {
	// A brief description of the header. This could contain examples of use. CommonMark syntax MAY
	// be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Determines whether this header is mandatory. The default value is false.
	Required bool `json:"required,omitempty" yaml:"required,omitempty"`
	// Specifies that the header is deprecated and SHOULD be transitioned out of usage. Default value
	// is false.
	Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	// Describes how the header value will be serialized. The default (and only legal value for
	// headers) is "simple".
	Style string `json:"style,omitempty" yaml:"style,omitempty"`
	// When this is true, header values of type array or object generate a single header whose value
	// is a comma-separated list of the array items or key-value pairs of the map. For other data
	// types this field has no effect. The default value is false.
	Explode *bool `json:"explode,omitempty" yaml:"explode,omitempty"`
	// The schema defining the type used for the header.
	Schema *Schema `json:"schema,omitempty" yaml:"schema,omitempty"`
	// Example of the header's potential value; see Working With Examples.
	Example any `json:"example,omitempty" yaml:"example,omitempty"`
	// Examples of the header's potential value; see Working With Examples.
	Examples map[string]*Example `json:"examples,omitempty" yaml:"examples,omitempty"`
	// A map containing the representations for the header. The key is the media type and the value
	// describes it. The map MUST only contain one entry.
	Content map[string]*MediaType `json:"content,omitempty" yaml:"content,omitempty"`
}

Describes a single header for HTTP responses and for individual parts in multipart representations.

The Header Object follows the structure of the Parameter Object, including determining its serialization strategy based on whether schema or content is present, with the following changes: 1. name MUST NOT be specified, it is given in the corresponding headers map. 2. in MUST NOT be specified, it is implicitly in header. 3. All traits that are affected by the location MUST be applicable to a location of header.

See: https://spec.openapis.org/oas/v3.0.4.html#header-object

type Info

type Info struct {
	// REQUIRED. The title of the API.
	Title string `json:"title" yaml:"title"`
	// A short summary of the API.
	Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
	// A description of the API. CommonMark syntax MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// A URL for the Terms of Service for the API. This MUST be in the form of a URL.
	TermsOfService string `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty"`
	// The contact information for the exposed API.
	Contact *Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
	// The license information for the exposed API.
	License *License `json:"license,omitempty" yaml:"license,omitempty"`
	// REQUIRED. The version of the OpenAPI Document (which is distinct from the OpenAPI Specification
	// version or the version of the API being described or the version of the OpenAPI Description).
	Version string `json:"version" yaml:"version"`
}

The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.

See: https://spec.openapis.org/oas/v3.1.1.html#info-object

type License

type License struct {
	// REQUIRED. The license name used for the API.
	Name string `json:"name" yaml:"name"`
	// An SPDX license expression for the API. Mutually exclusive with URL.
	Identifier string `json:"identifier,omitempty" yaml:"identifier,omitempty"`
	// A URL for the license used for the API. This MUST be in the form of a URL.
	// Mutually exclusive with Identifier.
	URL string `json:"url,omitempty" yaml:"url,omitempty"`
}

License information for the exposed API.

See: https://spec.openapis.org/oas/v3.1.1.html#license-object

type Link struct {
	// A URI reference to an OAS operation. This field is mutually exclusive of the operationId field,
	// and MUST point to an Operation Object.
	OperationRef string `json:"operationRef,omitempty" yaml:"operationRef,omitempty"`
	// The name of an existing, resolvable OAS operation, as defined with a unique operationId. This
	// field is mutually exclusive of the operationRef field.
	OperationID string `json:"operationId,omitempty" yaml:"operationId,omitempty"`
	// A map representing parameters to pass to an operation as specified with operationId or
	// identified via operationRef. The key is the parameter name to be used (optionally qualified
	// with the parameter location, e.g. path.id for an id parameter in the path), whereas the value
	// can be a constant or an expression to be evaluated and passed to the linked operation.
	Parameters map[string]any `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	// A literal value or {expression} to use as a request body when calling the target operation.
	RequestBody any `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
	// A description of the link. CommonMark syntax MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// A server object to be used by the target operation.
	Server *Server `json:"server,omitempty" yaml:"server,omitempty"`
}

The Link Object represents a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.

See: https://spec.openapis.org/oas/v3.0.4.html#link-object

type MediaType

type MediaType struct {
	// The schema defining the content of the request, response, parameter, or header.
	Schema *Schema `json:"schema,omitempty" yaml:"schema,omitempty"`
	// Example of the media type; see Working With Examples.
	Example any `json:"example,omitempty" yaml:"example,omitempty"`
	// Examples of the media type; see Working With Examples.
	Examples map[string]*Example `json:"examples,omitempty" yaml:"examples,omitempty"`
	// A map between a property name and its encoding information. The key, being the property name,
	// MUST exist in the schema as a property. The encoding field SHALL only apply to Request Body
	// Objects, and only when the media type is multipart or application/x-www-form-urlencoded.
	// If no Encoding Object is provided for a property, the behavior is determined by the default
	// values documented for the Encoding Object.
	Encoding map[string]*Encoding `json:"encoding,omitempty" yaml:"encoding,omitempty"`
}

Each Media Type Object provides schema and examples for the media type identified by its key.

See: https://spec.openapis.org/oas/v3.0.4.html#media-type-object

type OAuthFlow

type OAuthFlow struct {
	// REQUIRED (oauth2 "implicit", "authorizationCode"). The authorization URL to be used for this flow.
	// This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
	AuthorizationURL string `json:"authorizationUrl,omitempty" yaml:"authorizationUrl,omitempty"`
	// REQUIRED (oauth2 "password", "clientCredentials", "authorizationCode"). The token URL to be used
	// for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.
	TokenURL string `json:"tokenUrl,omitempty" yaml:"tokenUrl,omitempty"`
	// The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2
	// standard requires the use of TLS.
	RefreshURL string `json:"refreshUrl,omitempty" yaml:"refreshUrl,omitempty"`
	// REQUIRED. The available scopes for the OAuth2 security scheme. A map between the scope name and
	// a short description for it. The map MAY be empty.
	Scopes map[string]string `json:"scopes" yaml:"scopes"`
}

OAuth Flow Object

Configuration details for a supported OAuth Flow

See: https://spec.openapis.org/oas/v3.0.4.html#oauth-flow-object

type OAuthFlows

type OAuthFlows struct {
	// Configuration for the OAuth Implicit flow
	Implicit *OAuthFlow `json:"implicit,omitempty" yaml:"implicit,omitempty"`
	// Configuration for the OAuth Resource Owner Password flow
	Password *OAuthFlow `json:"password,omitempty" yaml:"password,omitempty"`
	// Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0.
	ClientCredentials *OAuthFlow `json:"clientCredentials,omitempty" yaml:"clientCredentials,omitempty"`
	// Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.
	AuthorizationCode *OAuthFlow `json:"authorizationCode,omitempty" yaml:"authorizationCode,omitempty"`
}

OAuth Flows Object

Allows configuration of the supported OAuth Flows.

See: https://spec.openapis.org/oas/v3.0.4.html#oauth-flows-object

type OpenAPI

type OpenAPI struct {
	// REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI
	// Document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI Document.
	// This is not related to the API info.version string.
	OpenAPI string `json:"openapi" yaml:"openapi"`
	// REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required.
	Info *Info `json:"info,omitempty" yaml:"info,omitempty"`
	// The default value for the $schema keyword within Schema Objects contained within this OAS
	// document. This MUST be in the form of a URI.
	JSONSchemaDialect string `json:"jsonSchemaDialect,omitempty" yaml:"jsonSchemaDialect,omitempty"`
	// An array of Server Objects, which provide connectivity information to a target server. If the
	// servers field is not provided, or is an empty array, the default value would be a Server Object
	// with a url value of /.
	Servers []*Server `json:"servers,omitempty" yaml:"servers,omitempty"`
	// REQUIRED. The available paths and operations for the API.
	Paths *Paths `json:"paths,omitempty" yaml:"paths,omitempty"`
	// The incoming webhooks that MAY be received as part of this API and that the API consumer MAY
	// choose to implement. A map of webhook name to PathItem Object describing the request that may
	// be initiated by the API provider.
	Webhooks map[string]*PathItem `json:"webhooks,omitempty" yaml:"webhooks,omitempty"`
	// An element to hold various Objects for the OpenAPI Description.
	Components *Components `json:"components,omitempty" yaml:"components,omitempty"`
	// A declaration of which security mechanisms can be used across the API. The list of values includes
	// alternative Security Requirement Objects that can be used. Only one of the Security Requirement
	// Objects need to be satisfied to authorize a request. Individual operations can override this
	// definition. The list can be incomplete, up to being empty or absent. To make security explicitly
	// optional, an empty security requirement ({}) can be included in the array.
	Security []*SecurityRequirement `json:"security,omitempty" yaml:"security,omitempty"`
	// A list of tags used by the OpenAPI Description with additional metadata. The order of the tags can
	// be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation
	// Object must be declared. The tags that are not declared MAY be organized randomly or based on the
	// tools' logic. Each tag name in the list MUST be unique.
	Tags []*Tag `json:"tags,omitempty" yaml:"tags,omitempty"`
	// Additional external documentation.
	ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}

This is the root object of the OpenAPI Description.

See: https://spec.openapis.org/oas/v3.1.1.html#openapi-object

type Operation

type Operation struct {
	// A list of tags for API documentation control. Tags can be used for logical grouping of
	// operations by resources or any other qualifier.
	Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	// A short summary of what the operation does.
	Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
	// A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text
	// representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Additional external documentation for this operation.
	ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	// Unique string used to identify the operation. The id MUST be unique among all operations
	// described in the API. The operationId value is case-sensitive. Tools and libraries MAY use
	// the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow
	// common programming naming conventions.
	OperationID string `json:"operationId,omitempty" yaml:"operationId,omitempty"`
	// A list of parameters that are applicable for this operation. If a parameter is already defined
	// in the Path Item, the new definition will override it but can never remove it. The list MUST NOT
	// include duplicated parameters. A unique parameter is defined by a combination of a name and
	// location. The list can use the Reference Object to link to parameters that are defined in the
	// OpenAPI Object's components.parameters.
	Parameters []*Parameter `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	// The request body applicable for this operation. The requestBody is only supported in HTTP
	// methods where the HTTP 1.1 specification RFC7231 has explicitly defined semantics for request
	// bodies. In other cases where the HTTP spec is vague (such as GET, HEAD and DELETE), requestBody
	// SHALL be ignored by consumers.
	RequestBody *RequestBody `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
	// REQUIRED. The list of possible responses as they are returned from executing this operation.
	Responses *Responses `json:"responses" yaml:"responses"`
	// A map of possible out-of band callbacks related to the parent operation. The key is a unique
	// identifier for the Callback Object. Each value in the map is a Callback Object that describes
	// a request that may be initiated by the API provider and the expected responses.
	Callbacks map[string]*Callback `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
	// Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared
	// operation. Default value is false.
	Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	// A declaration of which security mechanisms can be used for this operation. The list of values
	// includes alternative Security Requirement Objects that can be used. Only one of the Security
	// Requirement Objects need to be satisfied to authorize a request. To make security optional,
	// an empty security requirement ({}) can be included in the array. This definition overrides any
	// declared top-level security. To remove a top-level security declaration, an empty array can be used.
	Security []*SecurityRequirement `json:"security,omitempty" yaml:"security,omitempty"`
	// An alternative servers array to service this operation. If a servers array is specified at the
	// Path Item Object or OpenAPI Object level, it will be overridden by this value.
	Servers []*Server `json:"servers,omitempty" yaml:"servers,omitempty"`
}

Describes a single API operation on a path.

See: https://spec.openapis.org/oas/v3.0.4.html#operation-object

type Parameter

type Parameter struct {
	// A reference to a parameter defined in components/parameters.
	Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`

	// REQUIRED. The name of the parameter. Parameter names are case sensitive.
	// If in is "path", the name field MUST correspond to a template expression occurring within the
	// path field in the Paths Object. See Path Templating for further information.
	// If in is "header" and the name field is "Accept", "Content-Type" or "Authorization", the
	// parameter definition SHALL be ignored.
	// For all other cases, the name corresponds to the parameter name used by the in field.
	Name string `json:"name" yaml:"name"`
	// REQUIRED. The location of the parameter. Possible values are "query", "header", "path" or "cookie".
	In string `json:"in" yaml:"in"`
	// A brief description of the parameter. This could contain examples of use. CommonMark syntax
	// MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Determines whether this parameter is mandatory. If the parameter location is "path", this field
	// is REQUIRED and its value MUST be true. Otherwise, the field MAY be included and its default
	// value is false.
	Required bool `json:"required,omitempty" yaml:"required,omitempty"`
	// Specifies that a parameter is deprecated and SHOULD be transitioned out of usage. Default value
	// is false.
	Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	// If true, clients MAY pass a zero-length string value in place of parameters that would otherwise
	// be omitted entirely, which the server SHOULD interpret as the parameter being unused. Default
	// value is false. This field is valid only for query parameters. Use of this field is NOT
	// RECOMMENDED, and it is likely to be removed in a later revision.
	AllowEmptyValue bool `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"`
	// Describes how the parameter value will be serialized depending on the type of the parameter
	// value. Default values (based on value of in): for "query" - "form"; for "path" - "simple";
	// for "header" - "simple"; for "cookie" - "form".
	Style string `json:"style,omitempty" yaml:"style,omitempty"`
	// When this is true, parameter values of type array or object generate separate parameters for
	// each value of the array or key-value pair of the map. For other types of parameters this field
	// has no effect. When style is "form", the default value is true. For all other styles, the
	// default value is false.
	Explode *bool `json:"explode,omitempty" yaml:"explode,omitempty"`
	// When this is true, parameter values are serialized using reserved expansion, as defined by
	// RFC6570, which allows RFC3986's reserved character set, as well as percent-encoded triples,
	// to pass through unchanged. This field only applies to parameters with an in value of query.
	// The default value is false.
	AllowReserved bool `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
	// The schema defining the type used for the parameter.
	Schema *Schema `json:"schema,omitempty" yaml:"schema,omitempty"`
	// Example of the parameter's potential value; see Working With Examples.
	Example any `json:"example,omitempty" yaml:"example,omitempty"`
	// Examples of the parameter's potential value; see Working With Examples.
	Examples map[string]*Example `json:"examples,omitempty" yaml:"examples,omitempty"`
	// A map containing the representations for the parameter. The key is the media type and the value
	// describes it. The map MUST only contain one entry.
	Content map[string]*MediaType `json:"content,omitempty" yaml:"content,omitempty"`
}

Describes a single operation parameter. A unique parameter is defined by a combination of a name and location.

See: https://spec.openapis.org/oas/v3.0.4.html#parameter-object

type PathItem

type PathItem struct {
	// Allows for a referenced definition of this path item. The value MUST be in the form of a URL,
	// and the referenced structure MUST be in the form of a Path Item Object. In case a Path Item
	// Object field appears both in the defined object and the referenced object, the behavior is
	// undefined. See the rules for resolving Relative References.
	Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	// An optional string summary, intended to apply to all operations in this path.
	Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
	// An optional string description, intended to apply to all operations in this path. CommonMark
	// syntax MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// A definition of a GET operation on this path.
	Get *Operation `json:"get,omitempty" yaml:"get,omitempty"`
	// A definition of a PUT operation on this path.
	Put *Operation `json:"put,omitempty" yaml:"put,omitempty"`
	// A definition of a POST operation on this path.
	Post *Operation `json:"post,omitempty" yaml:"post,omitempty"`
	// A definition of a DELETE operation on this path.
	Delete *Operation `json:"delete,omitempty" yaml:"delete,omitempty"`
	// A definition of a OPTIONS operation on this path.
	Options *Operation `json:"options,omitempty" yaml:"options,omitempty"`
	// A definition of a HEAD operation on this path.
	Head *Operation `json:"head,omitempty" yaml:"head,omitempty"`
	// A definition of a PATCH operation on this path.
	Patch *Operation `json:"patch,omitempty" yaml:"patch,omitempty"`
	// A definition of a TRACE operation on this path.
	Trace *Operation `json:"trace,omitempty" yaml:"trace,omitempty"`
	// An alternative servers array to service all operations in this path. If a servers array is
	// specified at the OpenAPI Object level, it will be overridden by this value.
	Servers []*Server `json:"servers,omitempty" yaml:"servers,omitempty"`
	// A list of parameters that are applicable for all the operations described under this path.
	// These parameters can be overridden at the operation level, but cannot be removed there.
	// The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination
	// of a name and location. The list can use the Reference Object to link to parameters that are
	// defined in the OpenAPI Object's components.parameters.
	Parameters []*Parameter `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}

Describes the operations available on a single path. A Path Item MAY be empty, due to ACL constraints. The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.

See: https://spec.openapis.org/oas/v3.0.4.html#path-item-object

type Paths

type Paths struct {
	// A relative path to an individual endpoint. The field name MUST begin with a forward slash (/).
	// The path is appended (no relative URL resolution) to the expanded URL from the Server Object's
	// url field in order to construct the full URL. Path templating is allowed. When matching URLs,
	// concrete (non-templated) paths would be matched before their templated counterparts. Templated
	// paths with the same hierarchy but different templated names MUST NOT exist as they are identical.
	// In case of ambiguous matching, it's up to the tooling to decide which one to use.
	PathItems map[string]*PathItem `json:"-" yaml:"-"`
}

Holds the relative paths to the individual endpoints and their operations. The path is appended to the URL from the Server Object in order to construct the full URL. The Paths Object MAY be empty, due to Access Control List (ACL) constraints.

See: https://spec.openapis.org/oas/v3.0.4.html#paths-object

func (*Paths) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface. It marshals the PathItems map directly as the Paths object.

func (*Paths) MarshalYAML

func (p *Paths) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface. It marshals the PathItems map directly as the Paths object.

func (*Paths) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaler interface. It unmarshals the JSON directly into the PathItems map.

func (*Paths) UnmarshalYAML

func (p *Paths) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface. It unmarshals the YAML directly into the PathItems map.

type Reference

type Reference struct {
	// REQUIRED. The reference string.
	Ref string `json:"$ref" yaml:"$ref"`
}

A simple object to allow referencing other components in the OpenAPI Description, internally and externally.

The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. For this specification, reference resolution is accomplished as defined by the JSON Reference specification and not by the JSON Schema specification.

See: https://spec.openapis.org/oas/v3.0.4.html#reference-object

type RequestBody

type RequestBody struct {
	// A brief description of the request body. This could contain examples of use. CommonMark syntax
	// MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// REQUIRED. The content of the request body. The key is a media type or media type range and the
	// value describes it. For requests that match multiple keys, only the most specific key is
	// applicable. e.g. "text/plain" overrides "text/*"
	Content map[string]*MediaType `json:"content" yaml:"content"`
	// Determines if the request body is required in the request. Defaults to false.
	Required bool `json:"required,omitempty" yaml:"required,omitempty"`
}

Describes a single request body.

See: https://spec.openapis.org/oas/v3.0.4.html#request-body-object

type Response

type Response struct {
	// REQUIRED. A description of the response. CommonMark syntax MAY be used for rich text
	// representation.
	Description string `json:"description" yaml:"description"`
	// Maps a header name to its definition. RFC7230 states header names are case insensitive. If a
	// response header is defined with the name "Content-Type", it SHALL be ignored.
	Headers map[string]*Header `json:"headers,omitempty" yaml:"headers,omitempty"`
	// A map containing descriptions of potential response payloads. The key is a media type or media
	// type range and the value describes it. For responses that match multiple keys, only the most
	// specific key is applicable. e.g. "text/plain" overrides "text/*"
	Content map[string]*MediaType `json:"content,omitempty" yaml:"content,omitempty"`
	// A map of operations links that can be followed from the response. The key of the map is a short
	// name for the link, following the naming constraints of the names for Component Objects.
	Links map[string]*Link `json:"links,omitempty" yaml:"links,omitempty"`
}

Describes a single response from an API operation, including design-time, static links to operations based on the response.

See: https://spec.openapis.org/oas/v3.0.4.html#response-object

type Responses

type Responses struct {
	// The documentation of responses other than the ones declared for specific HTTP response codes.
	// Use this field to cover undeclared responses.
	Default *Response `json:"default,omitempty" yaml:"default,omitempty"`
	// Any HTTP status code can be used as the property name, but only one property per code, to
	// describe the expected response for that HTTP status code. This field MUST be enclosed in
	// quotation marks (for example, "200") for compatibility between JSON and YAML. To define a
	// range of response codes, this field MAY contain the uppercase wildcard character X. For
	// example, 2XX represents all response codes between 200 and 299.
	StatusCodes map[string]*Response `json:"-" yaml:"-"`
}

A container for the expected responses of an operation. The container maps a HTTP response code to the expected response.

The documentation is not necessarily expected to cover all possible HTTP response codes because they may not be known in advance. However, documentation is expected to cover a successful operation response and any known errors.

The default MAY be used as a default Response Object for all HTTP codes that are not covered individually by the Responses Object.

The Responses Object MUST contain at least one response code, and if only one response code is provided it SHOULD be the response for a successful operation call.

See: https://spec.openapis.org/oas/v3.0.4.html#responses-object

func (*Responses) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface. It marshals the StatusCodes map and Default response into a single JSON object.

func (*Responses) MarshalYAML

func (r *Responses) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface. It marshals the StatusCodes map and Default response into a single YAML object.

func (*Responses) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaler interface. It unmarshals a JSON object into StatusCodes map and Default response.

func (*Responses) UnmarshalYAML

func (r *Responses) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface. It unmarshals a YAML node into StatusCodes map and Default response.

type Schema

type Schema struct {
	// A reference to another schema. If present, other properties are ignored.
	Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`

	// The JSON Schema dialect for this schema.
	Schema string `json:"$schema,omitempty" yaml:"$schema,omitempty"`
	// Inline schema definitions (replaces "definitions").
	Defs map[string]*Schema `json:"$defs,omitempty" yaml:"$defs,omitempty"`
	// Plain name anchor for this schema.
	Anchor string `json:"$anchor,omitempty" yaml:"$anchor,omitempty"`
	// A comment for schema maintainers.
	Comment string `json:"$comment,omitempty" yaml:"$comment,omitempty"`

	// The title of the schema.
	Title string `json:"title,omitempty" yaml:"title,omitempty"`
	// A number that the value must be a multiple of.
	MultipleOf *float64 `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"`
	// The maximum value for a number (inclusive).
	Maximum *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty"`
	// The exclusive maximum value for a number. In JSON Schema 2020-12, this is a numeric value
	// (not a boolean as in draft-04/OpenAPI 3.0).
	ExclusiveMaximum *float64 `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"`
	// The minimum value for a number (inclusive).
	Minimum *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty"`
	// The exclusive minimum value for a number. In JSON Schema 2020-12, this is a numeric value
	// (not a boolean as in draft-04/OpenAPI 3.0).
	ExclusiveMinimum *float64 `json:"exclusiveMinimum,omitempty" yaml:"exclusiveMinimum,omitempty"`
	// The maximum length for a string.
	MaxLength *uint64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`
	// The minimum length for a string.
	MinLength uint64 `json:"minLength,omitempty" yaml:"minLength,omitempty"`
	// A regular expression that a string value must match. This string SHOULD be a valid regular
	// expression, according to the Ecma-262 Edition 5.1 regular expression dialect.
	Pattern string `json:"pattern,omitempty" yaml:"pattern,omitempty"`
	// The maximum number of items in an array.
	MaxItems *uint64 `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
	// The minimum number of items in an array.
	MinItems *uint64 `json:"minItems,omitempty" yaml:"minItems,omitempty"`
	// Indicates whether items in an array must be unique.
	UniqueItems bool `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"`
	// The maximum number of properties in an object.
	MaxProperties *uint64 `json:"maxProperties,omitempty" yaml:"maxProperties,omitempty"`
	// The minimum number of properties in an object.
	MinProperties *uint64 `json:"minProperties,omitempty" yaml:"minProperties,omitempty"`
	// A list of required properties when type is "object".
	Required []string `json:"required,omitempty" yaml:"required,omitempty"`
	// The enumeration of possible values.
	Enum []any `json:"enum,omitempty" yaml:"enum,omitempty"`
	// A constant value that the instance must be equal to.
	Const any `json:"const,omitempty" yaml:"const,omitempty"`

	// Value can be a string or array of strings. In OpenAPI 3.1, type can be
	// ["string", "null"] to express nullable types (replacing the removed nullable keyword).
	Type SchemaType `json:"type,omitzero" yaml:"type,omitempty"`
	// Inline or referenced schema MUST be of a Schema Object.
	AllOf []*Schema `json:"allOf,omitempty" yaml:"allOf,omitempty"`
	// Inline or referenced schema MUST be of a Schema Object.
	OneOf []*Schema `json:"oneOf,omitempty" yaml:"oneOf,omitempty"`
	// Inline or referenced schema MUST be of a Schema Object.
	AnyOf []*Schema `json:"anyOf,omitempty" yaml:"anyOf,omitempty"`
	// Inline or referenced schema MUST be of a Schema Object.
	Not *Schema `json:"not,omitempty" yaml:"not,omitempty"`
	// Conditional schema — if this schema validates, apply Then.
	If *Schema `json:"if,omitempty" yaml:"if,omitempty"`
	// Conditional schema — applied when If validates.
	Then *Schema `json:"then,omitempty" yaml:"then,omitempty"`
	// Conditional schema — applied when If does not validate.
	Else *Schema `json:"else,omitempty" yaml:"else,omitempty"`
	// Schemas that apply when a specific property is present.
	DependentSchemas map[string]*Schema `json:"dependentSchemas,omitempty" yaml:"dependentSchemas,omitempty"`
	// Ordered tuple validation for array items (replaces positional items from older drafts).
	PrefixItems []*Schema `json:"prefixItems,omitempty" yaml:"prefixItems,omitempty"`
	// Schema for array items. In 3.1 this applies to items after prefixItems.
	Items *Schema `json:"items,omitempty" yaml:"items,omitempty"`
	// Schema that at least one array item must match.
	Contains *Schema `json:"contains,omitempty" yaml:"contains,omitempty"`
	// Property definitions MUST be a Schema Object (inline or referenced).
	Properties map[string]*Schema `json:"properties,omitempty" yaml:"properties,omitempty"`
	// Value can be boolean or object. Inline or referenced schema MUST be of a Schema Object.
	// Consistent with JSON Schema, additionalProperties defaults to true.
	AdditionalProperties *Schema `json:"additionalProperties,omitempty" yaml:"additionalProperties,omitempty"`
	// Applies to properties not evaluated by other keywords (e.g., allOf/properties).
	UnevaluatedProperties *Schema `json:"unevaluatedProperties,omitempty" yaml:"unevaluatedProperties,omitempty"`
	// Applies to array items not evaluated by other keywords (e.g., prefixItems/items).
	UnevaluatedItems *Schema `json:"unevaluatedItems,omitempty" yaml:"unevaluatedItems,omitempty"`

	// The media type of the string content (e.g., "application/octet-stream" for file uploads).
	// Replaces the OpenAPI 3.0 pattern of using format: binary.
	ContentMediaType string `json:"contentMediaType,omitempty" yaml:"contentMediaType,omitempty"`
	// The encoding of the string content (e.g., "base64").
	ContentEncoding string `json:"contentEncoding,omitempty" yaml:"contentEncoding,omitempty"`

	// CommonMark syntax MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// See Data Type Formats for further details. While relying on JSON Schema's defined formats, the
	// OAS offers a few additional predefined formats.
	Format string `json:"format,omitempty" yaml:"format,omitempty"`
	// The default value represents what would be assumed by the consumer of the input as the value of
	// the schema if one is not provided.
	Default any `json:"default,omitempty" yaml:"default,omitempty"`
	// An array of examples. Replaces the singular "example" keyword from OpenAPI 3.0.
	Examples []any `json:"examples,omitempty" yaml:"examples,omitempty"`

	// Adds support for polymorphism. The discriminator is used to determine which of a set of schemas
	// a payload is expected to satisfy. See Composition and Inheritance for more details.
	Discriminator *Discriminator `json:"discriminator,omitempty" yaml:"discriminator,omitempty"`
	// Relevant only for Schema Object properties definitions. Declares the property as "read only".
	ReadOnly bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
	// Relevant only for Schema Object properties definitions. Declares the property as "write only".
	WriteOnly bool `json:"writeOnly,omitempty" yaml:"writeOnly,omitempty"`
	// This MAY be used only on property schemas. It has no effect on root schemas. Adds additional
	// metadata to describe the XML representation of this property.
	XML *XML `json:"xml,omitempty" yaml:"xml,omitempty"`
	// Additional external documentation for this schema.
	ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	// Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is
	// false.
	Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
}

The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 2020-12.

See: https://spec.openapis.org/oas/v3.1.1.html#schema-object

type SchemaType added in v0.1.13

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

SchemaType represents the JSON Schema "type" keyword which can be either a single string or an array of strings. In OpenAPI 3.1 (aligned with JSON Schema 2020-12), nullable types are expressed as ["string", "null"] instead of using the separate "nullable" keyword.

func NewSchemaType added in v0.1.13

func NewSchemaType(t string) SchemaType

NewSchemaType creates a SchemaType with a single type value.

func NewSchemaTypes added in v0.1.13

func NewSchemaTypes(types ...string) SchemaType

NewSchemaTypes creates a SchemaType with multiple type values.

func (SchemaType) Contains added in v0.1.13

func (st SchemaType) Contains(t string) bool

Contains returns true if the SchemaType contains the given type.

func (SchemaType) IsEmpty added in v0.1.13

func (st SchemaType) IsEmpty() bool

IsEmpty returns true if no types are set.

func (SchemaType) IsZero added in v0.1.13

func (st SchemaType) IsZero() bool

IsZero returns true if the SchemaType has no values (for omitzero support).

func (SchemaType) MarshalJSON added in v0.1.13

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

MarshalJSON implements json.Marshaler. Single value serializes as "string", multiple values as ["string", "null"].

func (SchemaType) MarshalYAML added in v0.1.13

func (st SchemaType) MarshalYAML() (any, error)

MarshalYAML implements yaml.Marshaler. Single value serializes as a scalar, multiple values as a sequence.

func (*SchemaType) UnmarshalJSON added in v0.1.13

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

UnmarshalJSON implements json.Unmarshaler. Accepts both "string" and ["string", "null"] forms.

func (*SchemaType) UnmarshalYAML added in v0.1.13

func (st *SchemaType) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements yaml.Unmarshaler. Accepts both scalar and sequence forms.

func (SchemaType) Value added in v0.1.13

func (st SchemaType) Value() string

Value returns the single type string. If multiple types are present, returns the first non-null type. Returns empty string if no types are set.

func (SchemaType) Values added in v0.1.13

func (st SchemaType) Values() []string

Values returns all type values.

func (SchemaType) WithNull added in v0.1.13

func (st SchemaType) WithNull() SchemaType

WithNull returns a new SchemaType that includes "null" in addition to existing types. If "null" is already present, returns the same SchemaType.

type SecurityRequirement

type SecurityRequirement struct {
	// Each name MUST correspond to a security scheme which is declared in the Security Schemes under
	// the Components Object. If the security scheme is of type "oauth2" or "openIdConnect", then the
	// value is a list of scope names required for the execution, and the list MAY be empty if
	// authorization does not require a specified scope. For other security scheme types, the array
	// MUST be empty.
	Requirements map[string][]string `json:"-" yaml:"-"`
}

Security Requirement Object

Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object.

A Security Requirement Object MAY refer to multiple security schemes in which case all schemes MUST be satisfied for a request to be authorized. This enables support for scenarios where multiple query parameters or HTTP headers are required to convey security information.

When the security field is defined on the OpenAPI Object or Operation Object and contains multiple Security Requirement Objects, only one of the entries in the list needs to be satisfied to authorize the request. This enables support for scenarios where the API allows multiple, independent security schemes.

An empty Security Requirement Object ({}) indicates anonymous access is supported.

See: https://spec.openapis.org/oas/v3.0.4.html#security-requirement-object

func (*SecurityRequirement) MarshalJSON

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

MarshalJSON implements the json.Marshaler interface. It marshals the Requirements map directly as the SecurityRequirement object.

func (*SecurityRequirement) MarshalYAML

func (s *SecurityRequirement) MarshalYAML() (any, error)

MarshalYAML implements the yaml.Marshaler interface. It marshals the Requirements map directly as the SecurityRequirement object.

func (*SecurityRequirement) UnmarshalJSON

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

UnmarshalJSON implements the json.Unmarshaler interface. It unmarshals the JSON directly into the Requirements map.

func (*SecurityRequirement) UnmarshalYAML

func (s *SecurityRequirement) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface. It unmarshals the YAML directly into the Requirements map.

type SecurityScheme

type SecurityScheme struct {
	// REQUIRED. The type of the security scheme. Valid values are "apiKey", "http", "oauth2", "openIdConnect".
	Type string `json:"type" yaml:"type"`
	// A description for security scheme. CommonMark syntax MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// REQUIRED (apiKey). The name of the header, query or cookie parameter to be used.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// REQUIRED (apiKey). The location of the API key. Valid values are "query", "header", or "cookie".
	In string `json:"in,omitempty" yaml:"in,omitempty"`
	// REQUIRED (http). The name of the HTTP Authentication scheme to be used in the Authorization header
	// as defined in RFC7235 Section 5.1. The values used SHOULD be registered in the IANA Authentication
	// Scheme registry. The value is case-insensitive, as defined in RFC7235 Section 2.1.
	Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
	// A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually
	// generated by an authorization server, so this information is primarily for documentation purposes.
	BearerFormat string `json:"bearerFormat,omitempty" yaml:"bearerFormat,omitempty"`
	// REQUIRED (oauth2). An object containing configuration information for the flow types supported.
	Flows *OAuthFlows `json:"flows,omitempty" yaml:"flows,omitempty"`
	// REQUIRED (openIdConnect). Well-known URL to discover the OpenID Connect Discovery provider metadata.
	OpenIdConnectUrl string `json:"openIdConnectUrl,omitempty" yaml:"openIdConnectUrl,omitempty"`
}

Security Scheme Object

Defines a security scheme that can be used by the operations.

Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter, or as a query parameter), OAuth2's common flows (implicit, password, client credentials, and authorization code) as defined in RFC6749, and OpenID Connect Discovery.

Please note that as of 2020, the implicit flow is about to be deprecated by OAuth 2.0 Security Best Current Practice. Recommended for most use cases is Authorization Code Grant flow with PKCE.

See: https://spec.openapis.org/oas/v3.0.4.html#security-scheme-object

type Server

type Server struct {
	// REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative,
	// to indicate that the host location is relative to the location where the document containing
	// the Server Object is being served. Variable substitutions will be made when a variable is
	// named in {braces}.
	URL string `json:"url" yaml:"url"`
	// An optional string describing the host designated by the URL. CommonMark syntax MAY be used
	// for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// A map between a variable name and its value. The value is used for substitution in the
	// server's URL template.
	Variables map[string]*ServerVariable `json:"variables,omitempty" yaml:"variables,omitempty"`
}

An object representing a Server.

See: https://spec.openapis.org/oas/v3.0.4.html#server-object

type ServerVariable

type ServerVariable struct {
	// An enumeration of string values to be used if the substitution options are from a limited set.
	// The array SHOULD NOT be empty.
	Enum []string `json:"enum,omitempty" yaml:"enum,omitempty"`
	// REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value
	// is not supplied. If the enum is defined, the value SHOULD exist in the enum's values. Note that
	// this behavior is different from the Schema Object's default keyword, which documents the
	// receiver's behavior rather than inserting the value into the data.
	Default string `json:"default" yaml:"default"`
	// An optional description for the server variable. CommonMark syntax MAY be used for rich text
	// representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
}

An object representing a Server Variable for server URL template substitution.

See: https://spec.openapis.org/oas/v3.0.4.html#server-variable-object

type Tag

type Tag struct {
	// REQUIRED. The name of the tag.
	Name string `json:"name" yaml:"name"`
	// A description for the tag. CommonMark syntax MAY be used for rich text representation.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	// Additional external documentation for this tag.
	ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}

Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a Tag Object per tag defined in the Operation Object instances.

See: https://spec.openapis.org/oas/v3.0.4.html#tag-object

type XML

type XML struct {
	// Replaces the name of the element/attribute used for the described schema property. When defined
	// within items, it will affect the name of the individual XML elements within the list. When defined
	// alongside type being "array" (outside the items), it will affect the wrapping element if and only
	// if wrapped is true. If wrapped is false, it will be ignored.
	Name string `json:"name,omitempty" yaml:"name,omitempty"`
	// The URI of the namespace definition. Value MUST be in the form of a non-relative URI.
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	// The prefix to be used for the name.
	Prefix string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
	// Declares whether the property definition translates to an attribute instead of an element.
	// Default value is false.
	Attribute bool `json:"attribute,omitempty" yaml:"attribute,omitempty"`
	// MAY be used only for an array definition. Signifies whether the array is wrapped (for example,
	// <books><book/><book/></books>) or unwrapped (<book/><book/>). Default value is false. The definition
	// takes effect only when defined alongside type being "array" (outside the items).
	Wrapped bool `json:"wrapped,omitempty" yaml:"wrapped,omitempty"`
}

XML Object

A metadata object that allows for more fine-tuned XML model definitions.

When using arrays, XML element names are not inferred (for singular/plural forms) and the name field SHOULD be used to add that information. See examples for expected behavior.

See: https://spec.openapis.org/oas/v3.0.4.html#xml-object

Jump to

Keyboard shortcuts

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