cmd

package
v0.0.0-...-e805a7d Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 23 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Headers []string

	UserAgent string
)

Functions

func BuildRequestsFromPaths

func BuildRequestsFromPaths(spec map[string]interface{}, client http.Client)

func CheckAndConfigureProxy

func CheckAndConfigureProxy() (client http.Client)

func CheckContentType

func CheckContentType(client http.Client, target string) string

func CheckSecuritySchemes

func CheckSecuritySchemes(spec map[string]interface{})

func EnforceSingleContentType

func EnforceSingleContentType(newContentType string)

func Execute

func Execute()

func ExtractSpecFromJS

func ExtractSpecFromJS(bodyBytes []byte) []byte

func GenerateExample

func GenerateExample(node *SchemaNode) interface{}

func GenerateRequests

func GenerateRequests(bodyBytes []byte, client http.Client)

func MakeRequest

func MakeRequest(client http.Client, method, target string, timeout int64, reqData io.Reader) ([]byte, string, int)

func PrintSpecInfo

func PrintSpecInfo(spec map[string]interface{})

func ResolveExternalRef

func ResolveExternalRef(ref string, baseDir string) map[string]interface{}

func ResolveRef

func ResolveRef(spec map[string]interface{}, ref string) map[string]interface{}

func ResolveRefWithContext

func ResolveRefWithContext(spec map[string]interface{}, ref string) (map[string]interface{}, map[string]interface{})

ResolveRefWithContext resolves a reference and returns both the resolved schema and the spec it came from

func SafelyUnmarshalSpec

func SafelyUnmarshalSpec(data []byte) map[string]interface{}

func SetScheme

func SetScheme(swaggerURL string) (scheme string)

func TrimHostScheme

func TrimHostScheme(apiTarget, fullUrlHost string) (host string)

TrimHostScheme trims the scheme from the provided URL if the '-T' flag is supplied to sj.

func UnmarshalSpec

func UnmarshalSpec(bodyBytes []byte) (newDoc *openapi3.T)

func WriteConvertedDefinitionFile

func WriteConvertedDefinitionFile(data []byte)

func XmlFromObject

func XmlFromObject(obj map[string]interface{}) string

Types

type Result

type Result struct {
	Method string `json:"method"`
	Status int    `json:"status"`
	Target string `json:"target"`
}

type SchemaNode

type SchemaNode struct {
	Type                 string
	Properties           map[string]*SchemaNode
	Items                *SchemaNode
	Required             map[string]bool
	Enum                 []interface{}
	Example              interface{}
	Ref                  string
	OneOf                []*SchemaNode
	AnyOf                []*SchemaNode
	AdditionalProperties *SchemaNode
}

func ExpandSchema

func ExpandSchema(
	spec map[string]interface{},
	schema map[string]interface{},
	visited map[string]bool,
	contextSpec map[string]interface{},
) *SchemaNode

type VerboseResult

type VerboseResult struct {
	Method  string `json:"method"`
	Preview string `json:"preview"`
	Status  int    `json:"status"`
	Target  string `json:"target"`
	Curl    string `json:"curl"`
}

Jump to

Keyboard shortcuts

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