Documentation
¶
Overview ¶
swagger struct definition
Index ¶
Constants ¶
View Source
const SwaggerVersion = "1.2"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiDeclaration ¶
type ApiDeclaration struct {
ApiVersion string `json:"apiVersion"`
SwaggerVersion string `json:"swaggerVersion"`
BasePath string `json:"basePath"`
ResourcePath string `json:"resourcePath"` // must start with /
Consumes []string `json:"consumes,omitempty"`
Produces []string `json:"produces,omitempty"`
Apis []Api `json:"apis,omitempty"`
Models map[string]Model `json:"models,omitempty"`
}
https://github.com/wordnik/swagger-core/blob/scala_2.10-1.3-RC3/schemas/api-declaration-schema.json
type ApiKey ¶
type Authorization ¶
type Endpoint ¶
type ErrorResponse ¶
type GrantType ¶
type Infomation ¶
type Infomation struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Contact string `json:"contact,omitempty"`
TermsOfServiceUrl string `json:"termsOfServiceUrl,omitempty"`
License string `json:"license,omitempty"`
LicenseUrl string `json:"licenseUrl,omitempty"`
}
type Model ¶
type Model struct {
Id string `json:"id"`
Required []string `json:"required,omitempty"`
Properties map[string]ModelProperty `json:"properties"`
}
type ModelProperty ¶
type OAuth ¶
type Operation ¶
type Operation struct {
HttpMethod string `json:"httpMethod"`
Nickname string `json:"nickname"`
Type string `json:"type"` // in 1.1 = DataType
// ResponseClass string `json:"responseClass"` obsolete in 1.2
Summary string `json:"summary,omitempty"`
Notes string `json:"notes,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
ResponseMessages []ResponseMessage `json:"responseMessages,omitempty"` // optional
Consumes []string `json:"consumes,omitempty"`
Produces []string `json:"produces,omitempty"`
Authorizations []Authorization `json:"authorizations,omitempty"`
Protocols []Protocol `json:"protocols,omitempty"`
}
type Parameter ¶
type Parameter struct {
ParamType string `json:"paramType"` // path,query,body,header,form
Name string `json:"name"`
Description string `json:"description"`
DataType string `json:"dataType"` // 1.2 needed?
Type string `json:"type"` // integer
Format string `json:"format"` // int64
AllowMultiple bool `json:"allowMultiple"`
Required bool `json:"required"`
Minimum int `json:"minimum"`
Maximum int `json:"maximum"`
}
type ResourceListing ¶
type ResourceListing struct {
ApiVersion string `json:"apiVersion"`
SwaggerVersion string `json:"swaggerVersion"` // e.g 1.2
// BasePath string `json:"basePath"` obsolete in 1.1
Apis []ApiRef `json:"apis"`
Infos Infomation `json:"info"`
}
type ResponseMessage ¶
Click to show internal directories.
Click to hide internal directories.