Documentation ¶
Index ¶
- func BuildPostmanURL(cfg Configuration, spec *openapi3.Spec, specPath string, ...) postman2.URL
- func ConvertSpec(cfg Configuration, oas3spec *openapi3.Spec) (postman2.Collection, error)
- func CreateTagsAndTagGroups(pman postman2.Collection, spec *openapi3.Spec) (postman2.Collection, error)
- func Merge(cfg Configuration, pman postman2.Collection, oas3spec *openapi3.Spec) (postman2.Collection, error)
- func Openapi3OperationToPostman2APIItem(cfg Configuration, oas3spec *openapi3.Spec, oasUrl string, method string, ...) (*postman2.Item, error)
- func ParamsOpenAPI3ToPostman(oparams []*oas3.ParameterRef) postman2.URLParameters
- func PostmanURLAddDefaultsOAS3(pmanURL postman2.URL, operation *oas3.Operation) postman2.URL
- type Configuration
- type Converter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPostmanURL ¶
func ConvertSpec ¶
func ConvertSpec(cfg Configuration, oas3spec *openapi3.Spec) (postman2.Collection, error)
ConvertSpec creates a Postman 2.0 collection from a configuration and Swagger 2.0 spec
func CreateTagsAndTagGroups ¶
func CreateTagsAndTagGroups(pman postman2.Collection, spec *openapi3.Spec) (postman2.Collection, error)
func Merge ¶
func Merge(cfg Configuration, pman postman2.Collection, oas3spec *openapi3.Spec) (postman2.Collection, error)
Merge creates a Postman 2.0 collection from a configuration, base Postman 2.0 collection and Swagger 2.0 spec
func ParamsOpenAPI3ToPostman ¶
func ParamsOpenAPI3ToPostman(oparams []*oas3.ParameterRef) postman2.URLParameters
ParamsOpenAPI3ToPostman returns a slices of Postman parameters for a slice of OpenAPI 3 parameters.
Types ¶
type Configuration ¶
type Configuration struct { // PostmanServerURLBasePath supports setting the base path as an environment variable // such as {{MY_API_BASE_URL}} PostmanServerURLBasePath string `json:"postmanServerUrlApiBasePath,omitempty"` PostmanServerURL string `json:"postmanServerUrl,omitempty"` PostmanURLHostname string `json:"postmanURLHostname,omitempty"` PostmanHeaders []postman2.Header `json:"postmanHeaders,omitempty"` UseXTagGroups bool `json:"useXTagGroups,omitempty"` RequestBodyFunc func(urlPath string) string }
Configuration is a Spectrum configuration that holds information on how to create the Postman 2.0 collection including overriding Swagger 2.0 spec values.
func ConfigurationReadFile ¶
func ConfigurationReadFile(filename string) (Configuration, error)
type Converter ¶
type Converter struct { Configuration Configuration OpenAPISpec *openapi3.Spec }
Converter is the struct that manages the conversion.
func NewConverter ¶
func NewConverter(cfg Configuration) Converter
NewConverter instantiates a new converter.
func (*Converter) ConvertFile ¶
ConvertFile builds a Postman 2.0 spec using an OpenAPI 3.0 spec.
Click to show internal directories.
Click to hide internal directories.