mirror of
https://github.com/BishopFox/sj.git
synced 2026-11-07 10:26:01 -10:00
Merge pull request #38 from six2dez/patch-1
Added failsafe check for files with no security definitions
This commit is contained in:
1 file changed
+7
@@ -23,6 +23,13 @@ var (
|
||||
|
||||
func CheckSecDefs(doc3 openapi3.T) (apiInQuery bool, apiKey string, apiKeyName string) {
|
||||
|
||||
if doc3.Components == nil || doc3.Components.SecuritySchemes == nil || len(doc3.Components.SecuritySchemes) == 0 {
|
||||
if !quiet {
|
||||
log.Warn("No security schemes defined in the OpenAPI specification.")
|
||||
}
|
||||
return false, "", ""
|
||||
}
|
||||
|
||||
if outputFormat == "json" && !quiet {
|
||||
if len(doc3.Components.SecuritySchemes) != 0 {
|
||||
log.Warnf("The following authentication mechanisms are supported. If necessary, supply these manually when using the JSON output format:\n")
|
||||
|
||||
Reference in new issue
Block a user