Documentation
¶
Index ¶
Constants ¶
View Source
const SwaggerVersion = "2.0"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type API ¶
type API struct {
SwaggerVersion string `json:"swagger"`
Info Info `json:"info,omitempty"`
Host string `json:"host"`
Basepath string `json:"basePath"`
Schemes []string `json:"schemes"`
Consumes []string `json:"consumes"`
Produces []string `json:"produces"`
Paths map[string]Path `json:"paths"`
Definitions map[string]Schema `json:"definitions,omitempty"`
Parameters map[string]Param `json:"parameters,omitempty"`
}
API describes the base of the API
type Contact ¶
type Contact struct {
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
URL string `json:"url,omitempty"`
}
Contact Info
type Info ¶
type Info struct {
Version string `json:"version,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Termsofservice string `json:"termsOfService,omitempty"`
Contact *Contact `json:"contact,omitempty"`
License *License `json:"license,omitempty"`
}
Info describes the meta-info of the API
type Method ¶
type Method struct {
Description string `json:"description,omitempty"`
Operationid string `json:"operationId,omitempty"`
Produces []string `json:"produces,omitempty"`
Parameters []Param `json:"parameters,omitempty"`
Responses map[string]Response `json:"responses"`
Tags []string `json:"tags",omitempty`
}
Method describes an API method
type Param ¶
type Param struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Type Type `json:"type,omitempty"`
Items Type `json:"items,omitempty"`
Format string `json:"format,omitempty"`
Default interface{} `json:"default,omitempty"`
Max float64 `json:"maximum,omitempty"`
HasMax bool `json:"-"`
Min float64 `json:"minimum,omitempty"`
HasMin bool `json:"-"`
MaxLength int `json:"maxLength,omitempty"`
MinLength int `json:"minLength,omitempty"`
Pattern string `json:"pattern,omitempty"`
Enum []string `json:"enum,omitempty"`
In string `json:"in,omitempty"`
Global bool `json:"-"`
Ref string `json:"$ref,omitempty"`
}
Param describes a single request param
type Schema ¶
type Schema *jsonschema.Schema
Schema is a generic jsonschema definition - TBD how we want to represent it
Click to show internal directories.
Click to hide internal directories.