postmanimport

package
v2.3.0-beta44 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package postmanimport implements the import of a Postman collection to Keploy tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ItemsContainer

type ItemsContainer struct {
	PostmanItems  []PostmanItem
	TestDataItems []TestData
}

func (ItemsContainer) MarshalJSON

func (ic ItemsContainer) MarshalJSON() ([]byte, error)

func (*ItemsContainer) UnmarshalJSON

func (ic *ItemsContainer) UnmarshalJSON(data []byte) error

type PostmanCollection

type PostmanCollection struct {
	Info struct {
		PostmanID string `json:"_postman_id"`
		Name      string `json:"name"`
		Schema    string `json:"schema"`
	} `json:"info"`
	Items     json.RawMessage          `json:"item"`
	Variables []map[string]interface{} `json:"variable"`
}

type PostmanCollectionStruct

type PostmanCollectionStruct struct {
	Info struct {
		PostmanID string `json:"_postman_id"`
		Name      string `json:"name"`
		Schema    string `json:"schema"`
	} `json:"info"`
	Items     ItemsContainer           `json:"item"`
	Variables []map[string]interface{} `json:"variable"`
}

type PostmanImporter

type PostmanImporter struct {
	// contains filtered or unexported fields
}

func NewPostmanImporter

func NewPostmanImporter(ctx context.Context, logger *zap.Logger) *PostmanImporter

func (*PostmanImporter) Import

func (pi *PostmanImporter) Import(collectionPath string) error

type PostmanItem

type PostmanItem struct {
	Name      string              `json:"name"`
	Variables []map[string]string `json:"variable"`
	Item      []TestData          `json:"item"`
}

type PostmanRequest

type PostmanRequest struct {
	Method string                   `json:"method"`
	Header []map[string]interface{} `json:"header"`
	Body   PostmanRequestBody       `json:"body"`
	URL    interface{}              `json:"url"`
}

type PostmanRequestBody

type PostmanRequestBody struct {
	Mode       string                   `json:"mode"`
	Raw        string                   `json:"raw"`
	Urlencoded []map[string]interface{} `json:"urlencoded"`
	Formdata   []map[string]interface{} `json:"formdata"`
}

type PostmanResponse

type PostmanResponse struct {
	Body            string              `json:"body"`
	Status          string              `json:"status"`
	Code            int                 `json:"code"`
	OriginalRequest *PostmanRequest     `json:"originalRequest,omitempty"`
	Header          []map[string]string `json:"header"`
}

type TestData

type TestData struct {
	Name      string                   `json:"name"`
	Request   PostmanRequest           `json:"request"`
	Response  []PostmanResponse        `json:"response"`
	Variables []map[string]interface{} `json:"variable"`
}

Jump to

Keyboard shortcuts

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