Skip to content

Commit

Permalink
readded error check
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Sep 29, 2024
1 parent e28c18d commit ac4b60c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion requests/validate_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,17 @@ func ValidateRequestSchema(
})
return false, validationErrors

Check warning on line 123 in requests/validate_request.go

View check run for this annotation

Codecov / codecov/patch

requests/validate_request.go#L116-L123

Added lines #L116 - L123 were not covered by tests
}
jsch, _ := compiler.Compile("requestBody.json")
jsch, err := compiler.Compile("requestBody.json")
if err != nil {
validationErrors = append(validationErrors, &errors.ValidationError{
ValidationType: helpers.RequestBodyValidation,
ValidationSubType: helpers.Schema,
Message: err.Error(),
Reason: "Failed to compile the request body schema.",
Context: string(jsonSchema),
})
return false, validationErrors
}

// validate the object against the schema
scErrs := jsch.Validate(decodedObj)
Expand Down

0 comments on commit ac4b60c

Please sign in to comment.