@@ -81,11 +81,19 @@ func Compile(schemaFilename string, referencedSchemaFilenames []string, dataLoad
81
81
// jsonschema.ValidationError object otherwise.
82
82
func Validate(instanceInterface map[string]interface{}, schemaObject Schema) ValidationResult {
83
83
validationError := schemaObject.Compiled.ValidateInterface(instanceInterface)
84
-
result, _ := validationError.(*jsonschema.ValidationError)
85
84
validationResult := ValidationResult{
86
-
Result: result,
85
+
Result: nil,
87
86
dataLoader: schemaObject.dataLoader,
88
87
}
88
+
89
+
if validationError != nil {
90
+
result, ok := validationError.(*jsonschema.ValidationError)
91
+
if !ok {
92
+
panic(validationError)
93
+
}
94
+
validationResult.Result = result
95
+
}
96
+
89
97
if validationResult.Result == nil {
90
98
logrus.Debug("Schema validation of instance document passed")
91
99
} else {
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4