package openapi3 // import "github.com/getkin/kin-openapi/openapi3"

Package openapi3 parses and writes OpenAPI 3 specification documents.

Supports both OpenAPI 3.0 and OpenAPI 3.1:
  - OpenAPI 3.0.x:
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md
  - OpenAPI 3.1.x:
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md

OpenAPI 3.1 Features:
  - Type arrays with null support (e.g., ["string", "null"])
  - JSON Schema 2020-12 keywords (const, examples, prefixItems, etc.)
  - Webhooks for defining callback operations
  - JSON Schema dialect specification
  - SPDX license identifiers

The implementation maintains 100% backward compatibility with OpenAPI 3.0.

For OpenAPI 3.1 validation, use the JSON Schema 2020-12 validator option:

    schema.VisitJSON(value, openapi3.EnableJSONSchema2020())

Version detection is available via helper methods:

    if doc.IsOpenAPI31OrLater() {
        // Handle OpenAPI 3.1 specific features
    }

Code generated by go generate using refs.tmpl; DO NOT EDIT refs.go.

CONSTANTS

const (
	ParameterInPath   = "path"
	ParameterInQuery  = "query"
	ParameterInHeader = "header"
	ParameterInCookie = "cookie"
)
const (
	TypeArray   = "array"
	TypeBoolean = "boolean"
	TypeInteger = "integer"
	TypeNumber  = "number"
	TypeObject  = "object"
	TypeString  = "string"
	TypeNull    = "null"
)
const (
	// FormatOfStringForUUIDOfRFC4122 is an optional predefined format for UUID v1-v5 as specified by RFC4122
	FormatOfStringForUUIDOfRFC4122 = `^(?:[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$`

	// FormatOfStringForEmail pattern catches only some suspiciously wrong-looking email addresses.
	// Use DefineStringFormat(...) if you need something stricter.
	FormatOfStringForEmail = `^[^@]+@[^@<>",\s]+$`

	// FormatOfStringByte is a regexp for base64-encoded characters, for example, "U3dhZ2dlciByb2Nrcw=="
	FormatOfStringByte = `(^$|^[a-zA-Z0-9+/\-_]*=*$)`

	// FormatOfStringDate is a RFC3339 date format regexp, for example "2017-07-21".
	FormatOfStringDate = `^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])$`

	// FormatOfStringDateTime is a RFC3339 date-time format regexp, for example "2017-07-21T17:32:28Z".
	FormatOfStringDateTime = `^[0-9]{4}-(0[1-9]|10|11|12)-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)[0-9]{2}:[0-9]{2})$`
)
const (
	SerializationSimple         = "simple"
	SerializationLabel          = "label"
	SerializationMatrix         = "matrix"
	SerializationForm           = "form"
	SerializationSpaceDelimited = "spaceDelimited"
	SerializationPipeDelimited  = "pipeDelimited"
	SerializationDeepObject     = "deepObject"
)

VARIABLES

var (
	IdentifierRegExp            = regexp.MustCompile(`^[` + identifierChars + `]+$`)
	InvalidIdentifierCharRegExp = regexp.MustCompile(`[^` + identifierChars + `]`)
)
    IdentifierRegExp verifies whether Component object key matches contains just
    'identifierChars', according to OpenAPI v3.x. InvalidIdentifierCharRegExp
    matches all characters not contained in 'identifierChars'. However, to be
    able supporting legacy OpenAPI v2.x, there is a need to customize above
    pattern in order not to fail converted v2-v3 validation

var (
	// SchemaErrorDetailsDisabled disables printing of details about schema errors.
	SchemaErrorDetailsDisabled = false

	// ErrOneOfConflict is the SchemaError Origin when data matches more than one oneOf schema
	ErrOneOfConflict = errors.New("input matches more than one oneOf schemas")

	// ErrSchemaInputNaN may be returned when validating a number
	ErrSchemaInputNaN = errors.New("floating point NaN is not allowed")
	// ErrSchemaInputInf may be returned when validating a number
	ErrSchemaInputInf = errors.New("floating point Inf is not allowed")
)
var (
	// SchemaStringFormats is a map of custom string format validators.
	SchemaStringFormats = make(map[string]StringFormatValidator)
	// SchemaNumberFormats is a map of custom number format validators.
	SchemaNumberFormats = make(map[string]NumberFormatValidator)
	// SchemaIntegerFormats is a map of custom integer format validators.
	SchemaIntegerFormats = make(map[string]IntegerFormatValidator)
)
var DefaultReadFromURI = URIMapCache(ReadFromURIs(ReadFromHTTP(http.DefaultClient), ReadFromFile))
    DefaultReadFromURI returns a caching ReadFromURIFunc which can read remote
    HTTP URIs and local file URIs.

var ErrURINotSupported = errors.New("unsupported URI")
    ErrURINotSupported indicates the ReadFromURIFunc does not know how to handle
    a given URI.

var IncludeOrigin = false
    IncludeOrigin specifies whether to include the origin of the OpenAPI
    elements. Deprecated: set Loader.IncludeOrigin instead. This global is read
    by NewLoader for backward compatibility but is not safe for concurrent use.


FUNCTIONS

func BoolPtr(value bool) *bool
    BoolPtr is a helper for defining OpenAPI schemas.

    Deprecated: Use Ptr instead.

func DefaultRefNameResolver(doc *T, ref ComponentRef) string
    DefaultRefResolver is a default implementation of refNameResolver for the
    InternalizeRefs function.

    The external reference is internalized to (hopefully) a unique name.
    If the external reference matches (by path) to another reference in the root
    document then the name of that component is used.

    The transformation involves:
      - Cutting the "#/components/<type>" part.
      - Cutting the file extensions (.yaml/.json) from documents.
      - Trimming the common directory with the root spec.
      - Replace invalid characters with underscores.

    This is an injective mapping over a "reasonable" amount of the possible
    openapi spec domain space but is not perfect. There might be edge cases.

func DefineIPv4Format()
    DefineIPv4Format opts in ipv4 format validation on top of OAS 3 spec

func DefineIPv6Format()
    DefineIPv6Format opts in ipv6 format validation on top of OAS 3 spec

func DefineIntegerFormatValidator(name string, validator IntegerFormatValidator)
    DefineIntegerFormatValidator defines a custom format validator for a given
    integer format.

func DefineNumberFormatValidator(name string, validator NumberFormatValidator)
    DefineNumberFormatValidator defines a custom format validator for a given
    number format.

func DefineStringFormat(name string, pattern string)
    DefineStringFormat defines a regexp pattern for a given string format

    Deprecated: Use openapi3.DefineStringFormatValidator(name,
    NewRegexpFormatValidator(pattern)) instead.

func DefineStringFormatCallback(name string, callback func(string) error)
    DefineStringFormatCallback defines a callback function for a given string
    format

    Deprecated: Use openapi3.DefineStringFormatValidator(name,
    NewCallbackValidator(fn)) instead.

func DefineStringFormatValidator(name string, validator StringFormatValidator)
    DefineStringFormatValidator defines a custom format validator for a given
    string format.

func Float64Ptr(value float64) *float64
    Float64Ptr is a helper for defining OpenAPI schemas.

    Deprecated: Use Ptr instead.

func Int64Ptr(value int64) *int64
    Int64Ptr is a helper for defining OpenAPI schemas.

    Deprecated: Use Ptr instead.

func Ptr[T any](value T) *T
    Ptr is a helper for defining OpenAPI schemas.

func ReadFromFile(loader *Loader, location *url.URL) ([]byte, error)
    ReadFromFile is a ReadFromURIFunc which reads local file URIs.

func ReferencesComponentInRootDocument(doc *T, ref ComponentRef) (string, bool)
    ReferencesComponentInRootDocument returns if the given component reference
    references the same document or element as another component reference in
    the root document's '#/components/<type>'. If it does, it returns the name
    of it in the form '#/components/<type>/NameXXX'

    Of course given a component from the root document will always match itself.

    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#reference-object
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#relative-references-in-urls

    Example. Take the spec with directory structure:

        openapi.yaml
        schemas/
        ├─ record.yaml
        ├─ records.yaml

    In openapi.yaml we have:

        components:
          schemas:
            Record:
              $ref: schemas/record.yaml

    Case 1: records.yml references a component in the root document

        $ref: ../openapi.yaml#/components/schemas/Record

    This would return...

        #/components/schemas/Record

    Case 2: records.yml indirectly refers to the same schema as a schema the
    root document's '#/components/schemas'.

        $ref: ./record.yaml

    This would also return...

        #/components/schemas/Record

func RegisterArrayUniqueItemsChecker(fn SliceUniqueItemsChecker)
    RegisterArrayUniqueItemsChecker is used to register a customized function
    used to check if JSON array have unique items.

func Uint64Ptr(value uint64) *uint64
    Uint64Ptr is a helper for defining OpenAPI schemas.

    Deprecated: Use Ptr instead.

func ValidateIdentifier(value string) error
    ValidateIdentifier returns an error if the given component name does not
    match IdentifierRegExp.

func WithValidationOptions(ctx context.Context, opts ...ValidationOption) context.Context
    WithValidationOptions allows adding validation options to a context object
    that can be used when validating any OpenAPI type.


TYPES

type APIKeyInInvalidError struct {
	// Value is the rejected `in:` value (empty when the field was
	// omitted, otherwise the bad value e.g. "body").
	Value string
	// Origin is the source location of the offending security scheme
	// when the document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    APIKeyInInvalidError clusters "apiKey should have 'in'. It can be 'query',
    'header' or 'cookie', not X" failures. Fires when an apiKey security scheme
    either omits `in:` or sets it to a value outside {query, header, cookie}.
    Carries the rejected value so callers can render or filter; empty string
    means the field was missing entirely.

func (e *APIKeyInInvalidError) Error() string

type APIKeySecuritySchemeNameRequired struct{ ValidationError }

func (e *APIKeySecuritySchemeNameRequired) As(target any) bool

type AdditionalProperties = BoolSchema
    AdditionalProperties is a type alias for BoolSchema, kept for backward
    compatibility.

type AnchorFieldFor31Plus struct{ ValidationError }

func (e *AnchorFieldFor31Plus) As(target any) bool

type BoolSchema struct {
	Has    *bool
	Schema *SchemaRef
}
    BoolSchema represents a JSON Schema keyword that can be either a boolean
    or a schema object. Used for additionalProperties, unevaluatedProperties,
    and unevaluatedItems.

func (bs BoolSchema) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of BoolSchema.

func (bs BoolSchema) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of BoolSchema.

func (bs *BoolSchema) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets BoolSchema to a copy of data.

type Callback struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	// Has unexported fields.
}
    Callback is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object

func NewCallback(opts ...NewCallbackOption) *Callback
    NewCallback builds a Callback object with path items in insertion order.

func NewCallbackWithCapacity(cap int) *Callback
    NewCallbackWithCapacity builds a callback object of the given capacity.

func (callback *Callback) Delete(key string)
    Delete removes the entry associated with key 'key' from 'callback'.

func (callback Callback) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://github.com/go-openapi/jsonpointer#JSONPointable

func (callback *Callback) Keys() []string
    Keys returns the callback keys in a fixed order

func (callback *Callback) Len() int
    Len returns the amount of keys in callback excluding callback.Extensions.

func (callback *Callback) Map() (m map[string]*PathItem)
    Map returns callback as a 'map'. Note: iteration on Go maps is not ordered.

func (callback *Callback) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Callback.

func (callback *Callback) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Callback.

func (callback *Callback) Set(key string, value *PathItem)
    Set adds or replaces key 'key' of 'callback' with 'value'. Note: 'callback'
    MUST be non-nil

func (callback *Callback) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Callback to a copy of data.

func (callback *Callback) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Callback does not comply with the OpenAPI spec.

func (callback *Callback) Value(key string) *PathItem
    Value returns the callback for key or nil

type CallbackRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *Callback

	// Has unexported fields.
}
    CallbackRef represents either a Callback or a $ref to a Callback. When
    serializing and both fields are set, Ref is preferred over Value.

func (x *CallbackRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *CallbackRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x CallbackRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of CallbackRef.

func (x CallbackRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of CallbackRef.

func (x *CallbackRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *CallbackRef) RefString() string
    RefString returns the $ref value.

func (x *CallbackRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets CallbackRef to a copy of data.

func (x *CallbackRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if CallbackRef does not comply with the OpenAPI
    spec.

type Callbacks map[string]*CallbackRef // Callbacks represents components' named callbacks

func (m Callbacks) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (callbacks *Callbacks) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Callbacks to a copy of data.

type CommentFieldFor31Plus struct{ ValidationError }

func (e *CommentFieldFor31Plus) As(target any) bool

type ComponentRef interface {
	RefString() string
	RefPath() *url.URL
	CollectionName() string
}

type ComponentValidationError struct {
	// Section is the lowercase singular form of the component bucket
	// ("schema", "parameter", "header", "request body", "response",
	// "security scheme", "example", "link", "callback").
	Section string
	// Name is the component map key.
	Name  string
	Cause error
}
    ComponentValidationError wraps validation errors inside the Components
    container, carrying which sub-section (Schemas, Parameters, etc.) and which
    component name failed.

func (e *ComponentValidationError) Error() string

func (e *ComponentValidationError) Unwrap() error

type Components struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Schemas         Schemas         `json:"schemas,omitempty" yaml:"schemas,omitempty"`
	Parameters      ParametersMap   `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	Headers         Headers         `json:"headers,omitempty" yaml:"headers,omitempty"`
	RequestBodies   RequestBodies   `json:"requestBodies,omitempty" yaml:"requestBodies,omitempty"`
	Responses       ResponseBodies  `json:"responses,omitempty" yaml:"responses,omitempty"`
	SecuritySchemes SecuritySchemes `json:"securitySchemes,omitempty" yaml:"securitySchemes,omitempty"`
	Examples        Examples        `json:"examples,omitempty" yaml:"examples,omitempty"`
	Links           Links           `json:"links,omitempty" yaml:"links,omitempty"`
	Callbacks       Callbacks       `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`
}
    Components is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#components-object

func NewComponents() Components

func (components Components) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Components.

func (components Components) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Components.

func (components *Components) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Components to a copy of data.

func (components *Components) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Components does not comply with the OpenAPI
    spec.

type ConflictingPathsError struct {
	// Path1 / Path2 are the two conflicting path keys, in document
	// order.
	Path1 string
	Path2 string
	// Origin is the source location of the paths object when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    ConflictingPathsError clusters "conflicting paths X and Y" failures.
    Fires when two path keys normalize to the same template (e.g. "/users/{a}"
    and "/users/{b}" both normalize to "/users/{}").

func (e *ConflictingPathsError) Error() string

type ConstFieldFor31Plus struct{ ValidationError }

func (e *ConstFieldFor31Plus) As(target any) bool

type Contact struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Name  string `json:"name,omitempty" yaml:"name,omitempty"`
	URL   string `json:"url,omitempty" yaml:"url,omitempty"`
	Email string `json:"email,omitempty" yaml:"email,omitempty"`
}
    Contact is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#contact-object

func (contact Contact) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Contact.

func (contact Contact) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Contact.

func (contact *Contact) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Contact to a copy of data.

func (contact *Contact) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Contact does not comply with the OpenAPI spec.

type ContainsFieldFor31Plus struct{ ValidationError }

func (e *ContainsFieldFor31Plus) As(target any) bool

type Content map[string]*MediaType
    Content is specified by OpenAPI/Swagger 3.0 standard.

func NewContent() Content

func NewContentWithFormDataSchema(schema *Schema) Content

func NewContentWithFormDataSchemaRef(schema *SchemaRef) Content

func NewContentWithJSONSchema(schema *Schema) Content

func NewContentWithJSONSchemaRef(schema *SchemaRef) Content

func NewContentWithSchema(schema *Schema, consumes []string) Content

func NewContentWithSchemaRef(schema *SchemaRef, consumes []string) Content

func (content Content) Get(mime string) *MediaType

func (content *Content) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Content to a copy of data.

func (content Content) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Content does not comply with the OpenAPI spec.

type ContentEncodingFieldFor31Plus struct{ ValidationError }

func (e *ContentEncodingFieldFor31Plus) As(target any) bool

type ContentMediaTypeFieldFor31Plus struct{ ValidationError }

func (e *ContentMediaTypeFieldFor31Plus) As(target any) bool

type ContentSchemaFieldFor31Plus struct{ ValidationError }

func (e *ContentSchemaFieldFor31Plus) As(target any) bool

type DefsFieldFor31Plus struct{ ValidationError }

func (e *DefsFieldFor31Plus) As(target any) bool

type DependentRequiredFieldFor31Plus struct{ ValidationError }

func (e *DependentRequiredFieldFor31Plus) As(target any) bool

type DependentSchemasFieldFor31Plus struct{ ValidationError }

func (e *DependentSchemasFieldFor31Plus) As(target any) bool

type Discriminator struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	PropertyName string                `json:"propertyName" yaml:"propertyName"` // required
	Mapping      StringMap[MappingRef] `json:"mapping,omitempty" yaml:"mapping,omitempty"`
}
    Discriminator is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#discriminator-object

func (discriminator Discriminator) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Discriminator.

func (discriminator Discriminator) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Discriminator.

func (discriminator *Discriminator) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Discriminator to a copy of data.

func (discriminator *Discriminator) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Discriminator does not comply with the OpenAPI
    spec.

type DuplicateOperationIDError struct {
	// OperationID is the duplicated operationId value.
	OperationID string
	// Endpoint1 / Endpoint2 are the two offending endpoints, in
	// deterministic order (lexicographically) for stable error messages.
	Endpoint1 string
	Endpoint2 string
	// Origin is the source location of the second (offending) operation
	// when the document was loaded with Loader.IncludeOrigin = true. The
	// pre-existing Endpoint1 is implicitly fine; the duplicate landed at
	// Endpoint2's site, which is the natural "go fix this" pointer.
	Origin *Origin
}
    DuplicateOperationIDError clusters "two operations share an operationId"
    failures. operationIds must be unique across all paths in a document.
    Endpoints are rendered as "<METHOD> <path>" (e.g. "POST /things").

func (e *DuplicateOperationIDError) Error() string

type DuplicateParameterError struct {
	// In is the parameter location (e.g. "query", "path", "header").
	In string
	// Name is the duplicated parameter name.
	Name string
	// Origin is the source location of the offending parameter when
	// the document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    DuplicateParameterError clusters "more than one X parameter has name Y"
    failures. Fires when two parameters on an operation (or path item) share the
    same In + Name combination.

func (e *DuplicateParameterError) Error() string

type DynamicAnchorFieldFor31Plus struct{ ValidationError }

func (e *DynamicAnchorFieldFor31Plus) As(target any) bool

type DynamicRefFieldFor31Plus struct{ ValidationError }

func (e *DynamicRefFieldFor31Plus) As(target any) bool

type EitherFieldRequiredError struct {
	// Fields is the set of field names, at least one of which must be
	// set (e.g. ["value", "externalValue"]).
	Fields []string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    EitherFieldRequiredError clusters "at least one of these fields must be set"
    failures (example.value vs externalValue, link.operationId vs operationRef).

func (e *EitherFieldRequiredError) Error() string

func (e *EitherFieldRequiredError) Unwrap() error

type ElseFieldFor31Plus struct{ ValidationError }

func (e *ElseFieldFor31Plus) As(target any) bool

type Encoding struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	ContentType   string  `json:"contentType,omitempty" yaml:"contentType,omitempty"`
	Headers       Headers `json:"headers,omitempty" yaml:"headers,omitempty"`
	Style         string  `json:"style,omitempty" yaml:"style,omitempty"`
	Explode       *bool   `json:"explode,omitempty" yaml:"explode,omitempty"`
	AllowReserved bool    `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
}
    Encoding is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#encoding-object

func NewEncoding() *Encoding

func (encoding Encoding) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Encoding.

func (encoding Encoding) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Encoding.

func (encoding *Encoding) SerializationMethod() *SerializationMethod
    SerializationMethod returns a serialization method of request body.
    When serialization method is not defined the method returns the default
    serialization method.

func (encoding *Encoding) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Encoding to a copy of data.

func (encoding *Encoding) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Encoding does not comply with the OpenAPI spec.

func (encoding *Encoding) WithHeader(name string, header *Header) *Encoding

func (encoding *Encoding) WithHeaderRef(name string, ref *HeaderRef) *Encoding

type Encodings map[string]*Encoding
    Encodings is a map of encoding objects keyed by field name.

func (encodings *Encodings) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Encodings to a copy of data.

type ExactlyOneFieldError struct {
	// Fields is the set of fields, exactly one of which must be set
	// (e.g. ["content", "schema"]).
	Fields []string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    ExactlyOneFieldError clusters "exactly one of these fields must be set"
    failures — e.g. a parameter or header where neither content nor schema is
    set, or both are.

func (e *ExactlyOneFieldError) Error() string

func (e *ExactlyOneFieldError) Unwrap() error

type Example struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Summary       string `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description   string `json:"description,omitempty" yaml:"description,omitempty"`
	Value         any    `json:"value,omitempty" yaml:"value,omitempty"`
	ExternalValue string `json:"externalValue,omitempty" yaml:"externalValue,omitempty"`
}
    Example is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#example-object

func NewExample(value any) *Example

func (example Example) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Example.

func (example Example) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Example.

func (example *Example) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Example to a copy of data.

func (example *Example) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Example does not comply with the OpenAPI spec.

type ExampleRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *Example

	// Has unexported fields.
}
    ExampleRef represents either a Example or a $ref to a Example. When
    serializing and both fields are set, Ref is preferred over Value.

func (x *ExampleRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *ExampleRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x ExampleRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of ExampleRef.

func (x ExampleRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of ExampleRef.

func (x *ExampleRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *ExampleRef) RefString() string
    RefString returns the $ref value.

func (x *ExampleRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets ExampleRef to a copy of data.

func (x *ExampleRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if ExampleRef does not comply with the OpenAPI
    spec.

type ExampleValueExternalValueExclusive struct{ ValidationError }

func (e *ExampleValueExternalValueExclusive) As(target any) bool

type ExampleValueOrExternalValueRequired struct{ ValidationError }

func (e *ExampleValueOrExternalValueRequired) As(target any) bool

type Examples map[string]*ExampleRef // Examples represents components' named examples

func (m Examples) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (examples *Examples) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Examples to a copy of data.

type ExamplesFieldFor31Plus struct{ ValidationError }

func (e *ExamplesFieldFor31Plus) As(target any) bool

type ExclusiveBound struct {
	Bool  *bool    // For OpenAPI 3.0 style (modifier for min/max)
	Value *float64 // For OpenAPI 3.1 style (actual bound value)
}
    ExclusiveBound represents exclusiveMinimum/exclusiveMaximum which changed
    type between OpenAPI versions. In OpenAPI 3.0 (JSON Schema draft-04):
    boolean that modifies minimum/maximum In OpenAPI 3.1 (JSON Schema 2020-12):
    number representing the actual exclusive bound

func (eb ExclusiveBound) IsSet() bool
    IsSet returns true if either Bool or Value is set.

func (eb ExclusiveBound) IsTrue() bool
    IsTrue returns true if the bound is set as a boolean true (OpenAPI 3.0
    style).

func (eb ExclusiveBound) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of ExclusiveBound.

func (eb ExclusiveBound) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of ExclusiveBound.

func (eb *ExclusiveBound) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets ExclusiveBound to a copy of data.

type ExternalDocs struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Description string `json:"description,omitempty" yaml:"description,omitempty"`
	URL         string `json:"url,omitempty" yaml:"url,omitempty"`
}
    ExternalDocs is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#external-documentation-object

func (e ExternalDocs) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of ExternalDocs.

func (e ExternalDocs) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of ExternalDocs.

func (e *ExternalDocs) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets ExternalDocs to a copy of data.

func (e *ExternalDocs) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if ExternalDocs does not comply with the OpenAPI
    spec.

type ExternalDocsURLRequired struct{ ValidationError }

func (e *ExternalDocsURLRequired) As(target any) bool

type ExternalDocsURLValidationError struct {
	Cause error
}
    ExternalDocsURLValidationError wraps the URL parse failure on an
    ExternalDocs object.

func (e *ExternalDocsURLValidationError) Error() string

func (e *ExternalDocsURLValidationError) Unwrap() error

type ExtraSiblingFieldsError struct {
	// Fields is the list of unexpected sibling field names.
	Fields []string
	// Origin is the source location of the parent object that carries
	// the extra siblings when the document was loaded with
	// Loader.IncludeOrigin = true.
	Origin *Origin
}
    ExtraSiblingFieldsError clusters "unexpected sibling fields" failures. Most
    commonly this fires when fields appear alongside a $ref that the OpenAPI
    spec doesn't allow there, or as unknown keys on objects whose only permitted
    extras are `x-` extensions. Carries the offending field names so callers can
    render or filter.

func (e *ExtraSiblingFieldsError) Error() string

type FieldVersionMismatchError struct {
	// Field is the field name flagged (e.g. "summary", "identifier",
	// "$defs", "prefixItems", "contains", ...).
	Field string
	// MinVersion is the minimum OpenAPI version that allows the field
	// (e.g. "3.1").
	MinVersion string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true. Nil for
	// document-root fields (Loader doesn't track Origin on *T) and on
	// loads where origin tracking was off.
	Origin *Origin
}
    FieldVersionMismatchError clusters "field X is for OpenAPI >=Y" failures
    (3.1+ keywords used in 3.0 documents). Carries the field name and minimum
    version, wraps the per-site leaf.

func (e *FieldVersionMismatchError) Error() string

func (e *FieldVersionMismatchError) Unwrap() error

type ForbiddenFieldError struct {
	// Field is the name of the forbidden field (e.g. "name", "in",
	// "authorizationUrl", "tokenUrl").
	Field string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    ForbiddenFieldError clusters "field X must not be set in this context"
    failures (header.name and header.in inside a Headers map, OAuth flow URLs
    that don't apply to the chosen flow type).

func (e *ForbiddenFieldError) Error() string

func (e *ForbiddenFieldError) Unwrap() error

type FormatValidator[T any] interface {
	Validate(value T) error
}
    FormatValidator is an interface for custom format validators.

func NewCallbackValidator[T any](fn func(T) error) FormatValidator[T]
    NewCallbackValidator creates a new FormatValidator that uses a callback
    function to validate the value.

func NewIPValidator(isIPv4 bool) FormatValidator[string]
    NewIPValidator creates a new FormatValidator that validates the value is an
    IP address.

func NewRangeFormatValidator[T int64 | float64](min, max T) FormatValidator[T]
    NewRangeFormatValidator creates a new FormatValidator that validates the
    value is within a given range.

type Header struct {
	Parameter
}
    Header is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#header-object

func (header Header) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (header Header) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Header.

func (header Header) MarshalYAML() (any, error)
    MarshalYAML returns the JSON encoding of Header.

func (header *Header) SerializationMethod() (*SerializationMethod, error)
    SerializationMethod returns a header's serialization method.

func (header *Header) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Header to a copy of data.

func (header *Header) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Header does not comply with the OpenAPI spec.

type HeaderContentSchemaExactlyOne struct{ ValidationError }

func (e *HeaderContentSchemaExactlyOne) As(target any) bool

type HeaderContentSingleEntry struct{ ValidationError }

func (e *HeaderContentSingleEntry) As(target any) bool

type HeaderFieldValidationError struct {
	// Field is "schema" or "content".
	Field string
	Cause error
}
    HeaderFieldValidationError wraps validation errors on a Header's `schema` or
    `content` sub-objects. Field discriminates the two.

func (e *HeaderFieldValidationError) Error() string

func (e *HeaderFieldValidationError) Unwrap() error

type HeaderInForbidden struct{ ValidationError }

func (e *HeaderInForbidden) As(target any) bool

type HeaderNameForbidden struct{ ValidationError }

func (e *HeaderNameForbidden) As(target any) bool

type HeaderRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *Header

	// Has unexported fields.
}
    HeaderRef represents either a Header or a $ref to a Header. When serializing
    and both fields are set, Ref is preferred over Value.

func (x *HeaderRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *HeaderRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x HeaderRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of HeaderRef.

func (x HeaderRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of HeaderRef.

func (x *HeaderRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *HeaderRef) RefString() string
    RefString returns the $ref value.

func (x *HeaderRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets HeaderRef to a copy of data.

func (x *HeaderRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if HeaderRef does not comply with the OpenAPI
    spec.

type Headers map[string]*HeaderRef // Headers represents components' named headers

func (m Headers) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (headers *Headers) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Headers to a copy of data.

type IDFieldFor31Plus struct{ ValidationError }

func (e *IDFieldFor31Plus) As(target any) bool

type IfFieldFor31Plus struct{ ValidationError }

func (e *IfFieldFor31Plus) As(target any) bool

type Info struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Title          string   `json:"title" yaml:"title"`                         // Required
	Summary        string   `json:"summary,omitempty" yaml:"summary,omitempty"` // OpenAPI >=3.1
	Description    string   `json:"description,omitempty" yaml:"description,omitempty"`
	TermsOfService string   `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty"`
	Contact        *Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
	License        *License `json:"license,omitempty" yaml:"license,omitempty"`
	Version        string   `json:"version" yaml:"version"` // Required
}
    Info is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#info-object
    and
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#info-object

func (info Info) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Info.

func (info *Info) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Info.

func (info *Info) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Info to a copy of data.

func (info *Info) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Info does not comply with the OpenAPI spec.

type InfoRequired struct{ ValidationError }

func (e *InfoRequired) As(target any) bool

type InfoSummaryFieldFor31Plus struct{ ValidationError }

func (e *InfoSummaryFieldFor31Plus) As(target any) bool

type InfoTitleRequired struct{ ValidationError }

func (e *InfoTitleRequired) As(target any) bool

type InfoVersionRequired struct{ ValidationError }

func (e *InfoVersionRequired) As(target any) bool

type IntegerFormatValidator = FormatValidator[int64]
    IntegerFormatValidator is a type alias for FormatValidator[int64]

type InvalidHTTPSchemeError struct {
	// Scheme is the rejected scheme value (e.g. "mutual", "oauth").
	Scheme string
	// Origin is the source location of the offending security scheme
	// when the document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    InvalidHTTPSchemeError clusters "security scheme of type 'http' has invalid
    'scheme' value X" failures. The OpenAPI/HTTP-auth registry accepts only
    `bearer`, `basic`, `negotiate`, `digest`; this fires when an http scheme
    declares anything else.

func (e *InvalidHTTPSchemeError) Error() string

type InvalidParameterInError struct {
	// Value is the rejected `in:` value (e.g. "body", "formData").
	Value string
	// Origin is the source location of the offending parameter when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    InvalidParameterInError clusters "parameter can't have 'in' value X"
    failures. The OpenAPI 3.x spec accepts only `path`, `query`, `header`,
    or `cookie`; this fires when a parameter declares anything else (commonly
    `body`, a Swagger 2.0 leftover).

func (e *InvalidParameterInError) Error() string

type InvalidSecuritySchemeTypeError struct {
	// Type is the rejected type value (e.g. "cookie", "saml").
	Type string
	// Origin is the source location of the offending security scheme
	// when the document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    InvalidSecuritySchemeTypeError clusters "security scheme 'type' can't be
    X" failures. The OpenAPI 3.x spec accepts only `apiKey`, `http`, `oauth2`,
    `openIdConnect`, and `mutualTLS` (3.1+); this fires when a security scheme
    declares anything else.

func (e *InvalidSecuritySchemeTypeError) Error() string

type InvalidSerializationMethodError struct {
	// Subject discriminates the calling surface ("media type",
	// "path"/"query"/"header"/"cookie" for parameters, or "header"
	// for the header.go site).
	Subject string
	// Style is the offending `style:` value.
	Style string
	// Explode is the offending `explode:` value.
	Explode bool
	// Origin is the source location of the offending object when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    InvalidSerializationMethodError clusters "serialization method with style=X
    and explode=Y is not supported by Z" failures. Fires for invalid (style,
    explode) combinations on encodings, parameters, and headers. The Subject
    discriminates which surface is reporting: "media type" for encoding,
    the parameter location ("path", "query", etc.) for parameters and "header"
    for headers.

func (e *InvalidSerializationMethodError) Error() string

type JSONSchemaDialectAbsoluteURIRequired struct{ ValidationError }

func (e *JSONSchemaDialectAbsoluteURIRequired) As(target any) bool

type JSONSchemaDialectFieldFor31Plus struct{ ValidationError }

func (e *JSONSchemaDialectFieldFor31Plus) As(target any) bool

type License struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Name string `json:"name" yaml:"name"` // Required
	URL  string `json:"url,omitempty" yaml:"url,omitempty"`

	// Identifier is an SPDX license expression for the API (OpenAPI 3.1)
	// Either url or identifier can be specified, not both
	Identifier string `json:"identifier,omitempty" yaml:"identifier,omitempty"` // OpenAPI >=3.1
}
    License is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#license-object
    and
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#license-object

func (license License) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of License.

func (license License) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of License.

func (license *License) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets License to a copy of data.

func (license *License) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if License does not comply with the OpenAPI spec.

type LicenseIdentifierFieldFor31Plus struct{ ValidationError }

func (e *LicenseIdentifierFieldFor31Plus) As(target any) bool

type LicenseNameRequired struct{ ValidationError }

func (e *LicenseNameRequired) As(target any) bool

type LicenseURLIdentifierExclusive struct{ ValidationError }

func (e *LicenseURLIdentifierExclusive) As(target any) bool

type Link struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	OperationRef string         `json:"operationRef,omitempty" yaml:"operationRef,omitempty"`
	OperationID  string         `json:"operationId,omitempty" yaml:"operationId,omitempty"`
	Description  string         `json:"description,omitempty" yaml:"description,omitempty"`
	Parameters   map[string]any `json:"parameters,omitempty" yaml:"parameters,omitempty"`
	Server       *Server        `json:"server,omitempty" yaml:"server,omitempty"`
	RequestBody  any            `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
}
    Link is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#link-object

func (link Link) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Link.

func (link Link) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Link.

func (link *Link) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Link to a copy of data.

func (link *Link) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Link does not comply with the OpenAPI spec.

type LinkOperationIDOrRefRequired struct{ ValidationError }

func (e *LinkOperationIDOrRefRequired) As(target any) bool

type LinkOperationIDRefExclusive struct{ ValidationError }

func (e *LinkOperationIDRefExclusive) As(target any) bool

type LinkRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *Link

	// Has unexported fields.
}
    LinkRef represents either a Link or a $ref to a Link. When serializing and
    both fields are set, Ref is preferred over Value.

func (x *LinkRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *LinkRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x LinkRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of LinkRef.

func (x LinkRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of LinkRef.

func (x *LinkRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *LinkRef) RefString() string
    RefString returns the $ref value.

func (x *LinkRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets LinkRef to a copy of data.

func (x *LinkRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if LinkRef does not comply with the OpenAPI spec.

type Links map[string]*LinkRef // Links represents components' named links

func (m Links) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (links *Links) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Links to a copy of data.

type Loader struct {
	// IsExternalRefsAllowed enables visiting other files. Enforced only when
	// ReadFromURIFunc is nil; a custom ReadFromURIFunc bypasses this flag and
	// owns the access policy itself — see ReadFromURIFunc.
	IsExternalRefsAllowed bool

	// IncludeOrigin enables recording the file/line/column of each OpenAPI element.
	// Prefer this over the package-level IncludeOrigin global, which is not safe for
	// concurrent use.
	IncludeOrigin bool

	// ReadFromURIFunc overrides how the loader reads a referenced file or URL.
	//
	// SECURITY: when a custom ReadFromURIFunc is set, IsExternalRefsAllowed is
	// NOT enforced — this function alone decides which locations may be read. A
	// func that reads whatever URI it is handed (e.g. by delegating to
	// DefaultReadFromURI) resolves external $refs even when IsExternalRefsAllowed
	// is false, which on untrusted documents enables local file reads
	// (`$ref: "/etc/passwd"`) and SSRF (`$ref: "http://169.254.169.254/..."`).
	// A custom func must apply its own scheme/host allowlist, or re-check
	// IsExternalRefsAllowed, before reading.
	ReadFromURIFunc ReadFromURIFunc

	// JoinFunc allows overriding how relative $ref paths are resolved against
	// a base path. When set, it is called instead of the default join logic
	// that uses path.Dir and path.Join. This is useful when loading specs from
	// non-filesystem sources (e.g. git objects, remote archives) where the base
	// path follows a different convention than filesystem paths.
	JoinFunc func(basePath *url.URL, relativePath *url.URL) *url.URL

	Context context.Context

	// Has unexported fields.
}
    Loader helps deserialize an OpenAPIv3 document

func NewLoader() *Loader
    NewLoader returns an empty Loader

func (loader *Loader) LoadFromData(data []byte) (*T, error)
    LoadFromData loads a spec from a byte array

func (loader *Loader) LoadFromDataWithPath(data []byte, location *url.URL) (*T, error)
    LoadFromDataWithPath takes the OpenAPI document data in bytes and a path
    where the resolver can find referred elements and returns a *T with all
    resolved data or an error if unable to load data or resolve refs.

func (loader *Loader) LoadFromFile(location string) (*T, error)
    LoadFromFile loads a spec from a local file path

func (loader *Loader) LoadFromIoReader(reader io.Reader) (*T, error)
    LoadFromStdin loads a spec from io.Reader

func (loader *Loader) LoadFromStdin() (*T, error)
    LoadFromStdin loads a spec from stdin

func (loader *Loader) LoadFromURI(location *url.URL) (*T, error)
    LoadFromURI loads a spec from a remote URL

func (loader *Loader) ResolveRefsIn(doc *T, location *url.URL) (err error)
    ResolveRefsIn expands references if for instance spec was just unmarshaled

type Location struct {
	File   string `json:"file,omitempty" yaml:"file,omitempty"`
	Line   int    `json:"line,omitempty" yaml:"line,omitempty"`
	Column int    `json:"column,omitempty" yaml:"column,omitempty"`
	Name   string `json:"name,omitempty" yaml:"name,omitempty"`
}
    Location is a struct that contains the location of a field.

type MappingRef SchemaRef
    MappingRef is a ref to a Schema objects. Unlike SchemaRefs it is serialised
    as a plain string instead of an object with a $ref key, as such it also does
    not support extensions.

func (mr MappingRef) MarshalText() ([]byte, error)

func (mr *MappingRef) UnmarshalText(data []byte) error

type MaxContainsFieldFor31Plus struct{ ValidationError }

func (e *MaxContainsFieldFor31Plus) As(target any) bool

type MediaType struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Schema   *SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
	Example  any        `json:"example,omitempty" yaml:"example,omitempty"`
	Examples Examples   `json:"examples,omitempty" yaml:"examples,omitempty"`
	Encoding Encodings  `json:"encoding,omitempty" yaml:"encoding,omitempty"`
}
    MediaType is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object

func NewMediaType() *MediaType

func (mediaType MediaType) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (mediaType MediaType) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of MediaType.

func (mediaType MediaType) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of MediaType.

func (mediaType *MediaType) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets MediaType to a copy of data.

func (mediaType *MediaType) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if MediaType does not comply with the OpenAPI
    spec.

func (mediaType *MediaType) WithEncoding(name string, enc *Encoding) *MediaType

func (mediaType *MediaType) WithExample(name string, value any) *MediaType

func (mediaType *MediaType) WithSchema(schema *Schema) *MediaType

func (mediaType *MediaType) WithSchemaRef(schema *SchemaRef) *MediaType

type MediaTypeExampleExamplesExclusive struct{ ValidationError }

func (e *MediaTypeExampleExamplesExclusive) As(target any) bool

type MediaTypeExampleValidationError struct {
	// ExampleName is the example map key.
	ExampleName string
	Cause       error
}
    MediaTypeExampleValidationError wraps validation errors on a named example
    inside a MediaType.examples map.

func (e *MediaTypeExampleValidationError) Error() string

func (e *MediaTypeExampleValidationError) Unwrap() error

type MinContainsFieldFor31Plus struct{ ValidationError }

func (e *MinContainsFieldFor31Plus) As(target any) bool

type MultiError []error
    MultiError is a collection of errors, intended for when multiple issues need
    to be reported upstream

func (me MultiError) As(target any) bool
    As allows you to use `errors.As()` to set target to the first error within
    the multi error that matches the target type

func (me MultiError) Error() string

func (me MultiError) Is(target error) bool
    Is allows you to determine if a generic error is in fact a MultiError using
    `errors.Is()` It will also return true if any of the contained errors match
    target

type MutuallyExclusiveFieldsError struct {
	// Field1 and Field2 name the two fields the spec forbids setting
	// together (e.g. "value", "externalValue").
	Field1 string
	Field2 string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    MutuallyExclusiveFieldsError clusters "fields X and Y are both set, only
    one is allowed" failures (example.value vs externalValue, mediaType.example
    vs examples, license.url vs identifier, link.operationId vs operationRef).
    Carries both field names and wraps the per-site leaf.

func (e *MutuallyExclusiveFieldsError) Error() string

func (e *MutuallyExclusiveFieldsError) Unwrap() error

type NewCallbackOption func(*Callback)
    NewCallbackOption describes options to NewCallback func

func WithCallback(cb string, pathItem *PathItem) NewCallbackOption
    WithCallback adds Callback as an option to NewCallback

type NewPathsOption func(*Paths)
    NewPathsOption describes options to NewPaths func

func WithPath(path string, pathItem *PathItem) NewPathsOption
    WithPath adds a named path item

type NewResponsesOption func(*Responses)
    NewResponsesOption describes options to NewResponses func

func WithName(name string, response *Response) NewResponsesOption
    WithName adds a name-keyed Response

func WithStatus(status int, responseRef *ResponseRef) NewResponsesOption
    WithStatus adds a status code keyed ResponseRef

type NumberFormatValidator = FormatValidator[float64]
    NumberFormatValidator is a type alias for FormatValidator[float64]

type OAuthFlow struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	AuthorizationURL string            `json:"authorizationUrl,omitempty" yaml:"authorizationUrl,omitempty"`
	TokenURL         string            `json:"tokenUrl,omitempty" yaml:"tokenUrl,omitempty"`
	RefreshURL       string            `json:"refreshUrl,omitempty" yaml:"refreshUrl,omitempty"`
	Scopes           StringMap[string] `json:"scopes" yaml:"scopes"` // required
}
    OAuthFlow is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#oauth-flow-object

func (flow OAuthFlow) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of OAuthFlow.

func (flow OAuthFlow) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of OAuthFlow.

func (flow *OAuthFlow) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets OAuthFlow to a copy of data.

func (flow *OAuthFlow) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if OAuthFlows does not comply with the OpenAPI
    spec.

type OAuthFlowAuthorizationURLForbidden struct{ ValidationError }

func (e *OAuthFlowAuthorizationURLForbidden) As(target any) bool

type OAuthFlowAuthorizationURLRequired struct{ ValidationError }

func (e *OAuthFlowAuthorizationURLRequired) As(target any) bool

type OAuthFlowFieldValidationError struct {
	// Field is the offending field name ("refreshUrl" is the only
	// site today; future URL fields can reuse the same wrapper).
	Field string
	Cause error
}
    OAuthFlowFieldValidationError wraps validation errors on a specific field
    inside an OAuthFlow object. Field discriminates which URL field failed.

func (e *OAuthFlowFieldValidationError) Error() string

func (e *OAuthFlowFieldValidationError) Unwrap() error

type OAuthFlowScopesRequired struct{ ValidationError }

func (e *OAuthFlowScopesRequired) As(target any) bool

type OAuthFlowTokenURLForbidden struct{ ValidationError }

func (e *OAuthFlowTokenURLForbidden) As(target any) bool

type OAuthFlowTokenURLRequired struct{ ValidationError }

func (e *OAuthFlowTokenURLRequired) As(target any) bool

type OAuthFlowValidationError struct {
	// FlowKind is one of "implicit", "password", "clientCredentials",
	// "authorizationCode".
	FlowKind string
	Cause    error
}
    OAuthFlowValidationError wraps validation errors on a specific OAuth flow
    inside OAuthFlows.

func (e *OAuthFlowValidationError) Error() string

func (e *OAuthFlowValidationError) Unwrap() error

type OAuthFlows struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Implicit          *OAuthFlow `json:"implicit,omitempty" yaml:"implicit,omitempty"`
	Password          *OAuthFlow `json:"password,omitempty" yaml:"password,omitempty"`
	ClientCredentials *OAuthFlow `json:"clientCredentials,omitempty" yaml:"clientCredentials,omitempty"`
	AuthorizationCode *OAuthFlow `json:"authorizationCode,omitempty" yaml:"authorizationCode,omitempty"`
}
    OAuthFlows is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#oauth-flows-object

func (flows OAuthFlows) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of OAuthFlows.

func (flows OAuthFlows) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of OAuthFlows.

func (flows *OAuthFlows) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets OAuthFlows to a copy of data.

func (flows *OAuthFlows) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if OAuthFlows does not comply with the OpenAPI
    spec.

type OpenAPIVersionRequired struct{ ValidationError }

func (e *OpenAPIVersionRequired) As(target any) bool

type OpenIDConnectURLRequired struct{ ValidationError }

func (e *OpenIDConnectURLRequired) As(target any) bool

type Operation struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	// Optional tags for documentation.
	Tags []string `json:"tags,omitempty" yaml:"tags,omitempty"`

	// Optional short summary.
	Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`

	// Optional description. Should use CommonMark syntax.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	// Optional operation ID.
	OperationID string `json:"operationId,omitempty" yaml:"operationId,omitempty"`

	// Optional parameters.
	Parameters Parameters `json:"parameters,omitempty" yaml:"parameters,omitempty"`

	// Optional body parameter.
	RequestBody *RequestBodyRef `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`

	// Responses.
	Responses *Responses `json:"responses" yaml:"responses"` // Required

	// Optional callbacks
	Callbacks Callbacks `json:"callbacks,omitempty" yaml:"callbacks,omitempty"`

	Deprecated bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`

	// Optional security requirements that overrides top-level security.
	Security *SecurityRequirements `json:"security,omitempty" yaml:"security,omitempty"`

	// Optional servers that overrides top-level servers.
	Servers *Servers `json:"servers,omitempty" yaml:"servers,omitempty"`

	ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}
    Operation represents "operation" specified
    by" OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object

func NewOperation() *Operation

func (operation *Operation) AddParameter(p *Parameter)

func (operation *Operation) AddResponse(status int, response *Response)

func (operation Operation) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (operation Operation) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Operation.

func (operation Operation) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Operation.

func (operation *Operation) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Operation to a copy of data.

func (operation *Operation) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Operation does not comply with the OpenAPI
    spec.

type OperationResponsesRequired struct{ ValidationError }

func (e *OperationResponsesRequired) As(target any) bool

type OperationValidationError struct {
	Method string
	Cause  error
}
    OperationValidationError wraps an error originating inside a specific
    HTTP-method operation under a path. Method is the uppercase method (GET,
    POST, etc.).

    Use errors.As(err, &ove) to extract the method from a validation error chain
    without parsing the rendered message.

func (e *OperationValidationError) Error() string

func (e *OperationValidationError) Unwrap() error

type Origin struct {
	Key       *Location             `json:"key,omitempty" yaml:"key,omitempty"`
	Fields    map[string]Location   `json:"fields,omitempty" yaml:"fields,omitempty"`
	Sequences map[string][]Location `json:"sequences,omitempty" yaml:"sequences,omitempty"`
}
    Origin contains the origin of a collection. Key is the location of the
    collection itself. Fields is a map of the location of each scalar field
    in the collection. Sequences is a map of the location of each item in
    sequence-valued fields.

type Parameter struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Name            string     `json:"name,omitempty" yaml:"name,omitempty"`
	In              string     `json:"in,omitempty" yaml:"in,omitempty"`
	Description     string     `json:"description,omitempty" yaml:"description,omitempty"`
	Style           string     `json:"style,omitempty" yaml:"style,omitempty"`
	Explode         *bool      `json:"explode,omitempty" yaml:"explode,omitempty"`
	AllowEmptyValue bool       `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"`
	AllowReserved   bool       `json:"allowReserved,omitempty" yaml:"allowReserved,omitempty"`
	Deprecated      bool       `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	Required        bool       `json:"required,omitempty" yaml:"required,omitempty"`
	Schema          *SchemaRef `json:"schema,omitempty" yaml:"schema,omitempty"`
	Example         any        `json:"example,omitempty" yaml:"example,omitempty"`
	Examples        Examples   `json:"examples,omitempty" yaml:"examples,omitempty"`
	Content         Content    `json:"content,omitempty" yaml:"content,omitempty"`
}
    Parameter is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object

func NewCookieParameter(name string) *Parameter

func NewHeaderParameter(name string) *Parameter

func NewPathParameter(name string) *Parameter

func NewQueryParameter(name string) *Parameter

func (parameter Parameter) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (parameter Parameter) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Parameter.

func (parameter Parameter) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Parameter.

func (parameter *Parameter) SerializationMethod() (*SerializationMethod, error)
    SerializationMethod returns a parameter's serialization method. When a
    parameter's serialization method is not defined the method returns the
    default serialization method corresponding to a parameter's location.

func (parameter *Parameter) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Parameter to a copy of data.

func (parameter *Parameter) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Parameter does not comply with the OpenAPI
    spec.

func (parameter *Parameter) WithDescription(value string) *Parameter

func (parameter *Parameter) WithRequired(value bool) *Parameter

func (parameter *Parameter) WithSchema(value *Schema) *Parameter

type ParameterContentSchemaExactlyOne struct{ ValidationError }

func (e *ParameterContentSchemaExactlyOne) As(target any) bool

type ParameterContentSingleEntry struct{ ValidationError }

func (e *ParameterContentSingleEntry) As(target any) bool

type ParameterExampleAndExamplesExclusive struct{ ValidationError }

func (e *ParameterExampleAndExamplesExclusive) As(target any) bool

type ParameterExampleValidationError struct {
	// ExampleName is the example map key.
	ExampleName string
	Cause       error
}
    ParameterExampleValidationError wraps validation errors on a named example
    inside a parameter's examples map.

func (e *ParameterExampleValidationError) Error() string

func (e *ParameterExampleValidationError) Unwrap() error

type ParameterFieldValidationError struct {
	// ParameterName is the parameter's `name:` value.
	ParameterName string
	// Field is "schema" or "content".
	Field string
	Cause error
}
    ParameterFieldValidationError wraps validation errors on a parameter's
    `schema` or `content` sub-objects. Field discriminates.

func (e *ParameterFieldValidationError) Error() string

func (e *ParameterFieldValidationError) Unwrap() error

type ParameterNameRequired struct{ ValidationError }

func (e *ParameterNameRequired) As(target any) bool

type ParameterRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *Parameter

	// Has unexported fields.
}
    ParameterRef represents either a Parameter or a $ref to a Parameter.
    When serializing and both fields are set, Ref is preferred over Value.

func (x *ParameterRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *ParameterRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x ParameterRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of ParameterRef.

func (x ParameterRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of ParameterRef.

func (x *ParameterRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *ParameterRef) RefString() string
    RefString returns the $ref value.

func (x *ParameterRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets ParameterRef to a copy of data.

func (x *ParameterRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if ParameterRef does not comply with the OpenAPI
    spec.

type Parameters []*ParameterRef
    Parameters is specified by OpenAPI/Swagger 3.0 standard.

func NewParameters() Parameters

func (parameters Parameters) GetByInAndName(in string, name string) *Parameter

func (p Parameters) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (parameters Parameters) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Parameters does not comply with the OpenAPI
    spec.

type ParametersMap map[string]*ParameterRef // ParametersMap represents components' named parameters

func (m ParametersMap) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (parametersMap *ParametersMap) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets ParametersMap to a copy of data.

type PathItem struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Ref         string     `json:"$ref,omitempty" yaml:"$ref,omitempty"`
	Summary     string     `json:"summary,omitempty" yaml:"summary,omitempty"`
	Description string     `json:"description,omitempty" yaml:"description,omitempty"`
	Connect     *Operation `json:"connect,omitempty" yaml:"connect,omitempty"`
	Delete      *Operation `json:"delete,omitempty" yaml:"delete,omitempty"`
	Get         *Operation `json:"get,omitempty" yaml:"get,omitempty"`
	Head        *Operation `json:"head,omitempty" yaml:"head,omitempty"`
	Options     *Operation `json:"options,omitempty" yaml:"options,omitempty"`
	Patch       *Operation `json:"patch,omitempty" yaml:"patch,omitempty"`
	Post        *Operation `json:"post,omitempty" yaml:"post,omitempty"`
	Put         *Operation `json:"put,omitempty" yaml:"put,omitempty"`
	Trace       *Operation `json:"trace,omitempty" yaml:"trace,omitempty"`
	Servers     Servers    `json:"servers,omitempty" yaml:"servers,omitempty"`
	Parameters  Parameters `json:"parameters,omitempty" yaml:"parameters,omitempty"`
}
    PathItem is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object

func (pathItem *PathItem) GetOperation(method string) *Operation

func (pathItem PathItem) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of PathItem.

func (pathItem PathItem) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of PathItem.

func (pathItem *PathItem) Operations() map[string]*Operation

func (pathItem *PathItem) SetOperation(method string, operation *Operation)

func (pathItem *PathItem) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets PathItem to a copy of data.

func (pathItem *PathItem) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if PathItem does not comply with the OpenAPI spec.

type PathMustStartWithSlashError struct {
	// Path is the offending path key (e.g. "users/{id}").
	Path string
	// Origin is the source location of the paths object when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    PathMustStartWithSlashError clusters "path X does not start with a forward
    slash" failures. Path keys in the paths object must begin with `/`.

func (e *PathMustStartWithSlashError) Error() string

type PathParameterRequiredError struct {
	// Param is the path-parameter name (e.g. "groupId").
	Param string
	// Origin is the source location of the offending parameter when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    PathParameterRequiredError clusters "path parameter X must be required"
    failures: per the OpenAPI spec, every parameter with `in: path` must be
    declared with `required: true`. Carries the parameter name so callers can
    render or filter by it.

func (e *PathParameterRequiredError) Error() string

type PathParametersError struct {
	// Path is the path template (e.g. "/api/{domain}/{project}/...").
	Path string
	// Method is the HTTP method (e.g. "POST").
	Method string
	// Missing names path-template variables (or operation parameters)
	// that don't have a corresponding declaration on the other side.
	Missing []string
	// Origin is the source location of the path item when the document
	// was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    PathParametersError clusters "operation declares fewer/more path parameters
    than appear in the path template" failures. Carries the path template,
    method, and the list of missing parameter names so callers can render or
    filter without parsing the message.

func (e *PathParametersError) Error() string

type PathValidationError struct {
	Path  string
	Cause error
}
    PathValidationError wraps an error originating inside a specific path. Path
    is the path template as it appears in the document (e.g. "/users/{id}").

    Use errors.As(err, &pve) to extract the path from a validation error chain
    without parsing the rendered message.

func (e *PathValidationError) Error() string

func (e *PathValidationError) Unwrap() error

type Paths struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	// Has unexported fields.
}
    Paths is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#paths-object

func NewPaths(opts ...NewPathsOption) *Paths
    NewPaths builds a paths object with path items in insertion order.

func NewPathsWithCapacity(cap int) *Paths
    NewPathsWithCapacity builds a paths object of the given capacity.

func (paths *Paths) Delete(key string)
    Delete removes the entry associated with key 'key' from 'paths'.

func (paths *Paths) Find(key string) *PathItem
    Find returns a path that matches the key.

    The method ignores differences in template variable names (except possible
    "*" suffix).

    For example:

        paths := openapi3.Paths {
          "/person/{personName}": &openapi3.PathItem{},
        }
        pathItem := path.Find("/person/{name}")

    would return the correct path item.

func (paths *Paths) InMatchingOrder() []string
    InMatchingOrder returns paths in the
    order they are matched against URLs. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#paths-object
    When matching URLs, concrete (non-templated) paths would be matched before
    their templated counterparts.

func (paths Paths) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://github.com/go-openapi/jsonpointer#JSONPointable

func (paths *Paths) Keys() []string
    Keys returns the paths keys in a fixed order

func (paths *Paths) Len() int
    Len returns the amount of keys in paths excluding paths.Extensions.

func (paths *Paths) Map() (m map[string]*PathItem)
    Map returns paths as a 'map'. Note: iteration on Go maps is not ordered.

func (paths *Paths) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Paths.

func (paths *Paths) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Paths.

func (paths *Paths) Set(key string, value *PathItem)
    Set adds or replaces key 'key' of 'paths' with 'value'. Note: 'paths' MUST
    be non-nil

func (paths *Paths) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Paths to a copy of data.

func (paths *Paths) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Paths does not comply with the OpenAPI spec.

func (paths *Paths) Value(key string) *PathItem
    Value returns the paths for key or nil

type PathsRequired struct{ ValidationError }

func (e *PathsRequired) As(target any) bool

type PatternPropertiesFieldFor31Plus struct{ ValidationError }

func (e *PatternPropertiesFieldFor31Plus) As(target any) bool

type PrefixItemsFieldFor31Plus struct{ ValidationError }

func (e *PrefixItemsFieldFor31Plus) As(target any) bool

type PropertyNamesFieldFor31Plus struct{ ValidationError }

func (e *PropertyNamesFieldFor31Plus) As(target any) bool

type ReadFromURIFunc func(loader *Loader, url *url.URL) ([]byte, error)
    ReadFromURIFunc defines a function which reads the contents of a resource
    located at a URI.

func ReadFromHTTP(cl *http.Client) ReadFromURIFunc
    ReadFromHTTP returns a ReadFromURIFunc which uses the given http.Client to
    read the contents from a remote HTTP URI. This client may be customized to
    implement timeouts, RFC 7234 caching, etc.

func ReadFromURIs(readers ...ReadFromURIFunc) ReadFromURIFunc
    ReadFromURIs returns a ReadFromURIFunc which tries to read a URI using the
    given reader functions, in the same order. If a reader function does not
    support the URI and returns ErrURINotSupported, the next function is checked
    until a match is found, or the URI is not supported by any.

func URIMapCache(reader ReadFromURIFunc) ReadFromURIFunc
    URIMapCache returns a ReadFromURIFunc that caches the contents read from
    URI locations in a simple map. This cache implementation is suitable for
    short-lived processes such as command-line tools which process OpenAPI
    documents.

type Ref struct {
	Ref        string         `json:"$ref" yaml:"$ref"`
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`
}
    Ref is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#reference-object

func (x Ref) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Ref.

func (x Ref) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Ref.

func (e *Ref) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Extensions does not comply with the OpenAPI
    spec.

type RefNameResolver func(*T, ComponentRef) string
    RefNameResolver maps a component to a name that is used as it's internalized
    name.

    The function should avoid name collisions (i.e. be a injective mapping). It
    must only contain characters valid for fixed field names: IdentifierRegExp.

type RegexCompilerFunc func(expr string) (RegexMatcher, error)

type RegexMatcher interface {
	MatchString(s string) bool
}

type RequestBodies map[string]*RequestBodyRef // RequestBodies represents components' named request bodies

func (m RequestBodies) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (requestBodies *RequestBodies) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets RequestBodies to a copy of data.

type RequestBody struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Description string  `json:"description,omitempty" yaml:"description,omitempty"`
	Required    bool    `json:"required,omitempty" yaml:"required,omitempty"`
	Content     Content `json:"content" yaml:"content"`
}
    RequestBody is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-object

func NewRequestBody() *RequestBody

func (requestBody *RequestBody) GetMediaType(mediaType string) *MediaType

func (requestBody RequestBody) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of RequestBody.

func (requestBody RequestBody) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of RequestBody.

func (requestBody *RequestBody) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets RequestBody to a copy of data.

func (requestBody *RequestBody) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if RequestBody does not comply with the OpenAPI
    spec.

func (requestBody *RequestBody) WithContent(content Content) *RequestBody

func (requestBody *RequestBody) WithDescription(value string) *RequestBody

func (requestBody *RequestBody) WithFormDataSchema(value *Schema) *RequestBody

func (requestBody *RequestBody) WithFormDataSchemaRef(value *SchemaRef) *RequestBody

func (requestBody *RequestBody) WithJSONSchema(value *Schema) *RequestBody

func (requestBody *RequestBody) WithJSONSchemaRef(value *SchemaRef) *RequestBody

func (requestBody *RequestBody) WithRequired(value bool) *RequestBody

func (requestBody *RequestBody) WithSchema(value *Schema, consumes []string) *RequestBody

func (requestBody *RequestBody) WithSchemaRef(value *SchemaRef, consumes []string) *RequestBody

type RequestBodyContentRequired struct{ ValidationError }

func (e *RequestBodyContentRequired) As(target any) bool

type RequestBodyRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *RequestBody

	// Has unexported fields.
}
    RequestBodyRef represents either a RequestBody or a $ref to a RequestBody.
    When serializing and both fields are set, Ref is preferred over Value.

func (x *RequestBodyRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *RequestBodyRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x RequestBodyRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of RequestBodyRef.

func (x RequestBodyRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of RequestBodyRef.

func (x *RequestBodyRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *RequestBodyRef) RefString() string
    RefString returns the $ref value.

func (x *RequestBodyRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets RequestBodyRef to a copy of data.

func (x *RequestBodyRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if RequestBodyRef does not comply with the OpenAPI
    spec.

type RequiredFieldError struct {
	// Field is the JSON-pointer-style path of the required field
	// (e.g. "info.version", "license.name", "openapi", "server.url").
	Field string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true. Nil for
	// document-root fields (Loader doesn't track Origin on *T) and on
	// loads where origin tracking was off.
	Origin *Origin
}
    RequiredFieldError clusters "X must be a non-empty value" failures across
    the spec (info.title, info.version, license.name, the openapi version
    string, server.url). Carries the field path, wraps the per-site leaf so
    callers can match either:

        var rfe *RequiredFieldError
        if errors.As(err, &rfe) { /* knows the field */ }

        var ivr *InfoVersionRequired
        if errors.As(err, &ivr) { /* knows it's exactly info.version */ }

func (e *RequiredFieldError) Error() string

func (e *RequiredFieldError) Unwrap() error

type Response struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Description *string `json:"description,omitempty" yaml:"description,omitempty"`
	Headers     Headers `json:"headers,omitempty" yaml:"headers,omitempty"`
	Content     Content `json:"content,omitempty" yaml:"content,omitempty"`
	Links       Links   `json:"links,omitempty" yaml:"links,omitempty"`
}
    Response is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-object

func NewResponse() *Response

func (response Response) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Response.

func (response Response) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Response.

func (response *Response) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Response to a copy of data.

func (response *Response) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Response does not comply with the OpenAPI spec.

func (response *Response) WithContent(content Content) *Response

func (response *Response) WithDescription(value string) *Response

func (response *Response) WithJSONSchema(schema *Schema) *Response

func (response *Response) WithJSONSchemaRef(schema *SchemaRef) *Response

type ResponseBodies map[string]*ResponseRef // ResponseBodies represents components' named response bodies

func (m ResponseBodies) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (responseBodies *ResponseBodies) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets ResponseBodies to a copy of data.

type ResponseDescriptionRequired struct{ ValidationError }

func (e *ResponseDescriptionRequired) As(target any) bool

type ResponseRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *Response

	// Has unexported fields.
}
    ResponseRef represents either a Response or a $ref to a Response. When
    serializing and both fields are set, Ref is preferred over Value.

func (x *ResponseRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *ResponseRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x ResponseRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of ResponseRef.

func (x ResponseRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of ResponseRef.

func (x *ResponseRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *ResponseRef) RefString() string
    RefString returns the $ref value.

func (x *ResponseRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets ResponseRef to a copy of data.

func (x *ResponseRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if ResponseRef does not comply with the OpenAPI
    spec.

type Responses struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	// Has unexported fields.
}
    Responses is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#responses-object

func NewResponses(opts ...NewResponsesOption) *Responses
    NewResponses builds a responses object with response objects in insertion
    order. Given no arguments, NewResponses returns an empty responses object.

func NewResponsesWithCapacity(cap int) *Responses
    NewResponsesWithCapacity builds a responses object of the given capacity.

func (responses *Responses) Default() *ResponseRef
    Default returns the default response

func (responses *Responses) Delete(key string)
    Delete removes the entry associated with key 'key' from 'responses'.

func (responses Responses) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://github.com/go-openapi/jsonpointer#JSONPointable

func (responses *Responses) Keys() []string
    Keys returns the responses keys in a fixed order

func (responses *Responses) Len() int
    Len returns the amount of keys in responses excluding responses.Extensions.

func (responses *Responses) Map() (m map[string]*ResponseRef)
    Map returns responses as a 'map'. Note: iteration on Go maps is not ordered.

func (responses *Responses) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Responses.

func (responses *Responses) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Responses.

func (responses *Responses) Set(key string, value *ResponseRef)
    Set adds or replaces key 'key' of 'responses' with 'value'. Note:
    'responses' MUST be non-nil

func (responses *Responses) Status(status int) *ResponseRef
    Status returns a ResponseRef for the given status If an exact
    match isn't initially found a patterned field is checked using
    the first digit to determine the range (eg: 201 to 2XX) See
    https://spec.openapis.org/oas/v3.0.3#patterned-fields-0

func (responses *Responses) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Responses to a copy of data.

func (responses *Responses) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Responses does not comply with the OpenAPI
    spec.

func (responses *Responses) Value(key string) *ResponseRef
    Value returns the responses for key or nil

type ResponsesNonEmptyRequired struct{ ValidationError }

func (e *ResponsesNonEmptyRequired) As(target any) bool

type Schema struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	OneOf        SchemaRefs    `json:"oneOf,omitempty" yaml:"oneOf,omitempty"`
	AnyOf        SchemaRefs    `json:"anyOf,omitempty" yaml:"anyOf,omitempty"`
	AllOf        SchemaRefs    `json:"allOf,omitempty" yaml:"allOf,omitempty"`
	Not          *SchemaRef    `json:"not,omitempty" yaml:"not,omitempty"`
	Type         *Types        `json:"type,omitempty" yaml:"type,omitempty"`
	Title        string        `json:"title,omitempty" yaml:"title,omitempty"`
	Format       string        `json:"format,omitempty" yaml:"format,omitempty"`
	Description  string        `json:"description,omitempty" yaml:"description,omitempty"`
	Enum         []any         `json:"enum,omitempty" yaml:"enum,omitempty"`
	Default      any           `json:"default,omitempty" yaml:"default,omitempty"`
	Example      any           `json:"example,omitempty" yaml:"example,omitempty"`
	ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`

	// Array-related, here for struct compactness
	UniqueItems bool `json:"uniqueItems,omitempty" yaml:"uniqueItems,omitempty"`
	// Number-related, here for struct compactness
	ExclusiveMin ExclusiveBound `json:"exclusiveMinimum,omitempty" yaml:"exclusiveMinimum,omitempty"` // Number for v3.1+ otherwise boolean
	ExclusiveMax ExclusiveBound `json:"exclusiveMaximum,omitempty" yaml:"exclusiveMaximum,omitempty"` // Number for v3.1+ otherwise boolean
	// Properties
	Nullable        bool `json:"nullable,omitempty" yaml:"nullable,omitempty"`
	ReadOnly        bool `json:"readOnly,omitempty" yaml:"readOnly,omitempty"`
	WriteOnly       bool `json:"writeOnly,omitempty" yaml:"writeOnly,omitempty"`
	AllowEmptyValue bool `json:"allowEmptyValue,omitempty" yaml:"allowEmptyValue,omitempty"`
	Deprecated      bool `json:"deprecated,omitempty" yaml:"deprecated,omitempty"`
	XML             *XML `json:"xml,omitempty" yaml:"xml,omitempty"`

	// Number
	Min        *float64 `json:"minimum,omitempty" yaml:"minimum,omitempty"`
	Max        *float64 `json:"maximum,omitempty" yaml:"maximum,omitempty"`
	MultipleOf *float64 `json:"multipleOf,omitempty" yaml:"multipleOf,omitempty"`

	// String
	MinLength uint64  `json:"minLength,omitempty" yaml:"minLength,omitempty"`
	MaxLength *uint64 `json:"maxLength,omitempty" yaml:"maxLength,omitempty"`
	Pattern   string  `json:"pattern,omitempty" yaml:"pattern,omitempty"`

	// Array
	MinItems uint64     `json:"minItems,omitempty" yaml:"minItems,omitempty"`
	MaxItems *uint64    `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
	Items    *SchemaRef `json:"items,omitempty" yaml:"items,omitempty"`

	// Object
	Required             []string             `json:"required,omitempty" yaml:"required,omitempty"`
	Properties           Schemas              `json:"properties,omitempty" yaml:"properties,omitempty"`
	MinProps             uint64               `json:"minProperties,omitempty" yaml:"minProperties,omitempty"`
	MaxProps             *uint64              `json:"maxProperties,omitempty" yaml:"maxProperties,omitempty"`
	AdditionalProperties AdditionalProperties `json:"additionalProperties,omitempty" yaml:"additionalProperties,omitempty"`
	Discriminator        *Discriminator       `json:"discriminator,omitempty" yaml:"discriminator,omitempty"`

	Const                 any        `json:"const,omitempty" yaml:"const,omitempty"`                                 // OpenAPI >=3.1
	Examples              []any      `json:"examples,omitempty" yaml:"examples,omitempty"`                           // OpenAPI >=3.1
	PrefixItems           SchemaRefs `json:"prefixItems,omitempty" yaml:"prefixItems,omitempty"`                     // OpenAPI >=3.1
	Contains              *SchemaRef `json:"contains,omitempty" yaml:"contains,omitempty"`                           // OpenAPI >=3.1
	MinContains           *uint64    `json:"minContains,omitempty" yaml:"minContains,omitempty"`                     // OpenAPI >=3.1
	MaxContains           *uint64    `json:"maxContains,omitempty" yaml:"maxContains,omitempty"`                     // OpenAPI >=3.1
	PatternProperties     Schemas    `json:"patternProperties,omitempty" yaml:"patternProperties,omitempty"`         // OpenAPI >=3.1
	DependentSchemas      Schemas    `json:"dependentSchemas,omitempty" yaml:"dependentSchemas,omitempty"`           // OpenAPI >=3.1
	PropertyNames         *SchemaRef `json:"propertyNames,omitempty" yaml:"propertyNames,omitempty"`                 // OpenAPI >=3.1
	UnevaluatedItems      BoolSchema `json:"unevaluatedItems,omitempty" yaml:"unevaluatedItems,omitempty"`           // OpenAPI >=3.1
	UnevaluatedProperties BoolSchema `json:"unevaluatedProperties,omitempty" yaml:"unevaluatedProperties,omitempty"` // OpenAPI >=3.1

	If   *SchemaRef `json:"if,omitempty" yaml:"if,omitempty"`     // OpenAPI >=3.1
	Then *SchemaRef `json:"then,omitempty" yaml:"then,omitempty"` // OpenAPI >=3.1
	Else *SchemaRef `json:"else,omitempty" yaml:"else,omitempty"` // OpenAPI >=3.1

	DependentRequired map[string][]string `json:"dependentRequired,omitempty" yaml:"dependentRequired,omitempty"` // OpenAPI >=3.1

	Defs          Schemas `json:"$defs,omitempty" yaml:"$defs,omitempty"`       // OpenAPI >=3.1
	SchemaDialect string  `json:"$schema,omitempty" yaml:"$schema,omitempty"`   // OpenAPI >=3.1
	Comment       string  `json:"$comment,omitempty" yaml:"$comment,omitempty"` // OpenAPI >=3.1

	SchemaID      string `json:"$id,omitempty" yaml:"$id,omitempty"`                       // OpenAPI >=3.1
	Anchor        string `json:"$anchor,omitempty" yaml:"$anchor,omitempty"`               // OpenAPI >=3.1
	DynamicRef    string `json:"$dynamicRef,omitempty" yaml:"$dynamicRef,omitempty"`       // OpenAPI >=3.1
	DynamicAnchor string `json:"$dynamicAnchor,omitempty" yaml:"$dynamicAnchor,omitempty"` // OpenAPI >=3.1

	ContentMediaType string     `json:"contentMediaType,omitempty" yaml:"contentMediaType,omitempty"` // OpenAPI >=3.1
	ContentEncoding  string     `json:"contentEncoding,omitempty" yaml:"contentEncoding,omitempty"`   // OpenAPI >=3.1
	ContentSchema    *SchemaRef `json:"contentSchema,omitempty" yaml:"contentSchema,omitempty"`       // OpenAPI >=3.1
}
    Schema is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object
    and
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object

func NewAllOfSchema(schemas ...*Schema) *Schema

func NewAnyOfSchema(schemas ...*Schema) *Schema

func NewArraySchema() *Schema

func NewBoolSchema() *Schema

func NewBytesSchema() *Schema

func NewDateTimeSchema() *Schema

func NewFloat64Schema() *Schema

func NewInt32Schema() *Schema

func NewInt64Schema() *Schema

func NewIntegerSchema() *Schema

func NewObjectSchema() *Schema

func NewOneOfSchema(schemas ...*Schema) *Schema

func NewSchema() *Schema

func NewStringSchema() *Schema

func NewUUIDSchema() *Schema

func (schema *Schema) IsEmpty() bool
    IsEmpty tells whether schema is equivalent to the empty schema `{}`.

func (schema *Schema) IsMatching(value any) bool

func (schema *Schema) IsMatchingJSONArray(value []any) bool

func (schema *Schema) IsMatchingJSONBoolean(value bool) bool

func (schema *Schema) IsMatchingJSONNumber(value float64) bool

func (schema *Schema) IsMatchingJSONObject(value map[string]any) bool

func (schema *Schema) IsMatchingJSONString(value string) bool

func (schema Schema) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (schema Schema) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Schema.

func (schema Schema) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Schema.

func (schema *Schema) NewRef() *SchemaRef

func (schema *Schema) PermitsNull() bool

func (schema *Schema) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Schema to a copy of data.

func (schema *Schema) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Schema does not comply with the OpenAPI spec.

func (schema *Schema) VisitJSON(value any, opts ...SchemaValidationOption) error
    VisitJSON applies a Schema to the given data, considering opts.
    To validate data against an OpenAPIv3.1+ schema, be sure to pass the
    EnableJSONSchema2020() option.

func (schema *Schema) VisitJSONArray(value []any) error

func (schema *Schema) VisitJSONBoolean(value bool) error

func (schema *Schema) VisitJSONNumber(value float64) error

func (schema *Schema) VisitJSONObject(value map[string]any) error

func (schema *Schema) VisitJSONString(value string) error

func (schema *Schema) WithAdditionalProperties(v *Schema) *Schema

func (schema *Schema) WithAnyAdditionalProperties() *Schema

func (schema *Schema) WithDefault(defaultValue any) *Schema

func (schema *Schema) WithEnum(values ...any) *Schema

func (schema *Schema) WithExclusiveMax(value bool) *Schema
    WithExclusiveMax sets exclusiveMaximum as a boolean (OpenAPI 3.0 style).

func (schema *Schema) WithExclusiveMaxValue(value float64) *Schema
    WithExclusiveMaxValue sets exclusiveMaximum as a number (OpenAPI 3.1 style).

func (schema *Schema) WithExclusiveMin(value bool) *Schema
    WithExclusiveMin sets exclusiveMinimum as a boolean (OpenAPI 3.0 style).

func (schema *Schema) WithExclusiveMinValue(value float64) *Schema
    WithExclusiveMinValue sets exclusiveMinimum as a number (OpenAPI 3.1 style).

func (schema *Schema) WithFormat(value string) *Schema

func (schema *Schema) WithItems(value *Schema) *Schema

func (schema *Schema) WithLength(i int64) *Schema

func (schema *Schema) WithLengthDecodedBase64(i int64) *Schema

func (schema *Schema) WithMax(value float64) *Schema

func (schema *Schema) WithMaxItems(i int64) *Schema

func (schema *Schema) WithMaxLength(i int64) *Schema

func (schema *Schema) WithMaxLengthDecodedBase64(i int64) *Schema

func (schema *Schema) WithMaxProperties(i int64) *Schema

func (schema *Schema) WithMin(value float64) *Schema

func (schema *Schema) WithMinItems(i int64) *Schema

func (schema *Schema) WithMinLength(i int64) *Schema

func (schema *Schema) WithMinLengthDecodedBase64(i int64) *Schema

func (schema *Schema) WithMinProperties(i int64) *Schema

func (schema *Schema) WithNullable() *Schema

func (schema *Schema) WithPattern(pattern string) *Schema

func (schema *Schema) WithProperties(properties map[string]*Schema) *Schema

func (schema *Schema) WithProperty(name string, propertySchema *Schema) *Schema

func (schema *Schema) WithPropertyRef(name string, ref *SchemaRef) *Schema

func (schema *Schema) WithRequired(required []string) *Schema

func (schema *Schema) WithUniqueItems(unique bool) *Schema

func (schema *Schema) WithoutAdditionalProperties() *Schema

type SchemaAdditionalPropertiesBothForms struct{ ValidationError }

func (e *SchemaAdditionalPropertiesBothForms) As(target any) bool

type SchemaBothFormsExclusive struct {
	// Field is the name of the union-typed schema property
	// (e.g. "additionalProperties", "unevaluatedItems").
	Field string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    SchemaBothFormsExclusive clusters "this union-typed schema field is
    set to both its boolean and schema forms simultaneously" failures —
    additionalProperties, unevaluatedItems, unevaluatedProperties.

func (e *SchemaBothFormsExclusive) Error() string

func (e *SchemaBothFormsExclusive) Unwrap() error

type SchemaError struct {
	// Value is the value that failed validation.
	Value any

	// Schema is the schema that failed validation.
	Schema *Schema
	// SchemaField is the field of the schema that failed validation.
	SchemaField string
	// Reason is a human-readable message describing the error.
	// The message should never include the original value to prevent leakage of potentially sensitive inputs in error messages.
	Reason string
	// Origin is the original error that caused this error.
	Origin error

	// Has unexported fields.
}
    SchemaError is an error that occurs during schema validation.

func (err *SchemaError) Error() string

func (err *SchemaError) JSONPointer() []string

func (err SchemaError) Unwrap() error

type SchemaFieldFor31Plus struct{ ValidationError }

func (e *SchemaFieldFor31Plus) As(target any) bool

type SchemaItemsRequired struct{ ValidationError }

func (e *SchemaItemsRequired) As(target any) bool

type SchemaPatternRegexError struct {
	// Pattern is the schema's `pattern:` value that failed to compile.
	Pattern string
	// Cause is the underlying error (a *SchemaError wrapping the
	// regexp package's syntax error). Unwrap returns this so callers
	// walking the error chain see the SchemaError.
	Cause error
	// Origin is the source location of the offending schema when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    SchemaPatternRegexError clusters "schema pattern failed to compile"
    failures. Kin's regex engine is Go's RE2, which rejects Perl features
    like `(?!...)` lookahead; specs that leak Perl regex patterns (common
    in AWS-style auto-generated schemas) trip this. Carries the offending
    pattern as a structured field for typed dispatch, while preserving the
    underlying SchemaError's rendered message byte-for-byte (Error() delegates
    to Cause.Error()) so existing string-based consumers and golden fixtures are
    unaffected.

func (e *SchemaPatternRegexError) Error() string

func (e *SchemaPatternRegexError) Unwrap() error

type SchemaReadOnlyWriteOnlyExclusive struct{ ValidationError }

func (e *SchemaReadOnlyWriteOnlyExclusive) As(target any) bool

type SchemaRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *Schema

	// Has unexported fields.
}
    SchemaRef represents either a Schema or a $ref to a Schema. When serializing
    and both fields are set, Ref is preferred over Value.

func NewSchemaRef(ref string, value *Schema) *SchemaRef
    NewSchemaRef simply builds a SchemaRef

func (x *SchemaRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *SchemaRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x SchemaRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of SchemaRef.

func (x SchemaRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of SchemaRef.

func (x *SchemaRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *SchemaRef) RefString() string
    RefString returns the $ref value.

func (x *SchemaRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets SchemaRef to a copy of data.

func (x *SchemaRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if SchemaRef does not comply with the OpenAPI
    spec.

type SchemaRefs []*SchemaRef

func (s SchemaRefs) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

type SchemaTypeError struct {
	// Type is the rejected type value (e.g. "bool", "int", "http").
	Type string
	// Origin is the source location of the offending schema when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    SchemaTypeError clusters "unsupported 'type' value" failures on a Schema.
    Carries the bad type value so callers can surface it in user-facing output
    and filter findings by it.

func (e *SchemaTypeError) Error() string

type SchemaUnevaluatedItemsBothForms struct{ ValidationError }

func (e *SchemaUnevaluatedItemsBothForms) As(target any) bool

type SchemaUnevaluatedPropertiesBothForms struct{ ValidationError }

func (e *SchemaUnevaluatedPropertiesBothForms) As(target any) bool

type SchemaValidationOption func(*schemaValidationSettings)
    SchemaValidationOption describes options a user has when validating request
    / response bodies.

func DefaultsSet(f func()) SchemaValidationOption
    DefaultsSet executes the given callback (once) IFF schema validation set
    default values.

func DisablePatternValidation() SchemaValidationOption
    DisablePatternValidation setting makes Validate not return an error when
    validating patterns that are not supported by the Go regexp engine.

func DisableReadOnlyValidation() SchemaValidationOption
    DisableReadOnlyValidation setting makes Validate not return an error when
    validating properties marked as read-only

func DisableWriteOnlyValidation() SchemaValidationOption
    DisableWriteOnlyValidation setting makes Validate not return an error when
    validating properties marked as write-only

func EnableFormatValidation() SchemaValidationOption
    EnableFormatValidation setting makes Validate not return an error when
    validating documents that mention schema formats that are not defined by the
    OpenAPIv3 specification.

func EnableJSONSchema2020() SchemaValidationOption
    EnableJSONSchema2020 enables JSON Schema 2020-12 compliant validation.
    This enables support for OpenAPI 3.1 and JSON Schema 2020-12 features.
    When enabled, validation uses the jsonschema library instead of the built-in
    validator.

func FailFast() SchemaValidationOption
    FailFast returns schema validation errors quicker.

func MultiErrors() SchemaValidationOption

func SetSchemaErrorMessageCustomizer(f func(err *SchemaError) string) SchemaValidationOption
    SetSchemaErrorMessageCustomizer allows to override the schema error message.
    If the passed function returns an empty string, it returns to the previous
    Error() implementation.

func SetSchemaRegexCompiler(c RegexCompilerFunc) SchemaValidationOption
    SetSchemaRegexCompiler allows to override the regex implementation used to
    validate field "pattern".

func VisitAsRequest() SchemaValidationOption

func VisitAsResponse() SchemaValidationOption

func WithIntegerFormatValidator(name string, validator IntegerFormatValidator) SchemaValidationOption
    WithIntegerFormatValidator adds a single per-validation integer format
    validator. This validator is checked before global SchemaIntegerFormats
    and allows different validations for the same format name across different
    specs.

func WithIntegerFormatValidators(validators map[string]IntegerFormatValidator) SchemaValidationOption
    WithIntegerFormatValidators adds per-validation integer format validators.
    These validators are checked before global SchemaIntegerFormats and allow
    different validations for the same format name across different specs.

func WithNumberFormatValidator(name string, validator NumberFormatValidator) SchemaValidationOption
    WithNumberFormatValidator adds a single per-validation number format
    validator. This validator is checked before global SchemaNumberFormats
    and allows different validations for the same format name across different
    specs.

func WithNumberFormatValidators(validators map[string]NumberFormatValidator) SchemaValidationOption
    WithNumberFormatValidators adds per-validation number format validators.
    These validators are checked before global SchemaNumberFormats and allow
    different validations for the same format name across different specs.

func WithStringFormatValidator(name string, validator StringFormatValidator) SchemaValidationOption
    WithStringFormatValidator adds a single per-validation string format
    validator. This validator is checked before global SchemaStringFormats
    and allows different validations for the same format name across different
    specs.

func WithStringFormatValidators(validators map[string]StringFormatValidator) SchemaValidationOption
    WithStringFormatValidators adds per-validation string format validators.
    These validators are checked before global SchemaStringFormats and allow
    different validations for the same format name across different specs.

type SchemaValueError struct {
	// ValueKind identifies the schema sub-field whose value failed
	// (e.g. "example", "default").
	ValueKind string
	// Cause is the underlying error from schema.VisitJSON — either a
	// *SchemaError or a MultiError of them. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true. Nil when
	// origin tracking is off.
	Origin *Origin
}
    SchemaValueError clusters failures of "this schema's <kind> value doesn't
    satisfy the schema's own constraints" — example, default, examples[i], etc.
    checked against the schema during document validation. Wraps the underlying
    error from VisitJSON (a *SchemaError or a MultiError of them) so callers can
    match either:

        var sve *SchemaValueError
        if errors.As(err, &sve) { /* knows ValueKind = "example" */ }

        var se *SchemaError
        if errors.As(err, &se) { /* full schema-validation detail */ }

    Cause is typed as error (not *SchemaError) because VisitJSON can return
    either a single SchemaError or a MultiError aggregating several. errors.As
    walks both shapes transparently.

func (e *SchemaValueError) Error() string

func (e *SchemaValueError) Unwrap() error

type Schemas map[string]*SchemaRef // Schemas represents components' named schemas

func (m Schemas) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (schemas *Schemas) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets Schemas to a copy of data.

type SectionValidationError struct {
	Section string
	Cause   error
}
    SectionValidationError wraps an error originating inside one of the
    top-level OpenAPI document sections (info, paths, components, security,
    servers, tags, externalDocs, webhooks, jsonSchemaDialect). Section is the
    OpenAPI field name as it appears in the document root.

    Use errors.As(err, &sve) to extract the section context from a validation
    error chain without parsing the rendered message.

func (e *SectionValidationError) Error() string

func (e *SectionValidationError) Unwrap() error

type SecurityRequirement map[string][]string
    SecurityRequirement is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object

func NewSecurityRequirement() SecurityRequirement

func (security SecurityRequirement) Authenticate(provider string, scopes ...string) SecurityRequirement

func (security *SecurityRequirement) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets SecurityRequirement to a copy of data.

func (security *SecurityRequirement) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if SecurityRequirement does not comply with the
    OpenAPI spec.

type SecurityRequirements []SecurityRequirement

func NewSecurityRequirements() *SecurityRequirements

func (srs SecurityRequirements) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if SecurityRequirements does not comply with the
    OpenAPI spec.

func (srs *SecurityRequirements) With(securityRequirement SecurityRequirement) *SecurityRequirements

type SecurityScheme struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Type             string      `json:"type,omitempty" yaml:"type,omitempty"`
	Description      string      `json:"description,omitempty" yaml:"description,omitempty"`
	Name             string      `json:"name,omitempty" yaml:"name,omitempty"`
	In               string      `json:"in,omitempty" yaml:"in,omitempty"`
	Scheme           string      `json:"scheme,omitempty" yaml:"scheme,omitempty"`
	BearerFormat     string      `json:"bearerFormat,omitempty" yaml:"bearerFormat,omitempty"`
	Flows            *OAuthFlows `json:"flows,omitempty" yaml:"flows,omitempty"`
	OpenIdConnectUrl string      `json:"openIdConnectUrl,omitempty" yaml:"openIdConnectUrl,omitempty"`
}
    SecurityScheme is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object
    and
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-scheme-object

func NewCSRFSecurityScheme() *SecurityScheme

func NewJWTSecurityScheme() *SecurityScheme

func NewOIDCSecurityScheme(oidcUrl string) *SecurityScheme

func NewSecurityScheme() *SecurityScheme

func (ss SecurityScheme) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of SecurityScheme.

func (ss SecurityScheme) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of SecurityScheme.

func (ss *SecurityScheme) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets SecurityScheme to a copy of data.

func (ss *SecurityScheme) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if SecurityScheme does not comply with the OpenAPI
    spec.

func (ss *SecurityScheme) WithBearerFormat(value string) *SecurityScheme

func (ss *SecurityScheme) WithDescription(value string) *SecurityScheme

func (ss *SecurityScheme) WithIn(value string) *SecurityScheme

func (ss *SecurityScheme) WithName(value string) *SecurityScheme

func (ss *SecurityScheme) WithScheme(value string) *SecurityScheme

func (ss *SecurityScheme) WithType(value string) *SecurityScheme

type SecuritySchemeBearerFormatForbidden struct{ ValidationError }

func (e *SecuritySchemeBearerFormatForbidden) As(target any) bool

type SecuritySchemeFlowValidationError struct {
	Cause error
}
    SecuritySchemeFlowValidationError wraps validation errors on the outer flows
    object of an oauth2 security scheme.

func (e *SecuritySchemeFlowValidationError) Error() string

func (e *SecuritySchemeFlowValidationError) Unwrap() error

type SecuritySchemeFlowsForbidden struct{ ValidationError }

func (e *SecuritySchemeFlowsForbidden) As(target any) bool

type SecuritySchemeFlowsRequired struct{ ValidationError }

func (e *SecuritySchemeFlowsRequired) As(target any) bool

type SecuritySchemeInForbidden struct{ ValidationError }

func (e *SecuritySchemeInForbidden) As(target any) bool

type SecuritySchemeNameForbidden struct{ ValidationError }

func (e *SecuritySchemeNameForbidden) As(target any) bool

type SecuritySchemeRef struct {
	// Extensions only captures fields starting with 'x-' as no other fields
	// are allowed by the openapi spec.
	Extensions map[string]any
	Origin     *Origin `json:"-" yaml:"-"`

	Ref   string
	Value *SecurityScheme

	// Has unexported fields.
}
    SecuritySchemeRef represents either a SecurityScheme or a $ref to a
    SecurityScheme. When serializing and both fields are set, Ref is preferred
    over Value.

func (x *SecuritySchemeRef) CollectionName() string
    CollectionName returns the JSON string used for a collection of these
    components.

func (x *SecuritySchemeRef) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (x SecuritySchemeRef) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of SecuritySchemeRef.

func (x SecuritySchemeRef) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of SecuritySchemeRef.

func (x *SecuritySchemeRef) RefPath() *url.URL
    RefPath returns the path of the $ref relative to the root document.

func (x *SecuritySchemeRef) RefString() string
    RefString returns the $ref value.

func (x *SecuritySchemeRef) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets SecuritySchemeRef to a copy of data.

func (x *SecuritySchemeRef) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if SecuritySchemeRef does not comply with the
    OpenAPI spec.

type SecuritySchemes map[string]*SecuritySchemeRef // SecuritySchemes represents components' named security schemes

func (m SecuritySchemes) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (securitySchemes *SecuritySchemes) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets SecuritySchemes to a copy of data.

type SerializationMethod struct {
	Style   string
	Explode bool
}
    SerializationMethod describes a serialization method of HTTP request's
    parameters and body.

type Server struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	URL         string          `json:"url" yaml:"url"` // Required
	Description string          `json:"description,omitempty" yaml:"description,omitempty"`
	Variables   ServerVariables `json:"variables,omitempty" yaml:"variables,omitempty"`
}
    Server is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-object

func (server *Server) BasePath() (string, error)
    BasePath returns the base path extracted from the default values of
    variables, if any. Assumes a valid struct (per Validate()).

func (server Server) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Server.

func (server Server) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Server.

func (server Server) MatchRawURL(input string) ([]string, string, bool)

func (server Server) ParameterNames() ([]string, error)

func (server *Server) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Server to a copy of data.

func (server *Server) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Server does not comply with the OpenAPI spec.

type ServerURLMismatchedBraces struct{ ValidationError }

func (e *ServerURLMismatchedBraces) As(target any) bool

type ServerURLRequired struct{ ValidationError }

func (e *ServerURLRequired) As(target any) bool

type ServerURLTemplateError struct {
	// URL is the server URL whose template failed validation.
	URL string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    ServerURLTemplateError clusters server URL template failures — mismatched
    braces and undeclared variables (template variables not matched by
    Server.Variables, or vice versa).

func (e *ServerURLTemplateError) Error() string

func (e *ServerURLTemplateError) Unwrap() error

type ServerURLUndeclaredVariables struct{ ValidationError }

func (e *ServerURLUndeclaredVariables) As(target any) bool

type ServerVariable struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Enum        []string `json:"enum,omitempty" yaml:"enum,omitempty"`
	Default     string   `json:"default,omitempty" yaml:"default,omitempty"`
	Description string   `json:"description,omitempty" yaml:"description,omitempty"`
}

func (serverVariable ServerVariable) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of ServerVariable.

func (serverVariable ServerVariable) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of ServerVariable.

func (serverVariable *ServerVariable) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets ServerVariable to a copy of data.

func (serverVariable *ServerVariable) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if ServerVariable does not comply with the OpenAPI
    spec.

type ServerVariableDefaultRequired struct{ ValidationError }

func (e *ServerVariableDefaultRequired) As(target any) bool

type ServerVariables map[string]*ServerVariable
    ServerVariable is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object
    ServerVariables is a map of ServerVariable objects keyed by variable name.

func (serverVariables *ServerVariables) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets ServerVariables to a copy of data.

type Servers []*Server
    Servers is specified by OpenAPI/Swagger standard version 3.

func (servers Servers) BasePath() (string, error)
    BasePath returns the base path of the first server in the list, or /.

func (servers Servers) MatchURL(parsedURL *url.URL) (*Server, []string, string)

func (servers Servers) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Servers does not comply with the OpenAPI spec.

type SingleEntryContentError struct {
	// Subject is the kind of object whose Content map is too large
	// ("parameter", "header").
	Subject string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
	// Origin is the source location of the offending element when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    SingleEntryContentError clusters "the content map must contain at most one
    entry" failures (parameter.content, header.content).

func (e *SingleEntryContentError) Error() string

func (e *SingleEntryContentError) Unwrap() error

type SliceUniqueItemsChecker func(items []any) bool
    SliceUniqueItemsChecker is an function used to check if an given slice have
    unique items.

type StringFormatValidator = FormatValidator[string]
    StringFormatValidator is a type alias for FormatValidator[string]

func NewRegexpFormatValidator(pattern string) StringFormatValidator
    NewRegexpFormatValidator creates a new FormatValidator that uses a regular
    expression to validate the value.

type StringMap[V any] map[string]V
    StringMap is a map[string]string that ignores the origin in the underlying
    json representation.

func (stringMap *StringMap[V]) UnmarshalJSON(data []byte) (err error)
    UnmarshalJSON sets StringMap to a copy of data.

type T struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	OpenAPI           string               `json:"openapi" yaml:"openapi"` // Required
	Components        *Components          `json:"components,omitempty" yaml:"components,omitempty"`
	Info              *Info                `json:"info" yaml:"info"`   // Required
	Paths             *Paths               `json:"paths" yaml:"paths"` // Required in 3.0, optional in 3.1
	Security          SecurityRequirements `json:"security,omitempty" yaml:"security,omitempty"`
	Servers           Servers              `json:"servers,omitempty" yaml:"servers,omitempty"`
	Tags              Tags                 `json:"tags,omitempty" yaml:"tags,omitempty"`
	ExternalDocs      *ExternalDocs        `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
	Webhooks          map[string]*PathItem `json:"webhooks,omitempty" yaml:"webhooks,omitempty"`                   // OpenAPI >=3.1
	JSONSchemaDialect string               `json:"jsonSchemaDialect,omitempty" yaml:"jsonSchemaDialect,omitempty"` // OpenAPI >=3.1

	// Has unexported fields.
}
    T is the root of an OpenAPI v3 document See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-object
    and
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object

func (doc *T) AddOperation(path string, method string, operation *Operation)

func (doc *T) AddServer(server *Server)

func (doc *T) AddServers(servers ...*Server)

func (doc *T) GetSchemaValidationOptions() []SchemaValidationOption
    GetSchemaValidationOptions returns SchemaValidationOptions that include this
    document's format validators. Use this when validating schemas from this
    document.

func (doc *T) InternalizeRefs(ctx context.Context, refNameResolver func(*T, ComponentRef) string)
    InternalizeRefs removes all references to external files from the spec and
    moves them to the components section.

    refNameResolver takes in references to returns a name to store the reference
    under locally. It MUST return a unique name for each reference type.
    A default implementation is provided that will suffice for most use cases.
    See the function documentation for more details.

    Example:

        doc.InternalizeRefs(context.Background(), nil)

func (doc *T) IsOpenAPI30() bool
    IsOpenAPI30 returns whether doc is an OpenAPI document version 3.0.x.
    Returns true for 3, 3.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, ... And false
    for 3.1.0, 3.2, ... and for invalid strings.

func (doc *T) IsOpenAPI31OrLater() bool
    IsOpenAPI31OrLater returns whether doc is an OpenAPI document version >=3.1.
    Returns true for 3.1, 3.1.0, 3.1.1, 3.1.2, 3.2.0, ... And false for cases
    where IsOpenAPI30 returns true and for invalid strings.

func (doc *T) JSONLookup(token string) (any, error)
    JSONLookup implements
    https://pkg.go.dev/github.com/go-openapi/jsonpointer#JSONPointable

func (doc *T) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of T.

func (doc *T) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of T.

func (doc *T) OpenAPIMajorMinor() string
    OpenAPIMajorMinor returns 3.y of the OpenAPI "3.y" or "3.y.z" version of the
    document. Returns the empty string for invalid OpenAPI version strings.

func (doc *T) SetIntegerFormatValidator(name string, validator IntegerFormatValidator)
    SetIntegerFormatValidator sets a single document-scoped integer format
    validator.

func (doc *T) SetIntegerFormatValidators(validators map[string]IntegerFormatValidator)
    SetIntegerFormatValidators sets document-scoped integer format validators.
    These validators are automatically used by all schemas in this document.

func (doc *T) SetNumberFormatValidator(name string, validator NumberFormatValidator)
    SetNumberFormatValidator sets a single document-scoped number format
    validator.

func (doc *T) SetNumberFormatValidators(validators map[string]NumberFormatValidator)
    SetNumberFormatValidators sets document-scoped number format validators.
    These validators are automatically used by all schemas in this document.

func (doc *T) SetStringFormatValidator(name string, validator StringFormatValidator)
    SetStringFormatValidator sets a single document-scoped string format
    validator.

func (doc *T) SetStringFormatValidators(validators map[string]StringFormatValidator)
    SetStringFormatValidators sets document-scoped string format validators.
    These validators are automatically used by all schemas in this document.

func (doc *T) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets T to a copy of data.

func (doc *T) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if T does not comply with the OpenAPI spec.
    Validations Options can be provided to modify the validation behavior.

    By default, doc.OpenAPI's field dictates whether "JSON Schema Draft 2020-12"
    validation is enabled.

func (doc *T) ValidateSchemaJSON(schema *Schema, value any, opts ...SchemaValidationOption) error
    ValidateSchemaJSON validates data against a schema using this document's
    format validators. This is a convenience method that automatically applies
    the document's format validators.

type Tag struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Name         string        `json:"name,omitempty" yaml:"name,omitempty"`
	Description  string        `json:"description,omitempty" yaml:"description,omitempty"`
	ExternalDocs *ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
}
    Tag is specified by OpenAPI/Swagger 3.0 standard. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#tag-object

func (t Tag) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of Tag.

func (t Tag) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of Tag.

func (t *Tag) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets Tag to a copy of data.

func (t *Tag) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Tag does not comply with the OpenAPI spec.

type Tags []*Tag
    Tags is specified by OpenAPI/Swagger 3.0 standard.

func (tags Tags) Get(name string) *Tag

func (tags Tags) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if Tags does not comply with the OpenAPI spec.

type ThenFieldFor31Plus struct{ ValidationError }

func (e *ThenFieldFor31Plus) As(target any) bool

type Types []string
    Types represents the type(s) of a schema.

    In OpenAPI 3.0, this is typically a single type (e.g., "string"). In OpenAPI
    3.1, it can be an array of types (e.g., ["string", "null"]).

    Serialization behavior:
      - Single type: serializes as a string (e.g., "string")
      - Multiple types: serializes as an array (e.g., ["string", "null"])
      - Accepts both string and array formats when unmarshaling

    Example OpenAPI 3.0 (single type):

        schema := &Schema{Type: &Types{"string"}}
        // JSON: {"type": "string"}

    Example OpenAPI 3.1 (type array):

        schema := &Schema{Type: &Types{"string", "null"}}
        // JSON: {"type": ["string", "null"]}

func (pTypes *Types) Includes(typ string) bool
    Includes returns true if the given type is included in the type array.
    Returns false if types is nil.

    Example:

        types := &Types{"string", "null"}
        types.Includes("string")  // true
        types.Includes("null")    // true
        types.Includes("number")  // false

func (types *Types) IncludesNull() bool
    IncludesNull returns true if the type array includes "null". This is useful
    for OpenAPI 3.1 where null is a first-class type.

    Example:

        types := &Types{"string", "null"}
        types.IncludesNull()  // true

        types = &Types{"string"}
        types.IncludesNull()  // false

func (types *Types) Is(typ string) bool
    Is returns true if the schema has exactly one type and it matches the given
    type. This is useful for OpenAPI 3.0 style single-type checks.

    Example:

        types := &Types{"string"}
        types.Is("string")  // true
        types.Is("number")  // false

        types = &Types{"string", "null"}
        types.Is("string")  // false (multiple types)

func (types *Types) IsEmpty() bool
    IsEmpty returns true if no types are specified (nil or empty array).
    When a schema has no type specified, it permits any type.

    Example:

        var nilTypes *Types
        nilTypes.IsEmpty()  // true

        types := &Types{}
        types.IsEmpty()  // true

        types = &Types{"string"}
        types.IsEmpty()  // false

func (types *Types) IsMultiple() bool
    IsMultiple returns true if multiple types are specified. This is an OpenAPI
    3.1 feature that enables type arrays.

    Example:

        types := &Types{"string"}
        types.IsMultiple()  // false

        types = &Types{"string", "null"}
        types.IsMultiple()  // true

func (types *Types) IsSingle() bool
    IsSingle returns true if exactly one type is specified.

    Example:

        types := &Types{"string"}
        types.IsSingle()  // true

        types = &Types{"string", "null"}
        types.IsSingle()  // false

func (pTypes *Types) MarshalJSON() ([]byte, error)

func (pTypes *Types) MarshalYAML() (any, error)

func (types *Types) Permits(typ string) bool
    Permits returns true if the given type is permitted. Returns true if types
    is nil (any type allowed), otherwise checks if the type is included.

    Example:

        var nilTypes *Types
        nilTypes.Permits("anything")  // true (nil permits everything)

        types := &Types{"string"}
        types.Permits("string")  // true
        types.Permits("number")  // false

func (types *Types) Slice() []string
    Slice returns the types as a string slice. Returns nil if types is nil.

    Example:

        types := &Types{"string", "null"}
        slice := types.Slice()  // []string{"string", "null"}

func (types *Types) UnmarshalJSON(data []byte) error

type UnevaluatedItemsFieldFor31Plus struct{ ValidationError }

func (e *UnevaluatedItemsFieldFor31Plus) As(target any) bool

type UnevaluatedPropertiesFieldFor31Plus struct{ ValidationError }

func (e *UnevaluatedPropertiesFieldFor31Plus) As(target any) bool

type UnresolvedRefError struct {
	// Ref is the unresolved $ref value (e.g. "#/components/schemas/X"
	// or "external.yaml#/...").
	Ref string
	// Origin is the source location of the ref-bearing object when the
	// document was loaded with Loader.IncludeOrigin = true.
	Origin *Origin
}
    UnresolvedRefError clusters "found unresolved ref: X" failures fired by the
    loader when a $ref cannot be resolved against the loaded document. Carries
    the offending ref string so callers can surface it in user-facing output and
    filter findings by it.

func (e *UnresolvedRefError) Error() string

type ValidationError struct {
	Message string
}
    ValidationError is the embedded base for every typed validation error
    emitted by the document validation walker (T.Validate, Info.Validate,
    Paths.Validate, etc.). Four categories of typed error are exposed; pick
    whichever the caller needs:

     1. Base — *ValidationError. Catchall for "this is a validation issue,
        here is the message". Reachable from any leaf via the As method that
        each leaf implements.
     2. Cluster — types like *RequiredFieldError or *FieldVersionMismatchError.
        Group families of related failures and expose the family-level metadata
        (Field, MinVersion, ...). Wrap the underlying leaf via Unwrap,
        so errors.As can still walk to the leaf. Some clusters are single-site
        (e.g. *SchemaTypeError) and carry only their own fields with no separate
        leaf.
     3. Leaf — one type per call site (e.g. *InfoVersionRequired,
        *LicenseIdentifierFieldFor31Plus). Lets callers match an exact failure
        point without string comparison.
     4. Context wrapper — types like *SectionValidationError,
        *PathValidationError, *ParameterFieldValidationError. Add scope ("which
        section", "which path", "which parameter") around an inner error chain
        but do NOT themselves report a failure condition — the actual error
        lives in Cause. Defined in validation_error_context.go; see that file's
        header for the full inventory and conventions.

    All four are reachable from the same returned error through standard Go
    error wrapping (errors.As, errors.Is, errors.Unwrap), so a caller that only
    needs "is it a validation error?" stops at the base and a caller that wants
    "is it specifically license.identifier being used in 3.0?" matches the leaf.
    A caller that wants "which section did this happen in?" matches the context
    wrapper and walks further for the cluster/leaf.

    A canonical error chain therefore looks like:

        ComponentValidationError{Section: "schema", Name: "Foo"}
          -> RequiredFieldError{Field: "type"}
            -> SchemaTypeRequired{Message: "..."}

    Context wrapper carries WHERE, cluster carries WHAT category, leaf carries
    EXACTLY WHICH case.

    Backward compatibility: every site that today returns errors.New(msg)
    migrates to a leaf type that embeds ValidationError with Message set to
    the original string. (*ValidationError).Error() returns Message unchanged,
    so existing string-matching consumers see identical output.

func (e *ValidationError) Error() string

type ValidationOption func(options *ValidationOptions)
    ValidationOption allows the modification of how the OpenAPI document is
    validated.

func AllowExtensionsWithRef() ValidationOption
    AllowExtensionsWithRef allows extensions (fields starting with 'x-') as
    siblings for $ref fields. This is the default. Non-extension fields are
    prohibited unless allowed explicitly with the AllowExtraSiblingFields
    option.

func AllowExtraSiblingFields(fields ...string) ValidationOption
    AllowExtraSiblingFields called as AllowExtraSiblingFields("description")
    makes Validate not return an error when said field appears next to a $ref.

func DisableExamplesValidation() ValidationOption
    DisableExamplesValidation disables all example schema validation.
    By default, all schema examples are validated.

func DisableSchemaDefaultsValidation() ValidationOption
    DisableSchemaDefaultsValidation disables schemas' default field validation.
    By default, schema default values are validated against their schema.

func DisableSchemaFormatValidation() ValidationOption
    DisableSchemaFormatValidation does the opposite of
    EnableSchemaFormatValidation. By default, schema format validation is
    disabled.

func DisableSchemaPatternValidation() ValidationOption
    DisableSchemaPatternValidation makes Validate not return an error when
    validating patterns that are not supported by the Go regexp engine.

func EnableExamplesValidation() ValidationOption
    EnableExamplesValidation does the opposite of DisableExamplesValidation.
    By default, all schema examples are validated.

func EnableMultiError() ValidationOption
    EnableMultiError makes Validate aggregate independent validation errors and
    return them together as a MultiError instead of returning the first error
    and stopping. By default, Validate is fail-fast.

    Not every validator reports more than one error yet. Some, such as Schema,
    run checks that build on earlier ones, so continuing past a failure can
    hit a nil dereference or produce nonsense secondary errors. We will keep
    converting more validators in follow-up changes as each one is analyzed.

    To pull a specific error type out of the result, use errors.As(err,
    &target). It walks into the MultiError automatically, so the same call works
    whether Validate returned one error or many.

func EnableSchemaDefaultsValidation() ValidationOption
    EnableSchemaDefaultsValidation does the opposite of
    DisableSchemaDefaultsValidation. By default, schema default values are
    validated against their schema.

func EnableSchemaFormatValidation() ValidationOption
    EnableSchemaFormatValidation makes Validate not return an error when
    validating documents that mention schema formats that are not defined by the
    OpenAPIv3 specification. By default, schema format validation is disabled.

func EnableSchemaPatternValidation() ValidationOption
    EnableSchemaPatternValidation does the opposite of
    DisableSchemaPatternValidation. By default, schema pattern validation is
    enabled.

func IsOpenAPI31OrLater() ValidationOption
    IsOpenAPI31OrLater enables "JSON Schema Draft 2020-12"-compliant validation
    (for OpenAPI 3.1 documents).

func ProhibitExtensionsWithRef() ValidationOption
    ProhibitExtensionsWithRef causes the validation to return an error if
    extensions (fields starting with 'x-') are found as siblings for $ref
    fields. Non-extension fields are prohibited unless allowed explicitly with
    the AllowExtraSiblingFields option.

func SetRegexCompiler(c RegexCompilerFunc) ValidationOption
    SetRegexCompiler allows to override the regex implementation used to
    validate field "pattern".

type ValidationOptions struct {
	// Has unexported fields.
}
    ValidationOptions provides configuration for validating OpenAPI documents.

type WebhookNil struct{ ValidationError }

func (e *WebhookNil) As(target any) bool

type WebhookNilError struct {
	// Name is the webhook key whose value was nil.
	Name string
	// Cause is the underlying leaf error. Walked by errors.Unwrap.
	Cause error
}
    WebhookNilError clusters "the value at webhook key X is nil" failures from
    T.Validate's webhook walk. Carries the offending key name.

func (e *WebhookNilError) Error() string

func (e *WebhookNilError) Unwrap() error

type WebhookValidationError struct {
	// Name is the webhook map key.
	Name  string
	Cause error
}
    WebhookValidationError wraps validation errors on a named webhook at the
    document root (OpenAPI 3.1+).

func (e *WebhookValidationError) Error() string

func (e *WebhookValidationError) Unwrap() error

type WebhooksFieldFor31Plus struct{ ValidationError }

func (e *WebhooksFieldFor31Plus) As(target any) bool

type XML struct {
	Extensions map[string]any `json:"-" yaml:"-"`
	Origin     *Origin        `json:"-" yaml:"-"`

	Name      string `json:"name,omitempty" yaml:"name,omitempty"`
	Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Prefix    string `json:"prefix,omitempty" yaml:"prefix,omitempty"`
	Attribute bool   `json:"attribute,omitempty" yaml:"attribute,omitempty"`
	Wrapped   bool   `json:"wrapped,omitempty" yaml:"wrapped,omitempty"`
}
    XML is specified by OpenAPI/Swagger standard version 3. See
    https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#xml-object

func (xml XML) MarshalJSON() ([]byte, error)
    MarshalJSON returns the JSON encoding of XML.

func (xml XML) MarshalYAML() (any, error)
    MarshalYAML returns the YAML encoding of XML.

func (xml *XML) UnmarshalJSON(data []byte) error
    UnmarshalJSON sets XML to a copy of data.

func (xml *XML) Validate(ctx context.Context, opts ...ValidationOption) error
    Validate returns an error if XML does not comply with the OpenAPI spec.

