openapi2postman2

package
v1.18.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPostmanURL

func BuildPostmanURL(cfg Configuration, swag openapi2.Specification, swaggerURL string, endpoint *openapi2.Endpoint) postman2.URL

BuildPostmanURL creates a Postman 2.0 spec URL from a Swagger URL

func Convert

Convert creates a Postman 2.0 collection from a configuration and Swagger 2.0 spec

func Merge

Merge creates a Postman 2.0 collection from a configuration, base Postman 2.0 collection and Swagger 2.0 spec

func Swagger2PathToPostman2APIItem

func Swagger2PathToPostman2APIItem(cfg Configuration, swag openapi2.Specification, url string, method string, endpoint *openapi2.Endpoint) *postman2.Item

Swagger2PathToPostman2APIItem converts a Swagger 2.0 path to a Postman 2.0 API item

Types

type Configuration

type Configuration struct {
	PostmanURLBase     string            `json:"postmanURLBase,omitempty"`
	PostmanURLHostname string            `json:"postmanURLHostname,omitempty"`
	PostmanHeaders     []postman2.Header `json:"postmanHeaders,omitempty"`
}

Configuration is a Spectrum configuration that holds information on how to create the Postman 2.0 collection including overriding Swagger 2.0 spec values.

type Converter

type Converter struct {
	Configuration Configuration
	Swagger       openapi2.Specification
}

Converter is the struct that manages the conversion.

func NewConverter

func NewConverter(cfg Configuration) Converter

NewConverter instantiates a new converter.

func (*Converter) Convert

func (conv *Converter) Convert(swaggerFilepath string, pmanSpecFilepath string) error

Convert builds a Postman 2.0 spec using a Swagger 2.0 spec.

func (*Converter) MergeConvert

func (conv *Converter) MergeConvert(swaggerFilepath string, pmanBaseFilepath string, pmanSpecFilepath string) error

MergeConvert builds a Postman 2.0 spec using a base Postman 2.0 collection and a Swagger 2.0 spec.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL