Skip to content

Commit 0bfe022

Browse files
Dragomir-Ivanovsmyrman
authored andcommitted
Add comment clarification for #235
1 parent 16dd57c commit 0bfe022

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

schema/schema.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ func (s Schema) Prepare(ctx context.Context, payload map[string]interface{}, ori
124124
if found {
125125
if def.Validator != nil {
126126
if validated, err := def.Validator.Validate(value); err != nil {
127+
// We treat a validation error as a change; the validation
128+
// error indicate invalid payload and will be caught
129+
// again by schema.Validate().
127130
changes[field] = value
128131
} else if !oFound || !reflect.DeepEqual(validated, oValue) {
129132
changes[field] = validated

0 commit comments

Comments
 (0)