-
-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I am attempting to use the DateTime validator in an Apigility project. The configuration is set to not be required and continue if empty, however the validator always returns a validation error.
Input
{"name": "Joe Public", "email": "joe@business.com"}Validator configuration
1 => array(
'name' => 'dateField',
'required' => false,
'filters' => array(),
'validators' => array(
0 => array(
'name' => 'Zend\\I18n\\Validator\\DateTime',
'options' => array(
'pattern' => 'Y-m-d\TH:iP',
'message' => 'Date format must be Y-m-d\TH:iP',
),
),
),
'allow_empty' => true,
'continue_if_empty' => true,
'description' => 'Date field',
),Error message
{
"validation_messages": {
"dateOfBirth": {
"datetimeInvalid": "Date format must be Y-m-d\TH:iP"
}
},
"type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
"title": "Unprocessable Entity",
"status": 422,
"detail": "Failed Validation"
}Originally posted by @alexisbmills at zfcampus/zf-content-validation#49
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels