Documentation ¶
Index ¶
- Variables
- func FilterSchema(schema string) string
- func FormatAnchor(schema string) string
- func FormatMarkdown(src []byte, opt *markdown.Options) ([]byte, error)
- func FormatMarkdownFile(filename string) error
- func FormatPath(schema string) string
- func IsExcludeTag(tags []string) bool
- func RenderFromJSON(w Writer, r io.Reader, tmpl *Template) error
- func RenderFromYAML(w Writer, r io.Reader, tmpl *Template) error
- func StringContains(s []string, e string) bool
- type API
- type APIError
- type Contact
- type ExternalDocumentation
- type Info
- type License
- type Method
- type Operation
- type Operations
- type Parameter
- type Response
- type SchemaContext
- type SchemaObject
- type Tag
- type Template
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ExcludeTags = []string{}
)
Functions ¶
func FilterSchema ¶
func FormatAnchor ¶
func FormatMarkdown ¶
Process formats Markdown. If opt is nil the defaults are used. Error can only occur when reading input from filename rather than src.
func FormatMarkdownFile ¶
func FormatPath ¶
func IsExcludeTag ¶
func StringContains ¶
Types ¶
type API ¶
type API struct { Swagger string `json,yaml:"swagger"` Info Info `json,yaml:"info"` Host string `json,yaml:"host"` BasePath string `json,yaml:"basePath"` Schemes []string `json,yaml:"schemes"` Consumes []string `json,yaml:"consumes"` Produces []string `json,yaml:"produces"` Paths map[string]Operations `json,yaml:"paths"` Definitions map[string]SchemaObject `json,yaml:"definitions"` }
func DecodeJSON ¶
func DecodeYAML ¶
type ExternalDocumentation ¶
type Operation ¶
type Operation struct { API *API Operation string Path string Tags []string `json,yaml:"tags"` Description string `json,yaml:"description"` OperationID string `json,yaml:"operationId"` Summary string `json,yaml:"summary"` Parameters []Parameter `json,yaml:"parameters"` Responses map[string]Response `json,yaml:"responses"` Definitions map[string]SchemaObject `json,yaml:"definitions"` }
type Operations ¶
type Parameter ¶
type Parameter struct { Name string `json,yaml:"name"` In string `json,yaml:"in"` Description string `json,yaml:"description"` Required bool `json,yaml:"required"` Type string `json,yaml:"type"` CollectionFormat string `json,yaml:"collectionFormat"` Items map[string]interface{} `json,yaml:"items"` Schema SchemaObject `json,yaml:"schema"` }
func FilterParameters ¶
type Response ¶
type Response struct { Description string `json,yaml:"description"` Schema SchemaObject `json,yaml:"schema"` }
type SchemaContext ¶
type SchemaContext struct { TopRef string Definitions map[string]SchemaObject Definition SchemaObject }
func CollectSchema ¶
func CollectSchema(definitions map[string]SchemaObject, schema interface{}) SchemaContext
type SchemaObject ¶
type SchemaObject struct { Type string `json:"type"` Example string `json,yaml:"example"` Properties map[string]SchemaObject `json:"properties"` Description string `json:"description"` Ref string `json:"$ref"` Items struct { Type string `json:"type"` Ref string `json:"$ref"` } `json:"items"` ExternalDocs ExternalDocumentation `json,yaml:"external_docs"` }
func (*SchemaObject) UnmarshalJSON ¶
func (u *SchemaObject) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.