Documentation
¶
Index ¶
- func ConvertOAS2FileToOAS3File(oas2file, oas3file string, perm os.FileMode, pretty bool) error
- func CountEndpointsByTag(spec Specification, tagsFilter []string) *histogram.HistogramSet
- func EndpointCount(spec Specification) int
- func FilenameIsYAML(filename string) bool
- func GetJSONBodyParameterExampleForKey(params []Parameter, exampleKey string) (string, error)
- func WriteEndpointCountCSV(filename string, hset histogram.HistogramSet) error
- func WriteFileDirMerge(outfile, inputDir string, perm os.FileMode) 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 Spec
- 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 MergeFilepaths(filepaths []string) (Specification, error)
- func MergePaths(specMaster, specExtra Specification) Specification
- func MergeTags(specMaster, specExtra Specification) Specification
- func NewSpecificationFromBytes(data []byte) (Specification, error)
- func ReadOpenAPI2SpecFile(filename string) (*Specification, error)
- func ReadOpenAPI2SpecFileDirect(filename string) (Specification, error)
- func ReadSwagger2SpecFile(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, tagsFilter []string) *histogram.HistogramSet
func EndpointCount ¶
func EndpointCount(spec Specification) int
EndpointCount returns a count of the endpoints for a specification.
func FilenameIsYAML ¶
FilenameIsYAML checks to see if a filename ends in `.yml` or `.yaml` with a case-insensitive match.
func GetJSONBodyParameterExampleForKey ¶ added in v1.12.0
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 { Delete *Endpoint `json:"delete,omitempty"` Get *Endpoint `json:"get,omitempty"` Head *Endpoint `json:"head,omitempty"` Options *Endpoint `json:"options,omitempty"` Patch *Endpoint `json:"patch,omitempty"` Post *Endpoint `json:"post,omitempty"` Put *Endpoint `json:"put,omitempty"` Ref string `json:"$ref,omitempty"` }
Path represents a Swagger 2.0 spec path object.
func (*Path) HasMethodWithTag ¶
type Spec ¶ added in v1.9.0
func ConvertSpectrumOAS2ToKinOAS2 ¶
func ConvertSpectrumOAS2ToKinOAS2(smSpec *Specification) (*Spec, error)
func ReadOpenAPI2KinSpecFile ¶
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 MergeFilepaths ¶
func MergeFilepaths(filepaths []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 ReadOpenAPI2SpecFile ¶
func ReadOpenAPI2SpecFile(filename string) (*Specification, error)
func ReadOpenAPI2SpecFileDirect ¶
func ReadOpenAPI2SpecFileDirect(filename string) (Specification, error)
func ReadSwagger2SpecFile ¶
func ReadSwagger2SpecFile(filepath string) (Specification, error)
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"` }
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
openapi2openapi3 relies on `swagger2openapi` to convert Swagger 2.0 specs to OpenAPI 3.0 specs.
|
openapi2openapi3 relies on `swagger2openapi` to convert Swagger 2.0 specs to OpenAPI 3.0 specs. |
Click to show internal directories.
Click to hide internal directories.