Skip to content

Commit

Permalink
Merge pull request #207 from meshery/nithish/fix/validate_util
Browse files Browse the repository at this point in the history
[Fix] Update validate function to support schemas with `required` fields
  • Loading branch information
humblenginr authored Aug 18, 2022
2 parents d447575 + 8cd0251 commit ca04e54
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions utils/cue.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ func Validate(schema cue.Value, value cue.Value) (bool, error) {
if uval.Err() != nil {
return false, uval.Err()
}
_, err := uval.MarshalJSON()
if err != nil {
return false, err
}
return true, nil
}

Expand Down

0 comments on commit ca04e54

Please sign in to comment.