Documentation ¶
Overview ¶
Package oas represents OpenAPI v3 Specification in Go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Discriminator ¶
Discriminator discriminates types for OneOf, AllOf, AnyOf.
type Format ¶
type Format string
Format of Schema.
const ( FormatNone Format = "" FormatUUID Format = "uuid" FormatDate Format = "date" FormatTime Format = "time" FormatDateTime Format = "date-time" FormatDuration Format = "duration" FormatURI Format = "uri" FormatIPv4 Format = "ipv4" FormatIPv6 Format = "ipv6" FormatByte Format = "byte" FormatBinary Format = "binary" FormatPassword Format = "password" FormatInt64 Format = "int64" FormatInt32 Format = "int32" FormatFloat Format = "float" FormatDouble Format = "double" FormatEmail Format = "email" FormatHostname Format = "hostname" FormatIP Format = "ip" // custom, non-standard )
Possible formats.
type Operation ¶
type Operation struct { OperationID string // optional HTTPMethod string Path Path Parameters []*Parameter RequestBody *RequestBody // optional // Operation responses. // Map is always non-nil. // // Key can be: // * HTTP Status code // * default // * 1XX, 2XX, 3XX, 4XX, 5XX Responses map[string]*Response }
Operation is an OpenAPI Operation.
type Parameter ¶
type Parameter struct { Name string Schema *Schema In ParameterLocation Style string Explode bool Required bool }
Parameter is an OpenAPI Operation Parameter.
type ParameterLocation ¶
type ParameterLocation string
ParameterLocation defines where OpenAPI parameter is located.
const ( LocationQuery ParameterLocation = "query" LocationHeader ParameterLocation = "header" LocationPath ParameterLocation = "path" LocationCookie ParameterLocation = "cookie" )
func (ParameterLocation) Cookie ¶
func (l ParameterLocation) Cookie() bool
func (ParameterLocation) Header ¶
func (l ParameterLocation) Header() bool
func (ParameterLocation) Path ¶
func (l ParameterLocation) Path() bool
func (ParameterLocation) Query ¶
func (l ParameterLocation) Query() bool
type Property ¶
type Property struct { Name string // Property name. Schema *Schema // Property schema. Required bool // Whether the field is required or not. }
Property is an OpenAPI JSON Schema Object property.
type RequestBody ¶
RequestBody of an OpenAPI Operation.
type Schema ¶
type Schema struct { Type SchemaType Format Format // Schema format, optional. Description string // Schema description, optional. Ref string // Whether schema is referenced. Item *Schema // Only for Array. Enum []interface{} // Only for Enum. Properties []Property // Only for Object. Nullable bool // Whether schema is nullable or not. Any types. OneOf []*Schema AnyOf []*Schema AllOf []*Schema Discriminator *Discriminator // Numeric validation (Integer, Number). Maximum *int64 ExclusiveMaximum bool Minimum *int64 ExclusiveMinimum bool MultipleOf *int // String validation. MaxLength *uint64 MinLength *int64 Pattern string // Array validation. MaxItems *uint64 MinItems *uint64 UniqueItems bool // Struct validation. MaxProperties *uint64 MinProperties *uint64 }
Schema is an OpenAPI JSON Schema.
type SchemaType ¶
type SchemaType string
SchemaType is an OpenAPI JSON Schema type.
const ( Empty SchemaType = "" // OneOf, AnyOf, AllOf. Object SchemaType = "object" Array SchemaType = "array" Integer SchemaType = "integer" Number SchemaType = "number" String SchemaType = "string" Boolean SchemaType = "boolean" )
Click to show internal directories.
Click to hide internal directories.