Documentation
¶
Index ¶
- func ExampleToResponse(data interface{}) interface{}
- type Components
- type Content
- type Example
- type Examples
- type Info
- type MediaType
- type OpenAPI
- type Operation
- type Parameter
- type Parameters
- type Path
- type Paths
- type RequestBodies
- type RequestBody
- type RequestBodyError
- type Response
- type Responses
- type Schema
- type SchemaContext
- type SchemaError
- type Schemas
- type Security
- type Server
- type Servers
- type Tag
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Components ¶
type Components struct {
Schemas Schemas `json:"schemas,omitempty" yaml:"schemas,omitempty"`
RequestBodies RequestBodies `json:"requestBodies,omitempty" yaml:"requestBodies,omitempty"`
}
Components -.
type Example ¶
type Example struct {
Value interface{} `json:"value,omitempty" yaml:"value,omitempty"`
}
Example -.
type Info ¶
type Info struct {
Title string `json:"title" yaml:"title"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Version string `json:"version" yaml:"version"`
}
Info Object See specification https://swagger.io/specification/#info-object
type MediaType ¶
type MediaType struct {
Schema Schema `json:"schema" yaml:"schema"`
Example interface{} `json:"example,omitempty" yaml:"example,omitempty"`
Examples Examples `json:"examples,omitempty" yaml:"examples,omitempty"`
}
Media Type Object See specification https://swagger.io/specification/#media-type-object
func (MediaType) ResponseByExample ¶
func (mt MediaType) ResponseByExample() interface{}
ResponseByExample -.
func (MediaType) ResponseByExamplesKey ¶
ResponseByExamplesKey -.
type OpenAPI ¶
type OpenAPI struct {
Paths Paths `json:"paths" yaml:"paths"`
Components Components `json:"components,omitempty" yaml:"components,omitempty"`
OpenAPI string `json:"openapi" yaml:"openapi"`
Servers Servers `json:"servers,omitempty" yaml:"servers,omitempty"`
Security []Security `json:"security,omitempty" yaml:"security,omitempty"`
Tags Tags `json:"tags,omitempty" yaml:"tags,omitempty"`
Info Info `json:"info" yaml:"info"`
}
OpenAPI Object See specification https://swagger.io/specification/#openapi-object
func (OpenAPI) LookupRequestBodyByReference ¶
func (api OpenAPI) LookupRequestBodyByReference(ref string) (RequestBody, error)
type Operation ¶
type Operation struct {
Parameters Parameters `json:"parameters,omitempty" yaml:"parameters,omitempty"`
RequestBody RequestBody `json:"requestBody,omitempty" yaml:"requestBody,omitempty"`
Responses Responses `json:"responses" yaml:"responses"`
}
Operation -.
type Parameter ¶
type Parameter struct {
Name string `json:"name,omitempty" yaml:"name,omitempty"`
In string `json:"in,omitempty" yaml:"in,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Schema *Schema `json:"schema,omitempty" yaml:"schema,omitempty"`
}
Parameter -.
type Path ¶
type Path struct {
Post *Operation `json:"post,omitempty" yaml:"post,omitempty"`
Get *Operation `json:"get,omitempty" yaml:"get,omitempty"`
Put *Operation `json:"put,omitempty" yaml:"put,omitempty"`
Patch *Operation `json:"patch,omitempty" yaml:"patch,omitempty"`
Delete *Operation `json:"delete,omitempty" yaml:"delete,omitempty"`
}
Path -.
type RequestBody ¶
type RequestBody struct {
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
Content Content `json:"content,omitempty" yaml:"content,omitempty"`
Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
}
RequestBody -.
type Response ¶
type Response struct {
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
Content Content `json:"content,omitempty" yaml:"content,omitempty"`
}
Response -.
type Schema ¶
type Schema struct {
Properties Schemas `json:"properties,omitempty" yaml:"properties,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Format string `json:"format,omitempty" yaml:"format,omitempty"`
Default interface{} `json:"default,omitempty" yaml:"default,omitempty"`
Example interface{} `json:"example,omitempty" yaml:"example,omitempty"`
Required []string `json:"required,omitempty" yaml:"required,omitempty"`
Items *Schema `json:"items,omitempty" yaml:"items,omitempty"`
MinItems int `json:"minItems,omitempty" yaml:"minItems,omitempty"`
MaxItems int `json:"maxItems,omitempty" yaml:"maxItems,omitempty"`
Ref string `json:"$ref,omitempty" yaml:"$ref,omitempty"`
Faker string `json:"x-faker,omitempty" yaml:"x-faker,omitempty"`
}
Schema -.
func (Schema) ResponseByExample ¶
func (s Schema) ResponseByExample(schemaContext SchemaContext) (interface{}, error)
ResponseByExample -.
type SchemaContext ¶
SchemaContext -.
type Server ¶
type Server struct {
URL string `json:"url" yaml:"url"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
}
Server -.
Click to show internal directories.
Click to hide internal directories.