Documentation
¶
Index ¶
- type Components
- type Contact
- type ContentType
- type Info
- type License
- type MediaType
- type OAuthFlow
- type OAuthFlows
- type Openapi
- type Operation
- type Parameter
- type PathItem
- type RequestBody
- type ResponseBody
- type ResponseCode
- type Schema
- type SecurityScheme
- type SecuritySchemeType
- type SecuritySchemes
- type Server
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Components ¶
type Components struct { SecuritySchemes SecuritySchemes `json:"securitySchemes,omitempty"` Schemas map[string]*Schema `json:"schemas,omitempty"` }
type ContentType ¶
type ContentType string
const ( ContentTypeJson ContentType = "application/json" ContentTypeXml ContentType = "application/xml" ContentTypeForm ContentType = "application/x-www-form-urlencoded" )
func (ContentType) GetStructTag ¶
func (c ContentType) GetStructTag() string
type Info ¶
type Info struct { Title string `json:"title,omitempty"` Summary string `json:"summary,omitempty"` Description string `json:"description,omitempty"` TermsOfService string `json:"termsOfService,omitempty"` Contact *Contact `json:"contact,omitempty"` License *License `json:"license,omitempty"` Version string `json:"version,omitempty"` }
type OAuthFlows ¶
type Openapi ¶
type Openapi struct { Openapi string `json:"openapi,omitempty"` Info *Info `json:"info,omitempty"` Servers []*Server `json:"servers,omitempty"` Components *Components `json:"components,omitempty"` Paths map[string]PathItem `json:"paths,omitempty"` Tags []*Tag `json:"tags,omitempty"` }
func (*Openapi) GetRefSchema ¶
type Operation ¶
type Operation struct { Tags []string `json:"tags,omitempty"` Summary string `json:"summary,omitempty"` Description string `json:"description,omitempty"` RequestBody *RequestBody `json:"requestBody,omitempty"` Parameters []*Parameter `json:"parameters,omitempty"` Responses map[ResponseCode]*ResponseBody `json:"responses,omitempty"` Deprecated bool `json:"deprecated,omitempty"` Security []map[string][]string `json:"security,omitempty"` }
type Parameter ¶
type Parameter struct { Name string `json:"name,omitempty"` In string `json:"in,omitempty"` // query, path, header, cookie Schema *Schema `json:"schema,omitempty"` Description string `json:"description,omitempty"` Required bool `json:"required,omitempty"` Deprecated bool `json:"deprecated,omitempty"` AllowEmptyValue bool `json:"allowEmptyValue,omitempty"` }
type RequestBody ¶
type RequestBody struct { Description string `json:"description,omitempty"` Content map[ContentType]*MediaType `json:"content,omitempty"` Required bool `json:"required,omitempty"` }
type ResponseBody ¶
type ResponseBody struct { Description string `json:"description,omitempty"` Content map[ContentType]*MediaType `json:"content,omitempty"` }
type ResponseCode ¶
type ResponseCode string
type Schema ¶
type Schema struct { Ref string `json:"$ref,omitempty"` Description string `json:"description,omitempty"` Type string `json:"type,omitempty"` Enum []string `json:"enum,omitempty"` Format string `json:"format,omitempty"` Required []string `json:"required,omitempty"` Properties map[string]*Schema `json:"properties,omitempty"` Items *Schema `json:"items,omitempty"` }
func (*Schema) RequiredFields ¶
type SecurityScheme ¶
type SecurityScheme struct { Type SecuritySchemeType `json:"type,omitempty"` Description string `json:"description,omitempty"` Name string `json:"name,omitempty"` In string `json:"in,omitempty"` // header, query, cookie Scheme string `json:"scheme,omitempty"` BearerFormat string `json:"bearerFormat,omitempty"` OpenIdConnectUrl string `json:"openIdConnectUrl,omitempty"` Flows *OAuthFlows `json:"flows,omitempty"` }
type SecuritySchemeType ¶
type SecuritySchemeType string
const ( SecuritySchemeTypeApiKey SecuritySchemeType = "apiKey" SecuritySchemeTypeHttp SecuritySchemeType = "http" SecuritySchemeTypeOauth SecuritySchemeType = "oauth2" SecuritySchemeTypeOpenId SecuritySchemeType = "openIdConnect" SecuritySchemeTypeMutualTLS SecuritySchemeType = "mutualTLS" )
type SecuritySchemes ¶
type SecuritySchemes map[string]*SecurityScheme
Click to show internal directories.
Click to hide internal directories.