Skip to content

Commit

Permalink
Improve custom validation message for array constraints (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiyanwso2 authored Dec 2, 2024
1 parent 6af90f2 commit cebafef
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ public type $util.resolveSpecialCharacters($resourceName) record {|
#if( $element.getMin() == $min )
minLength: {
value: $min$separator
message: "This field must be an array containing at least one item."
message: "Validation failed for $.$element.getPath() constraint. This field must be an array containing at least one item."
}#if( $element.getMax() == $max )$separator#end
#end

#if( $element.getMax() == $max )
maxLength: {
value: $max$separator
message: "This field must be an array containing at most one item."
message: "Validation failed for $.$element.getPath() constraint. This field must be an array containing at most one item."
}
#end
}
Expand Down Expand Up @@ -163,14 +163,14 @@ public type $util.resolveSpecialCharacters($extendedElement.getTypeName()) recor
#if( $childElement.getMin() == $min )
minLength: {
value: $min$separator
message: "This field must be an array containing at least one item."
message: "Validation failed for $.$childElement.getPath() constraint. This field must be an array containing at least one item."
}#if( $childElement.getMax() == $max )$separator#end
#end

#if( $childElement.getMax() == $max )
maxLength: {
value: $max$separator
message: "This field must be an array containing at most one item."
message: "Validation failed for $.$childElement.getPath() constraint. This field must be an array containing at most one item."
}
#end
}
Expand Down

0 comments on commit cebafef

Please sign in to comment.