mirror of
https://github.com/BishopFox/sj.git
synced 2026-11-09 01:49:38 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9fac2e9fe | ||
|
|
10fe0376c0 |
No files matched your search
@@ -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
@@ -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
@@ -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"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user