Documentation
¶
Index ¶
- func ConvertToSwaggerResponse(data interface{}) map[string]interface{}
- func GetSwaggerType(goType string) string
- type Contact
- type ContentType
- type Info
- type License
- type OpenApi
- type Parameters
- type Path
- type Property
- type RequestBody
- type ResponsesItem
- type Schema
- type Security
- type Server
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToSwaggerResponse ¶
func ConvertToSwaggerResponse(data interface{}) map[string]interface{}
ConvertToSwaggerResponse converts a struct to a swagger response.
func GetSwaggerType ¶
GetSwaggerType returns the type of the swagger type that corresponds to the go type.
Types ¶
type ContentType ¶
type ContentType struct {
Schema Schema `json:"schema"`
}
type Info ¶
type Info struct {
Title string `json:"title"`
Description string `json:"description"`
TermsOfService string `json:"termsOfService"`
Contact Contact `json:"contact"`
License License `json:"license"`
Version string `json:"version"`
}
Info swagger info 根节点/**
type OpenApi ¶
type OpenApi struct {
Openapi string `json:"openapi"`
Info Info `json:"info"`
Host string `json:"host"`
BasePath string `json:"basePath"`
Schemes []string `json:"schemes"`
Servers []Server `json:"servers"`
Tags []Tag `json:"tags"`
Paths map[string]map[string]Path `json:"paths"`
Components map[string]interface{} `json:"components"`
Security []map[string][]string `json:"security"`
}
func NewOpenApi ¶
func (*OpenApi) AddSecurityApiKey ¶
func (*OpenApi) AddSecurityBasicAuth ¶
func (openapi *OpenApi) AddSecurityBasicAuth()
func (*OpenApi) AddSecurityBearerAuth ¶
func (openapi *OpenApi) AddSecurityBearerAuth()
type Parameters ¶
type Path ¶
type Path struct {
Tags []string `json:"tags"`
Summary string `json:"summary"`
Description string `json:"description"`
OperationId string `json:"operationId"`
Parameters interface{} `json:"parameters,omitempty"`
RequestBody RequestBody `json:"requestBody,omitempty"`
Responses map[string]ResponsesItem `json:"responses"`
Security []Security `json:"security"`
}
type RequestBody ¶
type RequestBody struct {
Content map[string]ContentType `json:"content,omitempty"`
}
type ResponsesItem ¶
Click to show internal directories.
Click to hide internal directories.