Documentation
¶
Index ¶
- Constants
- Variables
- func BaseType(t reflect.Type) reflect.Type
- func Deref(t reflect.Type) reflect.Type
- func ErrorWithHeaders(err error, headers http.Header) error
- func IsEmptyValue(v reflect.Value) bool
- func IsNilValue(v any) bool
- func MarshalJSON(fields []JSONFieldInfo, extensions map[string]any) ([]byte, error)
- func SetReadDeadline(w http.ResponseWriter, deadline time.Time) error
- type API
- type Adapter
- type Components
- type Config
- type Contact
- type ContentTyper
- type Context
- type DiscoveredError
- type Discriminator
- type DocsConfig
- type DocsProvider
- type Empty
- type Encoding
- type Error
- type ErrorDetail
- type ErrorDetailer
- type ErrorDoc
- type ErrorDocEntry
- type ErrorHandler
- type ErrorResponseConfig
- type Example
- type ExampleProvider
- type ExternalDocs
- type FormFile
- type Format
- type Header
- type Headerer
- type HiddenOperationsProvider
- type Info
- type InternalSpecConfig
- type JSONFieldInfo
- type License
- type Link
- type Linker
- type MediaType
- type MiddlewareFunc
- type Middlewares
- type OAuthFlow
- type OAuthFlows
- type OmitType
- type OpenAPI
- type Operation
- type Param
- type PathBuffer
- func (b *PathBuffer) Bytes() []byte
- func (b *PathBuffer) Len() int
- func (b *PathBuffer) Pop()
- func (b *PathBuffer) Push(s string)
- func (b *PathBuffer) PushIndex(i int)
- func (b *PathBuffer) Reset()
- func (b *PathBuffer) String() string
- func (b *PathBuffer) With(s string) string
- func (b *PathBuffer) WithIndex(i int) string
- type PathItem
- type ProtoVersion
- type Registry
- type RequestBody
- type Resolver
- type ResolverWithPath
- type Response
- type Schema
- type SchemaProvider
- type SchemaTransformer
- type SecurityScheme
- type Server
- type ServerVariable
- type StreamResponse
- type Tag
- type Transformer
- type ValidateMode
- type ValidateResult
Constants ¶
View Source
const ( OpenAPIVersion30 = "3.0.3" OpenAPIVersion31 = "3.1.0" OpenAPIVersion32 = "3.2.0" )
View Source
const ( TypeBoolean = "boolean" TypeInteger = "integer" TypeNumber = "number" TypeString = "string" TypeArray = "array" TypeObject = "object" )
Variables ¶
View Source
var ( MsgUnexpectedProperty = "unexpected property" MsgExpectedRFC3339DateTime = "expected string to be RFC 3339 date-time" MsgExpectedRFC1123DateTime = "expected string to be RFC 1123 date-time" MsgExpectedRFC3339Date = "expected string to be RFC 3339 date" MsgExpectedRFC3339Time = "expected string to be RFC 3339 time" MsgExpectedRFC5322Email = "expected string to be RFC 5322 email: %v" MsgExpectedRFC5890Hostname = "expected string to be RFC 5890 hostname" MsgExpectedRFC2673IPv4 = "expected string to be RFC 2673 ipv4" MsgExpectedRFC2373IPv6 = "expected string to be RFC 2373 ipv6" MsgExpectedRFCIPAddr = "expected string to be either RFC 2673 ipv4 or RFC 2373 ipv6" MsgExpectedRFC3986URI = "expected string to be RFC 3986 uri: %v" MsgExpectedRFC4122UUID = "expected string to be RFC 4122 uuid: %v" MsgExpectedRFC6570URITemplate = "expected string to be RFC 6570 uri-template" MsgExpectedRFC6901JSONPointer = "expected string to be RFC 6901 json-pointer" MsgExpectedRFC6901RelativeJSONPointer = "expected string to be RFC 6901 relative-json-pointer" MsgExpectedRegexp = "expected string to be regex: %v" MsgExpectedMatchAtLeastOneSchema = "expected value to match at least one schema but matched none" MsgExpectedMatchExactlyOneSchema = "expected value to match exactly one schema but matched none" MsgExpectedNotMatchSchema = "expected value to not match schema" MsgExpectedPropertyNameInObject = "expected propertyName value to be present in object" MsgExpectedBoolean = "expected boolean" MsgExpectedDuration = "expected duration: %v" MsgExpectedNumber = "expected number" MsgExpectedInteger = "expected integer" MsgExpectedString = "expected string" MsgExpectedBase64String = "expected string to be base64 encoded" MsgExpectedArray = "expected array" MsgExpectedObject = "expected object" MsgExpectedArrayItemsUnique = "expected array items to be unique" MsgExpectedOneOf = "expected value to be one of %s" MsgExpectedMinimumNumber = "expected number >= %v" MsgExpectedExclusiveMinimumNumber = "expected number > %v" MsgExpectedMaximumNumber = "expected number <= %v" MsgExpectedExclusiveMaximumNumber = "expected number < %v" MsgExpectedNumberBeMultipleOf = "expected number to be a multiple of %v" MsgExpectedMinLength = "expected length >= %d" MsgExpectedMaxLength = "expected length <= %d" MsgExpectedBePattern = "expected string to be %s" MsgExpectedMatchPattern = "expected string to match pattern %s" MsgExpectedMinItems = "expected array length >= %d" MsgExpectedMaxItems = "expected array length <= %d" MsgExpectedMinProperties = "expected object with >= %d properties" MsgExpectedMaxProperties = "expected object with <= %d properties" MsgExpectedRequiredProperty = "expected required property %s to be present" MsgExpectedDependentRequiredProperty = "expected property %s to be present when %s is present" )
View Source
var ( ErrUnknownContentType = errors.New("unknown content type") ErrUnknownAcceptContentType = errors.New("unknown accept content type") )
View Source
var ErrSchemaInvalid = errors.New("schema is invalid")
Functions ¶
func IsEmptyValue ¶
func IsNilValue ¶
func MarshalJSON ¶
func MarshalJSON(fields []JSONFieldInfo, extensions map[string]any) ([]byte, error)
func SetReadDeadline ¶
func SetReadDeadline(w http.ResponseWriter, deadline time.Time) error
Types ¶
type API ¶
type API interface {
Adapter() Adapter
OpenAPI() *OpenAPI
Negotiate(accept string) (string, error)
Transform(ctx Context, status string, v any) (any, error)
Marshal(w io.Writer, contentType string, v any) error
Unmarshal(contentType string, data []byte, v any) error
UseMiddleware(middlewares ...MiddlewareFunc)
Middlewares() Middlewares
ErrorHandler() ErrorHandler
GenerateOperationID(method, path string) string
UseGlobalMiddleware(middlewares ...MiddlewareFunc)
}
type Adapter ¶
type Adapter interface {
Handle(op *Operation, handler func(ctx Context))
ServeHTTP(http.ResponseWriter, *http.Request)
}
Adapter Every adapter package MUST also export these package-level symbols:
func NewAdapter(router) Adapter func New(router, Config) API func Unwrap(Context) <router-specific type> var MultipartMaxMemory int64
Optional, when the router supports native route groups:
func NewAdapterWithGroup(router, group) Adapter
type Components ¶
type Components struct {
Schemas Registry `yaml:"schemas,omitempty"`
Responses map[string]*Response `yaml:"responses,omitempty"`
Parameters map[string]*Param `yaml:"parameters,omitempty"`
Examples map[string]*Example `yaml:"examples,omitempty"`
RequestBodies map[string]*RequestBody `yaml:"requestBodies,omitempty"`
Headers map[string]*Header `yaml:"headers,omitempty"`
SecuritySchemes map[string]*SecurityScheme `yaml:"securitySchemes,omitempty"`
Links map[string]*Link `yaml:"links,omitempty"`
Callbacks map[string]map[string]*PathItem `yaml:"callbacks,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Components) MarshalJSON ¶
func (c *Components) MarshalJSON() ([]byte, error)
type Config ¶
type Config struct {
*OpenAPI
OpenAPIPath string
OpenAPIVersion string
Docs DocsConfig
SchemasPath string
SpecMiddlewares Middlewares
Formats map[string]Format
DefaultFormat string
NoFormatFallback bool
RejectUnknownQueryParameters bool
Transformers []Transformer
CreateHooks []func(Config) Config
ErrorHandler ErrorHandler
GenerateOperationID func(method, path string) string
GenerateSummary func(method, path string) string
SchemaNamer func(t reflect.Type, hint string) string
InternalSpec InternalSpecConfig
ExcludeHiddenSchemas bool
AllowAdditionalPropertiesByDefault bool
FieldsOptionalByDefault bool
ErrorDocs map[int]ErrorDoc
}
type Contact ¶
type Contact struct {
Name string `yaml:"name,omitempty"`
URL string `yaml:"url,omitempty"`
Email string `yaml:"email,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Contact) MarshalJSON ¶
type ContentTyper ¶
type Context ¶
type Context interface {
Operation() *Operation
Context() context.Context
TLS() *tls.ConnectionState
Version() ProtoVersion
Method() string
Host() string
RemoteAddr() string
URL() url.URL
Param(name string) string
Query(name string) string
Header(name string) string
EachHeader(cb func(name, value string))
BodyReader() io.Reader
GetMultipartForm() (*multipart.Form, error)
SetReadDeadline(time.Time) error
SetStatus(code int)
Status() int
SetHeader(name, value string)
AppendHeader(name, value string)
GetResponseHeader(name string) string
DeleteResponseHeader(name string)
BodyWriter() io.Writer
MatchedPattern() string
}
func UnwrapContext ¶
type DiscoveredError ¶
type Discriminator ¶
type Discriminator struct {
PropertyName string `yaml:"propertyName"`
Mapping map[string]string `yaml:"mapping,omitempty"`
}
func (*Discriminator) MarshalJSON ¶
func (d *Discriminator) MarshalJSON() ([]byte, error)
type DocsConfig ¶
type DocsConfig struct {
Path string
Provider DocsProvider
Middlewares Middlewares
Enabled bool
}
type DocsProvider ¶
type Encoding ¶
type Encoding struct {
ContentType string `yaml:"contentType,omitempty"`
Headers map[string]*Header `yaml:"headers,omitempty"`
Style string `yaml:"style,omitempty"`
Explode *bool `yaml:"explode,omitempty"`
AllowReserved bool `yaml:"allowReserved,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Encoding) MarshalJSON ¶
type ErrorDetail ¶
type ErrorDetail struct {
Message string `json:"message,omitempty" doc:"Error message text"`
Location string `json:"location,omitempty" doc:"Where the error occurred, e.g. 'body.items[3].tags'"`
Value any `json:"value,omitempty" doc:"The value at the given location"`
}
func (*ErrorDetail) Error ¶
func (e *ErrorDetail) Error() string
func (*ErrorDetail) ErrorDetail ¶
func (e *ErrorDetail) ErrorDetail() *ErrorDetail
type ErrorDetailer ¶
type ErrorDetailer interface {
ErrorDetail() *ErrorDetail
}
type ErrorDoc ¶
type ErrorDoc struct {
Title string
Description string
Entries []ErrorDocEntry
HTML string // if set, renders this directly instead of the default template
}
type ErrorDocEntry ¶
type ErrorHandler ¶
type ErrorResponseConfig ¶
type Example ¶
type Example struct {
Ref string `yaml:"$ref,omitempty"`
Summary string `yaml:"summary,omitempty"`
Description string `yaml:"description,omitempty"`
Value any `yaml:"value,omitempty"`
ExternalValue string `yaml:"externalValue,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Example) MarshalJSON ¶
type ExampleProvider ¶
type ExampleProvider interface {
Example() any
}
type ExternalDocs ¶
type ExternalDocs struct {
Description string `yaml:"description,omitempty"`
URL string `yaml:"url"`
Extensions map[string]any `yaml:",inline"`
}
func (*ExternalDocs) MarshalJSON ¶
func (e *ExternalDocs) MarshalJSON() ([]byte, error)
type Info ¶
type Info struct {
Title string `yaml:"title"`
Description string `yaml:"description,omitempty"`
TermsOfService string `yaml:"termsOfService,omitempty"`
Contact *Contact `yaml:"contact,omitempty"`
License *License `yaml:"license,omitempty"`
Version string `yaml:"version"`
Extensions map[string]any `yaml:",inline"`
}
func (*Info) MarshalJSON ¶
type InternalSpecConfig ¶
type InternalSpecConfig struct {
Path string
DocsPath string
Middlewares Middlewares
Enabled bool
}
type JSONFieldInfo ¶
type License ¶
type License struct {
Name string `yaml:"name"`
Identifier string `yaml:"identifier,omitempty"`
URL string `yaml:"url,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*License) MarshalJSON ¶
type Link ¶
type Link struct {
Ref string `yaml:"$ref,omitempty"`
OperationRef string `yaml:"operationRef,omitempty"`
OperationID string `yaml:"operationId,omitempty"`
Parameters map[string]any `yaml:"parameters,omitempty"`
RequestBody any `yaml:"requestBody,omitempty"`
Description string `yaml:"description,omitempty"`
Server *Server `yaml:"server,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Link) MarshalJSON ¶
type MediaType ¶
type MediaType struct {
Schema *Schema `yaml:"schema,omitempty"`
Example any `yaml:"example,omitempty"`
Examples map[string]*Example `yaml:"examples,omitempty"`
Encoding map[string]*Encoding `yaml:"encoding,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*MediaType) MarshalJSON ¶
type MiddlewareFunc ¶
type Middlewares ¶
type Middlewares []MiddlewareFunc
func (Middlewares) Handler ¶
func (m Middlewares) Handler(endpoint func(Context)) func(Context)
type OAuthFlow ¶
type OAuthFlow struct {
AuthorizationURL string `yaml:"authorizationUrl,omitempty"`
TokenURL string `yaml:"tokenUrl"`
RefreshURL string `yaml:"refreshUrl,omitempty"`
Scopes map[string]string `yaml:"scopes"`
Extensions map[string]any `yaml:",inline"`
}
func (*OAuthFlow) MarshalJSON ¶
type OAuthFlows ¶
type OAuthFlows struct {
Implicit *OAuthFlow `yaml:"implicit,omitempty"`
Password *OAuthFlow `yaml:"password,omitempty"`
ClientCredentials *OAuthFlow `yaml:"clientCredentials,omitempty"`
AuthorizationCode *OAuthFlow `yaml:"authorizationCode,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*OAuthFlows) MarshalJSON ¶
func (o *OAuthFlows) MarshalJSON() ([]byte, error)
type OpenAPI ¶
type OpenAPI struct {
OpenAPI string `yaml:"openapi"`
Info *Info `yaml:"info"`
Servers []*Server `yaml:"servers,omitempty"`
Paths map[string]*PathItem `yaml:"paths,omitempty"`
Components *Components `yaml:"components,omitempty"`
Security []map[string][]string `yaml:"security,omitempty"`
Tags []*Tag `yaml:"tags,omitempty"`
ExternalDocs *ExternalDocs `yaml:"externalDocs,omitempty"`
Extensions map[string]any `yaml:",inline"`
// OnAddOperation is called when a new operation is added to the spec.
// This is useful for transformers that need to modify the spec.
OnAddOperation []func(oapi *OpenAPI, op *Operation) `yaml:"-"`
}
func (*OpenAPI) AddOperation ¶
func (*OpenAPI) MarshalJSON ¶
type Operation ¶
type Operation struct {
Method string `yaml:"-"`
Path string `yaml:"-"`
DefaultStatus int `yaml:"-"`
MaxBodyBytes int64 `yaml:"-"`
BodyReadTimeout time.Duration `yaml:"-"`
Errors []int `yaml:"-"`
ErrorHeaders map[string]*Param `yaml:"-"`
ErrorResponses map[int]*ErrorResponseConfig `yaml:"-"`
SkipValidateParams bool `yaml:"-"`
SkipValidateBody bool `yaml:"-"`
SkipDiscoveredErrors bool `yaml:"-"`
ErrorExamples map[int]any `yaml:"-"`
RejectUnknownQueryParameters bool `yaml:"-"`
Hidden bool `yaml:"-"`
HiddenParameters []*Param `yaml:"-"`
Metadata map[string]any `yaml:"-"`
Middlewares Middlewares `yaml:"-"`
Tags []string `yaml:"tags,omitempty"`
Summary string `yaml:"summary,omitempty"`
Description string `yaml:"description,omitempty"`
ExternalDocs *ExternalDocs `yaml:"externalDocs,omitempty"`
OperationID string `yaml:"operationId,omitempty"`
Parameters []*Param `yaml:"parameters,omitempty"`
RequestBody *RequestBody `yaml:"requestBody,omitempty"`
Responses map[string]*Response `yaml:"responses,omitempty"`
Callbacks map[string]map[string]*PathItem `yaml:"callbacks,omitempty"`
Deprecated bool `yaml:"deprecated,omitempty"`
Security []map[string][]string `yaml:"security,omitempty"`
Servers []*Server `yaml:"servers,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Operation) MarshalJSON ¶
type Param ¶
type Param struct {
Ref string `yaml:"$ref,omitempty"`
Name string `yaml:"name,omitempty"`
In string `yaml:"in,omitempty"`
Description string `yaml:"description,omitempty"`
Required bool `yaml:"required,omitempty"`
Deprecated bool `yaml:"deprecated,omitempty"`
AllowEmptyValue bool `yaml:"allowEmptyValue,omitempty"`
Style string `yaml:"style,omitempty"`
Explode *bool `yaml:"explode,omitempty"`
AllowReserved bool `yaml:"allowReserved,omitempty"`
Schema *Schema `yaml:"schema,omitempty"`
Example any `yaml:"example,omitempty"`
Examples map[string]*Example `yaml:"examples,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Param) MarshalJSON ¶
type PathBuffer ¶
type PathBuffer struct {
// contains filtered or unexported fields
}
func NewPathBuffer ¶
func NewPathBuffer(buf []byte, offset int) *PathBuffer
func (*PathBuffer) Bytes ¶
func (b *PathBuffer) Bytes() []byte
func (*PathBuffer) Len ¶
func (b *PathBuffer) Len() int
func (*PathBuffer) Pop ¶
func (b *PathBuffer) Pop()
func (*PathBuffer) Push ¶
func (b *PathBuffer) Push(s string)
func (*PathBuffer) PushIndex ¶
func (b *PathBuffer) PushIndex(i int)
func (*PathBuffer) Reset ¶
func (b *PathBuffer) Reset()
func (*PathBuffer) String ¶
func (b *PathBuffer) String() string
func (*PathBuffer) With ¶
func (b *PathBuffer) With(s string) string
func (*PathBuffer) WithIndex ¶
func (b *PathBuffer) WithIndex(i int) string
type PathItem ¶
type PathItem struct {
Ref string `yaml:"$ref,omitempty"`
Summary string `yaml:"summary,omitempty"`
Description string `yaml:"description,omitempty"`
Get *Operation `yaml:"get,omitempty"`
Put *Operation `yaml:"put,omitempty"`
Post *Operation `yaml:"post,omitempty"`
Delete *Operation `yaml:"delete,omitempty"`
Options *Operation `yaml:"options,omitempty"`
Head *Operation `yaml:"head,omitempty"`
Patch *Operation `yaml:"patch,omitempty"`
Trace *Operation `yaml:"trace,omitempty"`
Servers []*Server `yaml:"servers,omitempty"`
Parameters []*Param `yaml:"parameters,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*PathItem) MarshalJSON ¶
type ProtoVersion ¶
type RequestBody ¶
type RequestBody struct {
Ref string `yaml:"$ref,omitempty"`
Description string `yaml:"description,omitempty"`
Content map[string]*MediaType `yaml:"content"`
Required bool `yaml:"required,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*RequestBody) MarshalJSON ¶
func (r *RequestBody) MarshalJSON() ([]byte, error)
type ResolverWithPath ¶
type ResolverWithPath interface {
Resolve(ctx Context, prefix *PathBuffer) []error
}
type Response ¶
type Response struct {
Ref string `yaml:"$ref,omitempty"`
Description string `yaml:"description,omitempty"`
Headers map[string]*Param `yaml:"headers,omitempty"`
Content map[string]*MediaType `yaml:"content,omitempty"`
Links map[string]*Link `yaml:"links,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Response) MarshalJSON ¶
type Schema ¶
type Schema struct {
Type string `yaml:"type,omitempty"`
Nullable bool `yaml:"-"`
Title string `yaml:"title,omitempty"`
Description string `yaml:"description,omitempty"`
Ref string `yaml:"$ref,omitempty"`
Format string `yaml:"format,omitempty"`
ContentEncoding string `yaml:"contentEncoding,omitempty"`
Default any `yaml:"default,omitempty"`
Examples []any `yaml:"examples,omitempty"`
Items *Schema `yaml:"items,omitempty"`
AdditionalProperties any `yaml:"additionalProperties,omitempty"`
Properties map[string]*Schema `yaml:"properties,omitempty"`
Enum []any `yaml:"enum,omitempty"`
Minimum *float64 `yaml:"minimum,omitempty"`
ExclusiveMinimum *float64 `yaml:"exclusiveMinimum,omitempty"`
Maximum *float64 `yaml:"maximum,omitempty"`
ExclusiveMaximum *float64 `yaml:"exclusiveMaximum,omitempty"`
MultipleOf *float64 `yaml:"multipleOf,omitempty"`
MinLength *int `yaml:"minLength,omitempty"`
MaxLength *int `yaml:"maxLength,omitempty"`
Pattern string `yaml:"pattern,omitempty"`
PatternDescription string `yaml:"patternDescription,omitempty"`
MinItems *int `yaml:"minItems,omitempty"`
MaxItems *int `yaml:"maxItems,omitempty"`
UniqueItems bool `yaml:"uniqueItems,omitempty"`
Required []string `yaml:"required,omitempty"`
MinProperties *int `yaml:"minProperties,omitempty"`
MaxProperties *int `yaml:"maxProperties,omitempty"`
ReadOnly bool `yaml:"readOnly,omitempty"`
WriteOnly bool `yaml:"writeOnly,omitempty"`
Deprecated bool `yaml:"deprecated,omitempty"`
Extensions map[string]any `yaml:",inline"`
DependentRequired map[string][]string `yaml:"dependentRequired,omitempty"`
OneOf []*Schema `yaml:"oneOf,omitempty"`
AnyOf []*Schema `yaml:"anyOf,omitempty"`
AllOf []*Schema `yaml:"allOf,omitempty"`
Not *Schema `yaml:"not,omitempty"`
Discriminator *Discriminator `yaml:"discriminator,omitempty"`
PatternRe *regexp.Regexp `yaml:"-"`
RequiredMap map[string]bool `yaml:"-"`
PropertyNames []string `yaml:"-"`
Hidden bool `yaml:"-"`
MsgEnum string `yaml:"-"`
MsgMinimum string `yaml:"-"`
MsgExclusiveMinimum string `yaml:"-"`
MsgMaximum string `yaml:"-"`
MsgExclusiveMaximum string `yaml:"-"`
MsgMultipleOf string `yaml:"-"`
MsgMinLength string `yaml:"-"`
MsgMaxLength string `yaml:"-"`
MsgPattern string `yaml:"-"`
MsgMinItems string `yaml:"-"`
MsgMaxItems string `yaml:"-"`
MsgMinProperties string `yaml:"-"`
MsgMaxProperties string `yaml:"-"`
MsgRequired map[string]string `yaml:"-"`
MsgDependentRequired map[string]map[string]string `yaml:"-"`
}
func (*Schema) MarshalJSON ¶
func (*Schema) PrecomputeMessages ¶
func (s *Schema) PrecomputeMessages()
type SchemaProvider ¶
type SchemaTransformer ¶
type SecurityScheme ¶
type SecurityScheme struct {
Type string `yaml:"type"`
Description string `yaml:"description,omitempty"`
Name string `yaml:"name,omitempty"`
In string `yaml:"in,omitempty"`
Scheme string `yaml:"scheme,omitempty"`
BearerFormat string `yaml:"bearerFormat,omitempty"`
Flows *OAuthFlows `yaml:"flows,omitempty"`
OpenIDConnectURL string `yaml:"openIdConnectUrl,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*SecurityScheme) MarshalJSON ¶
func (s *SecurityScheme) MarshalJSON() ([]byte, error)
type Server ¶
type Server struct {
URL string `yaml:"url"`
Description string `yaml:"description,omitempty"`
Variables map[string]*ServerVariable `yaml:"variables,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Server) MarshalJSON ¶
type ServerVariable ¶
type ServerVariable struct {
Enum []string `yaml:"enum,omitempty"`
Default string `yaml:"default"`
Description string `yaml:"description,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*ServerVariable) MarshalJSON ¶
func (v *ServerVariable) MarshalJSON() ([]byte, error)
type StreamResponse ¶
type Tag ¶
type Tag struct {
Name string `yaml:"name"`
Description string `yaml:"description,omitempty"`
Tags []*Tag `yaml:"tags,omitempty"`
ExternalDocs *ExternalDocs `yaml:"externalDocs,omitempty"`
Extensions map[string]any `yaml:",inline"`
}
func (*Tag) MarshalJSON ¶
type ValidateMode ¶
type ValidateMode int
const ( ModeReadFromServer ValidateMode = iota ModeWriteToServer )
type ValidateResult ¶
type ValidateResult struct {
Errors []error
}
func (*ValidateResult) Add ¶
func (r *ValidateResult) Add(path *PathBuffer, v any, msg string)
func (*ValidateResult) Addf ¶
func (r *ValidateResult) Addf(path *PathBuffer, v any, format string, args ...any)
func (*ValidateResult) HasErrors ¶
func (r *ValidateResult) HasErrors() bool
func (*ValidateResult) Reset ¶
func (r *ValidateResult) Reset()
Click to show internal directories.
Click to hide internal directories.