jsonmapper
jsonmapper copied to clipboard
DateTime mapping is not very intuitive while it is a common type
Hi,
In the current state, the mapping of DateTime type is not very intuitive: it's a common json/php type but it's not clear how to make use of it in the mapping.
The documentation for example has the "Simple type mapping" paragraph, but says "disabled by default for security reasons" => so if we should not use this boolean for security reasons to map DateTime, what should we use instead?
The next documentation paragraphe "Class map" also has an example with DateTime in it, but it doesn't work to replace the boolean, $mapper->classMap['DateTime'] = function ($class, $jvalue) { is not taken into account when the boolean is true.
Note that my type mapping on the class is correct and detected, it works with the boolean set back to false.
Any ideas on this?