Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseCapsule ¶
type BaseCapsule struct {
*CapsulePowder
}
BaseCapsule provides necessary data to fill the template.
type Capsule ¶
type Capsule interface { SetData(specData *Data) SetMode(templateID string, subServiceID ...string) }
Capsule defines the common functions to implement for generator.
type CapsulePowder ¶
CapsulePowder provides necessary data to fill the template.
func (*CapsulePowder) SetData ¶
func (c *CapsulePowder) SetData(specData *Data)
SetData sets the API spec data.
func (*CapsulePowder) SetMode ¶
func (c *CapsulePowder) SetMode(templateID string, subServiceID ...string)
SetMode sets the template ID and sub service ID.
type CommonValidations ¶ added in v0.2.8
type CommonValidations struct { Maximum *float64 ExclusiveMaximum bool Minimum *float64 ExclusiveMinimum bool MaxLength *int64 MinLength *int64 Pattern string MaxItems *int64 MinItems *int64 UniqueItems bool MultipleOf *float64 Enum []string }
CommonValidations describes validations info of a property.
type Data ¶
type Data struct { Service *Service SubServices map[string]*SubService CustomizedTypes map[string]*Property }
Data stores the data of an API service to render.
type Operation ¶
type Operation struct { ID string Name string Description string DocumentationURL string Request *Request Responses map[int]*Response }
Operation stores the data of an operation.
type Property ¶
type Property struct { ID string Name string Description string Type string ExtraType string Format string CollectionFormat string Default string IsRequired bool Properties map[string]*Property CommonValidations }
Property describes info of a property.
type Request ¶
type Request struct { Method string Path string Properties *Property Query *Property Headers *Property FormData *Property Elements *Property Body *Property }
Request stores the data of request section.
type Response ¶
type Response struct { StatusCode *StatusCode Headers *Property Elements *Property Body *Property }
Response stores the data of response section.
type Service ¶
type Service struct { APIVersion string Name string BasePath string Description string Properties *Property Operations map[string]*Operation }
Service stores the data of a service.
type StatusCode ¶
StatusCode stores the data of status code.
Click to show internal directories.
Click to hide internal directories.