Documentation ¶
Index ¶
- Constants
- type Auth
- type Body
- type BodySchema
- type Contact
- type Definition
- type DefinitionItem
- type DefinitionProperty
- type Endpoint
- type ExternalDoc
- type Generator
- type Info
- type Item
- type License
- type Parameter
- type Property
- type RequestBody
- type Response
- type ResponseSchema
- type Schema
- type Security
- type Swagger
- type Tag
- type Xml
Constants ¶
View Source
const ( APP_JSON = "application/json" APP_XML = "application/xml" SWAGGER_VERSION = "2.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body struct {
Schema BodySchema
}
type BodySchema ¶
type Definition ¶
type Definition struct { Type string `json:"type,omitempty" yaml:",omitempty"` Required []string `json:"required,omitempty" yaml:",omitempty"` Properties map[string]DefinitionProperty `json:"properties,omitempty" yaml:",omitempty"` Xml *Xml `json:"xml,omitempty" yaml:",omitempty"` Items *DefinitionItem `json:"items,omitempty" yaml:",omitempty"` }
type DefinitionItem ¶
type DefinitionProperty ¶
type DefinitionProperty struct { Type string `json:"type,omitempty" yaml:",omitempty"` Format string `json:"format,omitempty" yaml:",omitempty"` Description string `json:"description,omitempty" yaml:",omitempty"` Enum []string `json:"enum,omitempty" yaml:",omitempty"` Ref string `json:"$ref,omitempty" yaml:"oneOf,omitempty"` Default interface{} `json:"default,omitempty" yaml:",omitempty"` }
type Endpoint ¶
type Endpoint struct { Tags []string `json:"tags,omitempty" yaml:",omitempty"` Summary string `json:"summary,omitempty" yaml:",omitempty"` Description string `json:"description,omitempty" yaml:",omitempty"` OperationID string `json:"operationId,omitempty" yaml:"operationId"` Consumes []string `json:"consumes,omitempty" yaml:",omitempty"` Produces []string `json:"produces,omitempty" yaml:",omitempty"` Parameters []Parameter `json:"parameters,omitempty" yaml:",omitempty"` RequestBody *RequestBody `json:"requestBody,omitempty" yaml:"requestBody,omitempty"` Responses map[string]Response `json:"responses,omitempty" yaml:",omitempty"` Security []Auth `json:"security,omitempty" yaml:",omitempty"` Deprecated bool `json:"deprecated,omitempty" yaml:",omitempty"` }
type ExternalDoc ¶
type Info ¶
type Info struct { Description string `json:"description,omitempty" yaml:",omitempty"` Version string `json:"version"` Title string `json:"title"` TermsOfService string `json:"termsOfService,omitempty" yaml:"termsOfService" yaml:",omitempty"` Contact *Contact `json:"contact,omitempty" yaml:",omitempty"` License *License `json:"license,omitempty" yaml:",omitempty"` }
type Parameter ¶
type Parameter struct { In string `json:"in,omitempty" yaml:",omitempty"` Name string `json:"name,omitempty" yaml:",omitempty"` Description string `json:"description,omitempty" yaml:",omitempty"` Required bool `json:"required,omitempty" yaml:",omitempty"` Type string `json:"type,omitempty" yaml:",omitempty"` Format string `json:"format,omitempty" yaml:",omitempty"` Items []Item `json:"items,omitempty" yaml:",omitempty"` CollectionFormat string `json:"collectionFormat,omitempty" yaml:"collectionFormat,omitempty"` Schema *Schema `json:"schema,omitempty" yaml:",omitempty"` }
type RequestBody ¶
type Response ¶
type Response struct { Description string `json:"description"` Schema *ResponseSchema `json:"schema,omitempty" yaml:",omitempty"` Headers map[string]Property `json:"headers,omitempty" yaml:",omitempty"` }
type ResponseSchema ¶
type Swagger ¶
type Swagger struct { Swagger string `json:"swagger,omitempty" yaml:",omitempty"` Info Info `json:"info"` Host string `json:"host,omitempty" yaml:",omitempty"` BasePath string `json:"basePath,omitempty" yaml:"basePath,omitempty"` Tags []Tag `json:"tags,omitempty" yaml:",omitempty"` Schemes []string `json:"schemes,omitempty" yaml:",omitempty"` Paths map[string]map[string]Endpoint `json:"paths"` SecurityDefinitions map[string]Security `json:"securityDefinitions,omitempty" yaml:"securityDefinitions,omitempty"` Definitions map[string]Definition `json:"definitions,omitempty" yaml:",omitempty"` ExternalDocs *ExternalDoc `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"` }
type Tag ¶
type Tag struct { Name string `json:"name,omitempty" yaml:",omitempty"` Description string `json:"description.omitempty" yaml:",omitempty"` ExternalDoc *ExternalDoc `json:"externalDoc,omitempty" yaml:",omitempty"` }
Click to show internal directories.
Click to hide internal directories.