Documentation
¶
Index ¶
- Constants
- type Array
- type Boolean
- type Contact
- type Custom
- type Document
- type Info
- type Integer
- type License
- type Number
- type Object
- type ObjectProperty
- type Operation
- type Parameter
- type ParameterIn
- type Paths
- type Ref
- type Schema
- type SecurityRequirement
- type SecurityScheme
- type SecuritySchemeFlow
- type SecuritySchemeFlows
- type Server
- type String
- type Tag
Constants ¶
View Source
const Version = "3.0.0"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Title string `tag:"title"`
Description string `tag:"description"`
Min int `tag:"min"`
Max int `tag:"max"`
Items Schema
Default []string `tag:"default"`
Nullable bool `tag:"flags:nullable"`
ReadOnly bool `tag:"flags:readonly"`
WriteOnly bool `tag:"flags:writeonly"`
UniqueItems bool `tag:"flags:unique"`
}
type Boolean ¶
type Contact ¶
func (*Contact) JsonEncode ¶
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
func NewDocument ¶
Create a new OpenAPI root document that is ready to be used in the API service.
func (*Document) AddSecurityScheme ¶ added in v0.7.0
func (doc *Document) AddSecurityScheme(scheme SecurityScheme) (err error)
func (*Document) NumOperations ¶
type Info ¶
type Info struct {
Title string
Description string
TermsOfService string
Contact Contact
License License
Version string
}
func (*Info) JsonEncode ¶
type Integer ¶
type License ¶
func (*License) JsonEncode ¶
type Number ¶
type Object ¶
type ObjectProperty ¶
type Operation ¶
type Operation struct {
Id string
Method string
Summary string
Description string
Security []SecurityRequirement
Parameters []Parameter
RequestBody Schema
Response Schema
Tags []Tag
Deprecated bool
}
func (*Operation) JsonEncode ¶
type Parameter ¶
type Parameter struct {
Name string
In ParameterIn
Description string
Schema Schema
Required bool
}
func (*Parameter) JsonEncode ¶
type ParameterIn ¶
type ParameterIn string
const ( InQuery ParameterIn = "query" InHeader ParameterIn = "header" InPath ParameterIn = "path" InCookie ParameterIn = "cookie" )
func (ParameterIn) JsonEncode ¶
func (p ParameterIn) JsonEncode(_ *encoderContext, s *jsoniter.Stream)
func (ParameterIn) String ¶
func (p ParameterIn) String() string
type Paths ¶
func (Paths) JsonEncode ¶
type SecurityRequirement ¶ added in v0.7.0
func (SecurityRequirement) IsZero ¶ added in v0.7.0
func (sec SecurityRequirement) IsZero() bool
func (SecurityRequirement) JsonEncode ¶ added in v0.7.0
func (ss SecurityRequirement) JsonEncode(s *jsoniter.Stream)
type SecurityScheme ¶ added in v0.7.0
type SecurityScheme struct {
SchemeName string
Type string
Description string
Name string
In string
Scheme string
BearerFormat string
Flows SecuritySchemeFlows
OpenIdConnectUrl string
}
func (*SecurityScheme) IsZero ¶ added in v0.7.0
func (sec *SecurityScheme) IsZero() bool
func (*SecurityScheme) JsonEncode ¶ added in v0.7.0
func (sec *SecurityScheme) JsonEncode(s *jsoniter.Stream)
type SecuritySchemeFlow ¶ added in v0.13.0
type SecuritySchemeFlow struct {
AuthorizationUrl string
TokenUrl string
RefreshUrl string
// contains filtered or unexported fields
}
func (*SecuritySchemeFlow) IsZero ¶ added in v0.13.0
func (flow *SecuritySchemeFlow) IsZero() bool
func (*SecuritySchemeFlow) JsonEncode ¶ added in v0.13.0
func (flow *SecuritySchemeFlow) JsonEncode(s *jsoniter.Stream)
type SecuritySchemeFlows ¶ added in v0.13.0
type SecuritySchemeFlows struct {
Implicit struct{} // Deprecated
Password struct{} // TODO
ClientCredentials struct{} // TODO
AuthorizationCode SecuritySchemeFlow
}
func (*SecuritySchemeFlows) IsZero ¶ added in v0.13.0
func (flows *SecuritySchemeFlows) IsZero() bool
func (*SecuritySchemeFlows) JsonEncode ¶ added in v0.13.0
func (flows *SecuritySchemeFlows) JsonEncode(s *jsoniter.Stream)
type Server ¶
func (*Server) JsonEncode ¶
type String ¶
type String struct {
Title string `tag:"title"`
Description string `tag:"description"`
Enum []string `tag:"enum"`
Format string `tag:"format"`
Pattern string `tag:"pattern"`
Min int `tag:"min"`
Max int `tag:"max"`
Default string `tag:"default"`
Nullable bool `tag:"flags:nullable"`
ReadOnly bool `tag:"flags:readonly"`
WriteOnly bool `tag:"flags:writeonly"`
}
Source Files
¶
- contact.go
- document.go
- encoder_context.go
- info.go
- license.go
- operation.go
- parameter.go
- parameter_in.go
- paths.go
- schema.go
- schema_array.go
- schema_boolean.go
- schema_custom.go
- schema_integer.go
- schema_number.go
- schema_object.go
- schema_reference.go
- schema_string.go
- security_requirement.go
- security_scheme.go
- security_scheme_flow.go
- server.go
- tag.go
Click to show internal directories.
Click to hide internal directories.