Documentation
¶
Index ¶
- func CountEndpointsByTag(spec Specification, tags []string) histogram.HistogramSet
- func EndpointCount(spec Specification) int
- func GetJsonBodyParameterExampleForKey(params []Parameter, exampleKey string) (string, error)
- func WriteEndpointCountCSV(filename string, hset histogram.HistogramSet) error
- type Definition
- type DocumentationPart
- type Endpoint
- type ExternalDocs
- type Header
- type Info
- type Items
- type Parameter
- type Path
- type Property
- type Response
- type Schema
- type Specification
- func CopyEndpointsByTag(tag string, specOld, specNew Specification) (Specification, error)
- func Merge(specMaster, specExtra Specification) Specification
- func MergeDefinitions(specMaster, specExtra Specification) Specification
- func MergeDirectory(dir string) (Specification, error)
- func MergePaths(specMaster, specExtra Specification) Specification
- func MergeTags(specMaster, specExtra Specification) Specification
- func NewSpecificationFromBytes(data []byte) (Specification, error)
- func ReadSwagger2Spec(filepath string) (Specification, error)
- type Tag
- type XAmazonApigatewayDocumentation
- type XAmazonApigatewayDocumentationPartInfo
- type XAmazonApigatewayDocumentationPartLocation
- type XAmazonApigatewayDocumentationPartProperties
- type XAmazonApigatewayIntegration
- type XAmazonApigatewayIntegrationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountEndpointsByTag ¶
func CountEndpointsByTag(spec Specification, tags []string) histogram.HistogramSet
func EndpointCount ¶
func EndpointCount(spec Specification) int
EndpointCount returns a count of the endpoints for a specification.
func WriteEndpointCountCSV ¶
func WriteEndpointCountCSV(filename string, hset histogram.HistogramSet) error
Types ¶
type Definition ¶
type DocumentationPart ¶
type DocumentationPart struct {
Location XAmazonApigatewayDocumentationPartLocation `json:"location,omitempty"`
Properties XAmazonApigatewayDocumentationPartProperties `json:"properties,omitempty"`
}
type Endpoint ¶
type Endpoint struct {
Tags []string `json:"tags,omitempty"`
Summary string `json:"summary,omitempty"`
OperationID string `json:"operationId,omitempty"`
Description string `json:"description,omitempty"`
Consumes []string `json:"consumes,omitempty"`
Produces []string `json:"produces,omitempty"`
Parameters []Parameter `json:"parameters,omitempty"`
Responses map[string]Response `json:"responses,omitempty"`
XAmazonApigatewayIntegration *XAmazonApigatewayIntegration `json:"x-amazon-apigateway-integration,omitempty"`
}
Endpoint represents a Swagger 2.0 spec endpoint object.
type ExternalDocs ¶
type ExternalDocs struct {
Description string `json:"description,omitempty"`
URL string `json:"url,omitempty"`
}
ExternalDocs represents a Swagger 2.0 spec tag object. The URL property is required.
type Info ¶
type Info struct {
Description string `json:"description,omitempty"`
Version string `json:"version,omitempty"`
Title string `json:"title,omitempty"`
TermsOfService string `json:"termsOfService,omitempty"`
}
Info represents a Swagger 2.0 spec info object.
type Parameter ¶
type Parameter struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
In string `json:"in,omitempty"`
Description string `json:"description,omitempty"`
Schema *Schema `json:"schema,omitempty"`
Required bool `json:"required,omitempty"`
CollectionFormat string `json:"collectionFormat,omitempty"`
Items *Items `json:"items,omitempty"`
Default interface{} `json:"default,omitempty"`
XExamples map[string]string `json:"x-examples,omitempty"`
}
Parameter represents a Swagger 2.0 spec parameter object.
type Path ¶
type Path struct {
Get *Endpoint `json:"get,omitempty"`
Patch *Endpoint `json:"patch,omitempty"`
Post *Endpoint `json:"post,omitempty"`
Put *Endpoint `json:"put,omitempty"`
Delete *Endpoint `json:"delete,omitempty"`
Ref string `json:"$ref,omitempty"`
}
Path represents a Swagger 2.0 spec path object.
func (*Path) HasMethodWithTag ¶
type Specification ¶
type Specification struct {
Swagger string `json:"swagger,omitempty"`
Host string `json:"host,omitempty"`
Info *Info `json:"info,omitempty"`
BasePath string `json:"basePath,omitempty"`
Schemes []string `json:"schemes,omitempty"`
Tags []Tag `json:"tags,omitempty"`
Paths map[string]Path `json:"paths,omitempty"`
Definitions map[string]Definition `json:"definitions,omitempty"`
XAmazonApigatewayDocumentation *XAmazonApigatewayDocumentation `json:"x-amazon-apigateway-documentation,omitempty"`
}
Specification represents a Swagger 2.0 specification.
func CopyEndpointsByTag ¶
func CopyEndpointsByTag(tag string, specOld, specNew Specification) (Specification, error)
func Merge ¶
func Merge(specMaster, specExtra Specification) Specification
func MergeDefinitions ¶
func MergeDefinitions(specMaster, specExtra Specification) Specification
func MergeDirectory ¶
func MergeDirectory(dir string) (Specification, error)
func MergePaths ¶
func MergePaths(specMaster, specExtra Specification) Specification
func MergeTags ¶
func MergeTags(specMaster, specExtra Specification) Specification
func NewSpecificationFromBytes ¶
func NewSpecificationFromBytes(data []byte) (Specification, error)
NewSpecificationFromBytes returns a Swagger Specification from a byte array.
func ReadSwagger2Spec ¶ added in v1.0.0
func ReadSwagger2Spec(filepath string) (Specification, error)
ReadSwagger2Spec returns a Swagger Specification from a filepath.
type Tag ¶
type Tag struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
ExternalDocs *ExternalDocs `json:"externalDocs,omitempty"`
}
Tag represents a Swagger 2.0 spec tag object.
type XAmazonApigatewayDocumentation ¶
type XAmazonApigatewayDocumentation struct {
Version string `json:"version,omitempty"`
CreatedDate string `json:"createdDate,omitempty"`
DocumentationParts []DocumentationPart `json:"documentationParts,omitempty"`
}
type XAmazonApigatewayDocumentationPartInfo ¶
type XAmazonApigatewayDocumentationPartInfo struct {
Description string `json:"description,omitempty"`
}
type XAmazonApigatewayDocumentationPartProperties ¶
type XAmazonApigatewayDocumentationPartProperties struct {
Tags []string `json:"tags,omitempty"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
Info *XAmazonApigatewayDocumentationPartInfo `json:"info,omitempty"`
}
type XAmazonApigatewayIntegration ¶
type XAmazonApigatewayIntegration struct {
Responses map[string]XAmazonApigatewayIntegrationResponse `json:"responses,omitempty"`
PassthroughBehavior string `json:"passthroughBehavior,omitempty"`
RequestTemplates map[string]string `json:"requestTemplates,omitempty"`
Type string `json:"type,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.