Documentation
¶
Overview ¶
Package oas provides a representation of the OpenAPI Specification (OAS) Version 3.1.0
Index ¶
- Variables
- type Callback
- type Components
- type ContactDetails
- type ContentType
- type Discriminator
- type Document
- type Email
- type Encoding
- type Example
- type Expression
- type ExternalDocumentation
- type Format
- type Header
- type Information
- type LicenseID
- type Licensing
- type Link
- type Markdown
- type MediaType
- type Name
- type OauthFlow
- type OauthFlows
- type Operation
- type OperationID
- type Parameter
- type ParameterLocation
- type ParameterStyle
- type PathItem
- type Property
- type PropertyName
- type Readable
- type Reference
- type Registry
- type RequestBody
- type Response
- type ResponseKey
- type Schema
- type SecurityScheme
- type SecuritySchemeID
- type SecuritySchemeType
- type Server
- type ServerVariable
- type Tag
- type Type
- type TypeSet
- type URI
- type URL
- type Version
- type XML
Constants ¶
This section is empty.
Variables ¶
View Source
var Formats = xyz.AccessorFor(Format.Values)
View Source
var ParameterLocations = xyz.AccessorFor(ParameterLocation.Values)
View Source
var ParameterStyles = xyz.AccessorFor(ParameterStyle.Values)
View Source
var ResponseKeys = xyz.AccessorFor(ResponseKey.Values)
View Source
var SecuritySchemeTypes = xyz.AccessorFor(SecuritySchemeType.Values)
View Source
var Types = xyz.AccessorFor(Type.Values)
Functions ¶
This section is empty.
Types ¶
type Components ¶
type Components struct { Schemas map[string]*Schema `json:"schemas,omitempty"` Responses map[string]*Response `json:"responses,omitempty"` Parameters map[string]*Parameter `json:"parameters,omitempty"` Examples map[string]*Example `json:"examples,omitempty"` RequestBodies map[string]*RequestBody `json:"requestBodies,omitempty"` Headers map[string]*Header `json:"headers,omitempty"` SecuritySchemes map[SecuritySchemeID]*SecurityScheme `json:"securitySchemes,omitempty"` Links map[string]*Link `json:"links,omitempty"` Callbacks map[string]*Callback `json:"callbacks,omitempty"` PathItems map[string]*PathItem `json:"pathItems,omitempty"` }
type ContactDetails ¶
type ContactDetails struct { Name Name `json:"name,omitempty"` URL URL `json:"url,omitempty"` Email Email `json:"email,omitempty"` }
ContactDetails for an API.
type ContentType ¶
type ContentType string
type Discriminator ¶
type Document ¶
type Document struct { OpenAPI Version `json:"openapi"` Information Information `json:"info"` SchemaDialect URI `json:"jsonSchemaDialect,omitempty"` Servers []Server `json:"servers,omitempty"` Paths map[string]PathItem `json:"paths,omitempty"` Webhooks map[string]*PathItem `json:"webhooks,omitempty"` Components *Components `json:"components,omitempty"` Security []map[string]SecuritySchemeID `json:"security,omitempty"` Tags []Tag `json:"tags,omitempty"` ExternalDocumentation *ExternalDocumentation `json:"externalDocs,omitempty"` }
type Encoding ¶
type Encoding struct { ContentType ContentType `json:"contentType,omitempty"` Headers map[string]*Header `json:"headers,omitempty"` Style ParameterStyle `json:"style,omitempty"` Explode bool `json:"explode,omitempty"` AllowReserved bool `json:"allowReserved,omitempty"` }
type Example ¶
type Example struct { Summary Readable `json:"summary,omitempty"` Description Readable `json:"description,omitempty"` Value json.RawMessage `json:"value,omitempty"` ExternalValue URI `json:"externalValue,omitempty"` }
type Expression ¶
type Expression string
type ExternalDocumentation ¶
type Format ¶
type Format xyz.Switch[string, struct { DateTime Format `json:"date-time"` Time Format `json:"time"` Date Format `json:"date"` Duration Format `json:"duration"` Email Format `json:"email"` Hostname Format `json:"hostname"` IPv4 Format `json:"ipv4"` IPv6 Format `json:"ipv6"` UUID Format `json:"uuid"` URI Format `json:"uri"` Regex Format `json:"regex"` Int32 Format `json:"int32"` Int64 Format `json:"int64"` Float Format `json:"float"` Double Format `json:"double"` Password Format `json:"password"` }]
type Header ¶
type Header struct { Description Readable `json:"description,omitempty"` Required bool `json:"required,omitempty"` Deprecated bool `json:"deprecated,omitempty"` AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` Style ParameterStyle `json:"style,omitempty"` Explode bool `json:"explode,omitempty"` AllowReserved bool `json:"allowReserved,omitempty"` Schema *Schema `json:"schema,omitempty"` Example json.RawMessage `json:"example,omitempty"` Examples map[string]*Example `json:"examples,omitempty"` Content map[string]MediaType `json:"content,omitempty"` }
type Information ¶
type Information struct { Title Readable `json:"title"` Summary Readable `json:"summary,omitempty"` Version Version `json:"version"` License *Licensing `json:"license,omitempty"` TermsConditions URL `json:"termsOfService,omitempty"` Description Markdown `json:"description,omitempty"` Contact *ContactDetails `json:"contact,omitempty"` }
Information about an API.
type Licensing ¶
type Licensing struct { ID LicenseID `json:"identifier,omitempty"` Name Readable `json:"name"` URL URL `json:"url,omitempty"` }
Licensing information for the implementation of the API.
type Link ¶
type Link struct { OperationRef *Operation `json:"operationRef,omitempty"` OperationID OperationID `json:"operationId,omitempty"` Parameters map[string]any `json:"parameters,omitempty"` RequestBody any `json:"requestBody,omitempty"` Description Readable `json:"description,omitempty"` Server *Server `json:"server,omitempty"` }
type OauthFlows ¶
type Operation ¶
type Operation struct { ID OperationID `json:"operationId,omitempty"` Tags []string `json:"tags,omitempty"` Summary Readable `json:"summary,omitempty"` Description Readable `json:"description,omitempty"` SeeAlso *ExternalDocumentation `json:"externalDocs,omitempty"` Parameters []*Parameter `json:"parameters,omitempty"` RequestBody *RequestBody `json:"requestBody,omitempty"` Responses map[ResponseKey]*Response `json:"responses,omitempty"` Callbacks map[string]*Callback `json:"callbacks,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Security []map[string]SecuritySchemeID `json:"security,omitempty"` Servers []Server `json:"servers,omitempty"` }
type OperationID ¶
type OperationID string
type Parameter ¶
type Parameter struct { Name Readable `json:"name"` In ParameterLocation `json:"in"` Description Readable `json:"description,omitempty"` Required bool `json:"required,omitempty"` Deprecated bool `json:"deprecated,omitempty"` AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` Style ParameterStyle `json:"style,omitempty"` Explode bool `json:"explode,omitempty"` AllowReserved bool `json:"allowReserved,omitempty"` Schema *Schema `json:"schema,omitempty"` Example json.RawMessage `json:"example,omitempty"` Examples map[string]*Example `json:"examples,omitempty"` Content map[string]MediaType `json:"content,omitempty"` }
type ParameterLocation ¶
type ParameterLocation xyz.Switch[string, struct { Query ParameterLocation `json:"query"` Header ParameterLocation `json:"header"` Path ParameterLocation `json:"path"` Cookie ParameterLocation `json:"cookie"` }]
type ParameterStyle ¶
type ParameterStyle xyz.Switch[string, struct { Matrix ParameterStyle `json:"matrix"` Label ParameterStyle `json:"label"` Form ParameterStyle `json:"form"` Simple ParameterStyle `json:"simple"` SpaceDelimited ParameterStyle `json:"spaceDelimited"` PipeDelimited ParameterStyle `json:"pipeDelimited"` DeepObject ParameterStyle `json:"deepObject"` }]
type PathItem ¶
type PathItem struct { Extends *PathItem `json:"$ref,omitempty"` Summary Readable `json:"summary,omitempty"` Desciption Readable `json:"description,omitempty"` Get *Operation `json:"get,omitempty"` Put *Operation `json:"put,omitempty"` Post *Operation `json:"post,omitempty"` Delete *Operation `json:"delete,omitempty"` Options *Operation `json:"options,omitempty"` Head *Operation `json:"head,omitempty"` Patch *Operation `json:"patch,omitempty"` Trace *Operation `json:"trace,omitempty"` Servers []Server `json:"servers,omitempty"` Parameters []*Parameter `json:"parameters,omitempty"` }
type PropertyName ¶
type PropertyName string
type RequestBody ¶
type RequestBody struct { Description Readable `json:"description,omitempty"` Content map[ContentType]MediaType `json:"content"` Required bool `json:"required,omitempty"` }
type ResponseKey ¶
type ResponseKey xyz.Switch[string, struct { Default ResponseKey `json:"default"` }]
type Schema ¶
type Schema struct { ID URI `json:"$id,omitempty"` Ref URI `json:"$ref,omitempty"` Defs map[string]*Schema `json:"$defs,omitempty"` Dialect URI `json:"$schema,omitempty"` Anchor string `json:"$anchor,omitempty"` AllOf []*Schema `json:"allOf,omitempty"` AnyOf []*Schema `json:"anyOf,omitempty"` OneOf []*Schema `json:"oneOf,omitempty"` Not *Schema `json:"not,omitempty"` Type TypeSet `json:"type,omitempty"` Title Readable `json:"title,omitempty"` Description Readable `json:"description,omitempty"` Properties map[PropertyName]*Schema `json:"properties,omitempty"` Required []PropertyName `json:"required,omitempty"` DependentRequired map[PropertyName][]PropertyName `json:"dependentRequired,omitempty"` DependentSchemas map[PropertyName]*Schema `json:"dependentSchemas,omitempty"` If *Schema `json:"if,omitempty"` Then *Schema `json:"then,omitempty"` Else *Schema `json:"else,omitempty"` MinLength int `json:"minLength,omitempty"` MaxLength int `json:"maxLength,omitempty"` MultipleOf float64 `json:"multipleOf,omitempty"` Default json.RawMessage `json:"default,omitempty"` Minimum *float64 `json:"minimum,omitempty"` Maximum *float64 `json:"maximum,omitempty"` ExclusiveMinimum float64 `json:"exclusiveMinimum,omitempty"` ExclusiveMaximum float64 `json:"exclusiveMaximum,omitempty"` Const json.RawMessage `json:"const,omitempty"` Enum []json.RawMessage `json:"enum,omitempty"` PrefixItems []*Schema `json:"prefixItems,omitempty"` Contains *Schema `json:"contains,omitempty"` MinContains int `json:"minContains,omitempty"` MaxContains int `json:"maxContains,omitempty"` MinItems int `json:"minItems,omitempty"` MaxItems int `json:"maxItems,omitempty"` UniqueItems bool `json:"uniqueItems,omitempty"` Pattern string `json:"pattern,omitempty"` PatternProperties map[string]*Schema `json:"patternProperties,omitempty"` PropertyNames *Schema `json:"propertyNames,omitempty"` MinProperties int `json:"minProperties,omitempty"` MaxProperties int `json:"maxProperties,omitempty"` Items *Schema `json:"items,omitempty"` Format *Format `json:"format,omitempty"` AdditionalProperties *Schema `json:"additionalProperties,omitempty"` ReadOnly bool `json:"readOnly,omitempty"` WriteOnly bool `json:"writeOnly,omitempty"` Deprecated bool `json:"deprecated,omitempty"` ContentMediaType ContentType `json:"contentMediaType,omitempty"` ContentEncoding string `json:"contentEncoding,omitempty"` Discriminator *Discriminator `json:"discriminator,omitempty"` XML *XML `json:"xml,omitempty"` ExternalDocumentation *ExternalDocumentation `json:"externalDocs,omitempty"` Example json.RawMessage `json:"example,omitempty"` Examples []json.RawMessage `json:"examples,omitempty"` }
Schema based on https://json-schema.org/draft/2020-12/json-schema-core
type SecurityScheme ¶
type SecurityScheme struct { Type SecuritySchemeType `json:"type"` Description Markdown `json:"description,omitempty"` Name string `json:"name,omitempty"` In ParameterLocation `json:"in,omitempty"` Scheme string `json:"scheme,omitempty"` BearerFormat string `json:"bearerFormat,omitempty"` Flows *OauthFlows `json:"flows,omitempty"` ConnectURL URL `json:"openIdConnectUrl,omitempty"` }
type SecuritySchemeID ¶
type SecuritySchemeID string
type SecuritySchemeType ¶
type SecuritySchemeType xyz.Switch[string, struct { Key SecuritySchemeType `json:"apiKey"` HTTP SecuritySchemeType `json:"http"` MutualTLS SecuritySchemeType `json:"mutualTLS"` OAuth2 SecuritySchemeType `json:"oauth2"` OpenID SecuritySchemeType `json:"openIdConnect"` }]
type Server ¶
type Server struct { URL URL `json:"url"` Description Readable `json:"description,omitempty"` Variables map[string]ServerVariable `json:"variables,omitempty"` }
type ServerVariable ¶
type Tag ¶
type Tag struct { Name Readable `json:"name"` Description Markdown `json:"description,omitempty"` ExternalDocumentation ExternalDocumentation `json:"externalDocs,omitempty"` }
Click to show internal directories.
Click to hide internal directories.