cmd

package
v0.0.0-...-5851000 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Headers []string

	UserAgent string
)

Functions

func CheckAndConfigureProxy

func CheckAndConfigureProxy() (client http.Client)

func CheckContentType

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

func CheckSecDefs

func CheckSecDefs(doc3 openapi3.T) (apiInQuery bool, apiKey string, apiKeyName string)

func EnforceSingleContentType

func EnforceSingleContentType(newContentType string)

func Execute

func Execute()

func ExtractSpecFromJS

func ExtractSpecFromJS(bodyBytes []byte) []byte

func GenerateRequests

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

func HandleSchemaReference

func HandleSchemaReference(schema *openapi3.SchemaRef)

func MakeRequest

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

func PrintSpecInfo

func PrintSpecInfo(i openapi3.Info)

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)

Types

type Result

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

type SchemaReference

type SchemaReference struct {
	Required   []string
	Type       string
	Properties struct {
		Property struct {
			Type      string
			Format    string
			Example   string
			Reference string
			XML       struct {
				Name      string
				Namespace string
				Prefix    string
				Attribute bool
				Wrapped   bool
			}
		}
	}
}

type SwaggerRequest

type SwaggerRequest struct {
	ApiKey      string
	ApiKeyName  string
	ApiInQuery  bool
	BasePath    string
	Body        map[string]any
	BodyData    []byte
	Def         *openapi3.T
	Path        string
	Paths       []string
	Query       url.Values
	RawQuery    string
	ResultsJSON []string
	URL         url.URL
}

func (SwaggerRequest) AddParametersToRequest

func (s SwaggerRequest) AddParametersToRequest(op *openapi3.Operation) SwaggerRequest

This whole function needs to be refactored/cleaned up a bit

func (SwaggerRequest) BuildDefinedRequests

func (s SwaggerRequest) BuildDefinedRequests(client http.Client, method string, pathItem *openapi3.PathItem, op *openapi3.Operation) SwaggerRequest

func (SwaggerRequest) GetBasePath

func (s SwaggerRequest) GetBasePath() string

func (SwaggerRequest) IterateOverPaths

func (s SwaggerRequest) IterateOverPaths(client http.Client) SwaggerRequest

func (SwaggerRequest) PrintPreparedCommands

func (s SwaggerRequest) PrintPreparedCommands(method string)

func (SwaggerRequest) SetParametersFromSchema

func (s SwaggerRequest) SetParametersFromSchema(param *openapi3.ParameterRef, location, schemaRef string, req *openapi3.RequestBodyRef, counter int) SwaggerRequest

type VerboseResult

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

Jump to

Keyboard shortcuts

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