diff --git a/src/JsonMapper.php b/src/JsonMapper.php index 8bfdb7c..36cef03 100644 --- a/src/JsonMapper.php +++ b/src/JsonMapper.php @@ -242,6 +242,12 @@ private function mapValue( } } + foreach ($parameterType->types as $type) { + if ($type->name == \DateTime::class) { + return new \DateTime($jsonValue); + } + } + // TODO "Parameter %s of class %s does not accept string" + JSON path throw new JsonMapperException('Property ' . $jsonPropertyName . ' cannot be a string.'); }