Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct { Path string `json:"path"` // relative or absolute, must start with / Description string `json:"description"` Operations []Operation `json:"operations,omitempty"` Models map[string]Model `json:"models,omitempty"` }
func (*Api) AddOperation ¶
type ApiDeclaration ¶
type ApiDeclaration struct { ApiVersion string `json:"apiVersion"` SwaggerVersion string `json:"swaggerVersion"` BasePath string `json:"basePath"` ResourcePath string `json:"resourcePath"` // must start with / Apis []Api `json:"apis,omitempty"` Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` }
func NewApiDeclaration ¶
func NewApiDeclaration(version string, basePath string, ressourcePath string) (decl ApiDeclaration)
func (*ApiDeclaration) AddApi ¶
func (decl *ApiDeclaration) AddApi(api Api)
type ApiKey ¶
type Authorization ¶
type Endpoint ¶
type ErrorResponse ¶
type GrantType ¶
type Model ¶
type Model struct { Id string `json:"id"` Required []string `json:"required"` 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"` }
func NewOperation ¶
func (*Operation) AddParameter ¶
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 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 []Api `json:"apis"` }
func NewRessourceListing ¶
func NewRessourceListing(apiVersion string, apis []Api) (rl ResourceListing)
func (*ResourceListing) AddApi ¶
func (rl *ResourceListing) AddApi(api Api)
type ResponseMessage ¶
Click to show internal directories.
Click to hide internal directories.