Skip to content

Commit

Permalink
Merge pull request #188 from planetlabs/cangel/fix-validation-error
Browse files Browse the repository at this point in the history
validator: return validation error for extension validation errors
  • Loading branch information
christopher-angel authored Jul 15, 2024
2 parents b45c1e2 + d802de3 commit 43152aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ func (v *Validator) validate(resource crawler.Resource, info *crawler.ResourceIn
}
extensionErr := extensionSchema.Validate(map[string]interface{}(resource))
if extensionErr != nil {
if err, ok := extensionErr.(*jsonschema.ValidationError); ok {
return newValidationError(info.Location, resource, err)
}
return extensionErr
}
}
Expand Down

0 comments on commit 43152aa

Please sign in to comment.