Documentation
¶
Index ¶
- Constants
- func CloneStrs(src []string) []string
- type Example
- type ExampleSource
- type HTTPMethod
- type MediaType
- type OAuthFlow
- type OAuthFlowType
- type Operation
- type Parameter
- type ParameterLocation
- type RequestBody
- type Response
- type Schema
- type SchemaRef
- type SchemaType
- type SchemaTypeInfo
- type SecurityRequirement
- type SecurityScheme
- type SecuritySchemeType
- type Server
- type Spec
Constants ¶
View Source
const ( StyleForm = "form" StyleSimple = "simple" StyleDeepObject = "deepObject" StyleSpaceDelimited = "spaceDelimited" StylePipeDelimited = "pipeDelimited" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExampleSource ¶
type ExampleSource string
const ( ExampleFromExplicit ExampleSource = "explicit" ExampleFromDefault ExampleSource = "default" ExampleFromEnum ExampleSource = "enum" ExampleFromSchema ExampleSource = "schema" )
type HTTPMethod ¶
type HTTPMethod string
const ( MethodGet HTTPMethod = "GET" MethodPost HTTPMethod = "POST" MethodPut HTTPMethod = "PUT" MethodPatch HTTPMethod = "PATCH" MethodDelete HTTPMethod = "DELETE" MethodHead HTTPMethod = "HEAD" MethodOptions HTTPMethod = "OPTIONS" MethodTrace HTTPMethod = "TRACE" MethodQuery HTTPMethod = "QUERY" )
type OAuthFlow ¶
type OAuthFlow struct {
Type OAuthFlowType
AuthorizationURL string
TokenURL string
RefreshURL string
Scopes []string
}
type OAuthFlowType ¶
type OAuthFlowType string
const ( OAuthFlowAuthorizationCode OAuthFlowType = "authorizationCode" OAuthFlowImplicit OAuthFlowType = "implicit" OAuthFlowPassword OAuthFlowType = "password" OAuthFlowClientCredentials OAuthFlowType = "clientCredentials" )
type Operation ¶
type Operation struct {
ID string
Method HTTPMethod
Path string
Summary string
Description string
Tags []string
Deprecated bool
Servers []Server
Parameters []Parameter
RequestBody *RequestBody
Responses []Response
Security []SecurityRequirement
}
type ParameterLocation ¶
type ParameterLocation string
const ( InPath ParameterLocation = "path" InQuery ParameterLocation = "query" InHeader ParameterLocation = "header" InCookie ParameterLocation = "cookie" )
type RequestBody ¶
type Schema ¶ added in v0.23.5
type Schema struct {
Title string
Description string
Types []SchemaType
Format string
Pattern string
Example any
Default any
Enum []any
Min *float64
Max *float64
MinLen *int64
MaxLen *int64
Required []string
Nullable *bool
ReadOnly *bool
WriteOnly *bool
Items *SchemaRef
Properties map[string]*SchemaRef
AdditionalProperties *SchemaRef
OneOf []*SchemaRef
AnyOf []*SchemaRef
AllOf []*SchemaRef
}
type SchemaType ¶ added in v0.23.6
type SchemaType string
const ( TypeString SchemaType = "string" TypeInteger SchemaType = "integer" TypeNumber SchemaType = "number" TypeBoolean SchemaType = "boolean" TypeArray SchemaType = "array" TypeObject SchemaType = "object" TypeNull SchemaType = "null" )
func SchemaTypesFromStrings ¶ added in v0.23.6
func SchemaTypesFromStrings(src []string) []SchemaType
type SchemaTypeInfo ¶ added in v0.23.6
type SchemaTypeInfo struct {
PrimaryType SchemaType
Nullable bool
Explicit bool
}
SchemaTypeInfo captures normalized schema type inference details. PrimaryType is the non-null concrete type when available, TypeNull for null-only schemas, or the caller-provided default when no type could be inferred.
func InferSchemaType ¶ added in v0.23.6
func InferSchemaType(sch *Schema, d SchemaType) SchemaTypeInfo
type SecurityRequirement ¶
type SecurityScheme ¶
type SecurityScheme struct {
Type SecuritySchemeType
Subtype string
Name string
In ParameterLocation
Description string
BearerFormat string
OAuthFlows []OAuthFlow
}
type SecuritySchemeType ¶
type SecuritySchemeType string
const ( SecurityHTTP SecuritySchemeType = "http" SecurityAPIKey SecuritySchemeType = "apiKey" SecurityOAuth2 SecuritySchemeType = "oauth2" SecurityOpenID SecuritySchemeType = "openIdConnect" )
Click to show internal directories.
Click to hide internal directories.