Spec validation option (#1865)

Co-authored-by: Rahul Bhati <rjbhati009@gmail.com>
Co-authored-by: Vishal <vishal-biyani@users.noreply.github.com>
This commit is contained in:
Harsh Thakur
2021-02-08 11:14:38 +05:30
committed by GitHub
co-authored by Rahul Bhati Vishal
parent f28799cc4c
commit 6f9bad3d05
5 changed files with 29 additions and 12 deletions
+12
View File
@@ -316,6 +316,18 @@ func GetSpecDir(input cli.Input) string {
return specDir
}
func GetValidationFlag(input cli.Input) bool {
validationFlag := input.String(flagkey.SpecValidate)
// if flag has not been set, we return true to turn on validation by default
if len(validationFlag) == 0 {
return true
}
if validationFlag == "false" {
return false
}
return true
}
// UpdateMapFromStringSlice parses key, val from "key=val" string array and updates passed map
func UpdateMapFromStringSlice(dataMap *map[string]string, params []string) bool {
updated := false