Compare commits

...
2 Commits
3 changed files with 7 additions and 5 deletions

No files matched your search

+2
View File
@@ -14,6 +14,7 @@ import (
var getAccessibleEndpoints bool
var outputFormat string
var responsePreviewLength int
var testString string
var verbose bool
var automateCmd = &cobra.Command{
@@ -74,6 +75,7 @@ responds in an abnormal way, manual testing should be conducted (prepare manual
func init() {
automateCmd.PersistentFlags().StringVarP(&outputFormat, "output-format", "F", "console", "The output format. Only 'console' (default) and 'json' are supported at the moment.")
automateCmd.PersistentFlags().BoolVar(&getAccessibleEndpoints, "get-accessible-endpoints", false, "Only output the accessible endpoints (those that return a 200 status code).")
automateCmd.PersistentFlags().StringVar(&testString, "test-string", "bishopfox", "The string to use when testing endpoints with string values.")
automateCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose mode, which shows a preview of each response.")
automateCmd.PersistentFlags().IntVar(&responsePreviewLength, "response-preview-length", 50, "sets the response preview length when using verbose output.")
+1 -1
View File
@@ -49,7 +49,7 @@ $ sj convert -u https://petstore.swagger.io/v2/swagger.json -o openapi.json`,
log.Error("Command not specified. See the --help flag for usage.")
}
},
Version: "2.1.0",
Version: "2.2.0",
}
func Execute() {
+4 -4
View File
@@ -171,7 +171,7 @@ func BuildRequestsFromPaths(spec map[string]interface{}, client http.Client) {
pType = schema["type"].(string)
// Attempt to prevent version strings from being improperly supplied (i.e. v1)
if pType == "string" && pMap["name"] != "version" {
pValue = "bishopfox"
pValue = testString
} else {
pValue = "1"
}
@@ -202,7 +202,7 @@ func BuildRequestsFromPaths(spec map[string]interface{}, client http.Client) {
} else if propertyType, ok := propertyName["type"].(string); ok {
// Attempt to prevent version strings from being improperly supplied (i.e. v1)
if propertyType == "string" && propertyName["name"] != "version" {
pValue = "bishopfox"
pValue = testString
} else {
pValue = "1"
}
@@ -227,7 +227,7 @@ func BuildRequestsFromPaths(spec map[string]interface{}, client http.Client) {
} else if pType, ok := pMap["type"].(string); ok {
// Attempt to prevent version strings from being improperly supplied (i.e. v1)
if pType == "string" && pMap["name"] != "version" {
pValue = "bishopfox"
pValue = testString
} else {
pValue = "1"
}
@@ -286,7 +286,7 @@ func BuildRequestsFromPaths(spec map[string]interface{}, client http.Client) {
case "string":
// Attempt to prevent version strings from being improperly supplied (i.e. v1)
if propertyName["name"] != "version" {
pValue = "bishopfox"
pValue = testString
} else {
pValue = "1"
}