- added support for serializing objects that implement
JsonSerializable
- added the
DenormalizerAwareTrait
andNormalizerAwareTrait
traits to support normalizer/denormalizer awareness - added the
DenormalizerAwareInterface
andNormalizerAwareInterface
interfaces to support normalizer/denormalizer awareness - added a PSR-6 compatible adapter for caching metadata
- added a
MaxDepth
option to limit the depth of the object graph when serializing objects - added support for serializing
SplFileInfo
objects - added support for serializing objects that implement
DateTimeInterface
- added
AbstractObjectNormalizer
as a base class for normalizers that deal with objects - added support to relation deserialization
- added support for serialization and deserialization groups including annotations, XML and YAML mapping.
- added
AbstractNormalizer
to factorise code and ease normalizers development - added circular references handling for
PropertyNormalizer
- added support for a context key called
object_to_populate
inAbstractNormalizer
to reuse existing objects in the deserialization process - added
NameConverterInterface
andCamelCaseToSnakeCaseNameConverter
- [DEPRECATION]
GetSetMethodNormalizer::setCamelizedAttributes()
andPropertyNormalizer::setCamelizedAttributes()
are replaced byCamelCaseToSnakeCaseNameConverter
- [DEPRECATION] the
Exception
interface has been renamed toExceptionInterface
- added
ObjectNormalizer
leveraging thePropertyAccess
component to normalize objects containing both properties and getters / setters / issers / hassers methods.
- added a new serializer:
PropertyNormalizer
. LikeGetSetMethodNormalizer
, this normalizer will map an object's properties to an array. - added circular references handling for
GetSetMethodNormalizer
- added support for
is.*
getters inGetSetMethodNormalizer
- added
$context
support for XMLEncoder. - [DEPRECATION] JsonEncode and JsonDecode where modified to throw an exception if error found. No need for get*Error() functions
- added
GetSetMethodNormalizer::setCamelizedAttributes
to allow calling camel cased methods for underscored properties
- [BC BREAK] All Serializer, Normalizer and Encoder interfaces have been
modified to include an optional
$context
array parameter. - The XML Root name can now be configured with the
xml_root_name
parameter in the context option to theXmlEncoder
. - Options to
json_encode
andjson_decode
can be passed through the context options ofJsonEncode
andJsonDecode
encoder/decoders.
-
added DecoderInterface::supportsDecoding(), EncoderInterface::supportsEncoding()
-
removed NormalizableInterface::denormalize(), NormalizerInterface::denormalize(), NormalizerInterface::supportsDenormalization()
-
removed normalize() denormalize() encode() decode() supportsSerialization() supportsDeserialization() supportsEncoding() supportsDecoding() getEncoder() from SerializerInterface
-
Serializer now implements NormalizerInterface, DenormalizerInterface, EncoderInterface, DecoderInterface in addition to SerializerInterface
-
added DenormalizableInterface and DenormalizerInterface
-
[BC BREAK] changed
GetSetMethodNormalizer
's key names from all lowercased to camelCased (e.g.mypropertyvalue
tomyPropertyValue
) -
[BC BREAK] convert the
item
XML tag to an array<?xml version="1.0"?> <response> <item><title><![CDATA[title1]]></title></item><item><title><![CDATA[title2]]></title></item> </response>
Before:
Array()
After:
Array( [item] => Array( [0] => Array( [title] => title1 ) [1] => Array( [title] => title2 ) ) )