Documentation
¶
Index ¶
- Variables
- func Export(model *sadl.Model, conf *sadl.Data) error
- func Import(paths []string, conf *sadl.Data) (*sadl.Model, error)
- func ImportSwagger(paths []string, conf *sadl.Data) (*sadl.Model, error)
- func IsValidFile(path string) bool
- func IsValidSwaggerFile(path string) bool
- func OasError(format string, args ...interface{}) error
- func ValidateInfo(info *Info) error
- func ValidatePaths(paths map[string]*PathItem) error
- type Callback
- type Components
- type Contact
- type Content
- type Discriminator
- type Encoding
- type Example
- type ExternalDocumentation
- type Generator
- type Header
- type Info
- type License
- type Link
- type MediaType
- type Model
- type OAuthFlow
- type OAuthFlows
- type Operation
- type Parameter
- type PathItem
- type RequestBody
- type Response
- type Schema
- type SecurityRequirement
- type SecurityScheme
- type Server
- type ServerVariable
- type Tag
Constants ¶
This section is empty.
Variables ¶
View Source
var EnumTypes bool = true
Functions ¶
func ImportSwagger ¶ added in v1.7.1
func IsValidFile ¶
func IsValidSwaggerFile ¶ added in v1.7.1
func ValidateInfo ¶
func ValidatePaths ¶
Types ¶
type Components ¶
type Components struct {
Extensions map[string]interface{} `json:"-"`
Schemas map[string]*Schema `json:"schemas,omitempty"`
Parameters map[string]*Parameter `json:"parameters,omitempty"`
Headers map[string]*Header `json:"headers,omitempty"`
RequestBodies map[string]*RequestBody `json:"requestBodies,omitempty"`
Responses map[string]*Response `json:"responses,omitempty"`
SecuritySchemes map[string]*SecurityScheme `json:"securitySchemes,omitempty"`
Examples map[string]*Example `json:"examples,omitempty"`
Tags []*Tag `json:"tags,omitempty"`
Links map[string]*Link `json:"links,omitempty"`
Callbacks map[string]*Callback `json:"callbacks,omitempty"`
}
type Discriminator ¶
type Encoding ¶
type Encoding struct {
Extensions map[string]interface{} `json:"-"`
ContentType string `json:"contentType,omitempty"`
Headers map[string]*Header `json:"headers,omitempty"`
Style string `json:"style,omitempty"`
Explode bool `json:"explode,omitempty"`
AllowReserved bool `json:"allowReserved,omitempty"`
}
type ExternalDocumentation ¶
type Generator ¶
func (*Generator) ExportToOAS3 ¶
type Info ¶
type Info struct {
Extensions map[string]interface{} `json:"-"`
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"`
Version string `json:"version,omitempty"`
}
type Link ¶
type Link struct {
Extensions map[string]interface{} `json:"-"`
Description string `json:"description,omitempty"`
Href string `json:"href,omitempty"`
OperationId string `json:"operationId,omitempty"`
Parameters map[string]interface{} `json:"parameters,omitempty"`
Headers map[string]*Schema `json:"headers,omitempty"`
}
type Model ¶
type Model struct {
Extensions map[string]interface{} `json:"-"`
OpenAPI string `json:"openapi"` // Required
Info *Info `json:"info"` // Required
Servers []*Server `json:"servers,omitempty"` //?change
Paths map[string]*PathItem `json:"paths,omitempty"` //?change
Components *Components `json:"components,omitempty"`
Security []SecurityRequirement `json:"security,omitempty"`
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
}
func LoadSwagger ¶ added in v1.7.1
func (Model) MarshalJSON ¶
type OAuthFlows ¶
type Operation ¶
type Operation struct {
Extensions map[string]interface{} `json:"-"`
Tags []string `json:"tags,omitempty"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
OperationId string `json:"operationId,omitempty"`
Parameters []*Parameter `json:"parameters,omitempty"`
RequestBody *RequestBody `json:"requestBody,omitempty"`
Responses map[string]*Response `json:"responses,omitempty"`
Callbacks map[string]*Callback `json:"callbacks,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
Security []SecurityRequirement `json:"security,omitempty"`
Servers []*Server `json:"servers,omitempty"`
}
type Parameter ¶
type Parameter struct {
Extensions map[string]interface{} `json:"-"`
Name string `json:"name,omitempty"`
In string `json:"in,omitempty"`
Description string `json:"description,omitempty"`
Style string `json:"style,omitempty"`
Explode *bool `json:"explode,omitempty"`
AllowEmptyValue bool `json:"allowEmptyValue,omitempty"`
AllowReserved bool `json:"allowReserved,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
Required bool `json:"required,omitempty"`
Schema *Schema `json:"schema,omitempty"`
Example interface{} `json:"example,omitempty"`
Examples map[string]*Example `json:"examples,omitempty"`
Content Content `json:"content,omitempty"`
}
type PathItem ¶
type PathItem struct {
Extensions map[string]interface{} `json:"-"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Connect *Operation `json:"connect,omitempty"`
Delete *Operation `json:"delete,omitempty"`
Get *Operation `json:"get,omitempty"`
Head *Operation `json:"head,omitempty"`
Options *Operation `json:"options,omitempty"`
Patch *Operation `json:"patch,omitempty"`
Post *Operation `json:"post,omitempty"`
Put *Operation `json:"put,omitempty"`
Trace *Operation `json:"trace,omitempty"`
Servers []*Server `json:"servers,omitempty"`
Parameters []*Parameter `json:"parameters,omitempty"`
}
type RequestBody ¶
type Schema ¶
type Schema struct {
Ref string `json:"$ref,omitempty"`
OneOf []*Schema `json:"oneOf,omitempty"`
AnyOf []*Schema `json:"anyOf,omitempty"`
AllOf []*Schema `json:"allOf,omitempty"`
Not *Schema `json:"not,omitempty"`
Type string `json:"type,omitempty"`
Format string `json:"format,omitempty"`
Description string `json:"description,omitempty"`
Enum []interface{} `json:"enum,omitempty"`
Default interface{} `json:"default,omitempty"`
Example interface{} `json:"example,omitempty"`
ExternalDocs interface{} `json:"externalDocs,omitempty"`
// Array-related, here for struct compactness
UniqueItems bool `json:"uniqueItems,omitempty"`
// Number-related, here for struct compactness
ExclusiveMin bool `json:"exclusiveMinimum,omitempty"`
ExclusiveMax bool `json:"exclusiveMaximum,omitempty"`
// Properties
Nullable bool `json:"nullable,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
WriteOnly bool `json:"writeOnly,omitempty"`
XML interface{} `json:"xml,omitempty"`
// Number
Min *float64 `json:"minimum,omitempty"`
Max *float64 `json:"maximum,omitempty"`
MultipleOf *float64 `json:"multipleOf,omitempty"`
// String
MinLength uint64 `json:"minLength,omitempty"`
MaxLength *uint64 `json:"maxLength,omitempty"`
Pattern string `json:"pattern,omitempty"`
// Array
MinItems uint64 `json:"minItems,omitempty"`
MaxItems *uint64 `json:"maxItems,omitempty"`
Items *Schema `json:"items,omitempty"`
// Object
Required []string `json:"required,omitempty"`
Properties map[string]*Schema `json:"properties,omitempty"`
MinProps uint64 `json:"minProperties,omitempty"`
MaxProps *uint64 `json:"maxProperties,omitempty"`
AdditionalProperties interface{} `json:"additionalProperties,omitempty"`
Discriminator *Discriminator `json:"discriminator,omitempty"`
PatternProperties string `json:"patternProperties,omitempty"`
}
type SecurityRequirement ¶
type SecurityScheme ¶
type SecurityScheme struct {
Extensions map[string]interface{} `json:"-"`
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Name string `json:"name,omitempty"`
In string `json:"in,omitempty"`
Scheme string `json:"scheme,omitempty"`
BearerFormat string `json:"bearerFormat,omitempty"`
Flows *OAuthFlows `json:"flows,omitempty"`
}
type Server ¶
type Server struct {
Extensions map[string]interface{} `json:"-"`
URL string `json:"url,omitempty"`
Description string `json:"description,omitempty"`
Variables map[string]*ServerVariable `json:"variables,omitempty"`
}
type ServerVariable ¶
type Tag ¶
type Tag struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
ExternalDocs *ExternalDocumentation `json:"externalDocs,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.