serializer

Library for (de-)serializing data of any complexity (supports JSON, and XML)

MIT License

Downloads
107.8M
Stars
2.3K
Committers
237
serializer - BC Break Fix

Published by schmittjoh over 7 years ago

This reverts the directory changes as they caused a BC in some dependent libraries.

serializer - 1.8.0 stable release

Published by goetas over 7 years ago

The 1.8.0 release comes with some improvements regarding null handling (thanks to @Bouwdie), DateTime parsing when deserializing, migration to PSR-4 namespaces, and few other improvements. Some bugs have also been fixed regarding doctrine proxies and array inlining.

Implemented enhancements:

  • Detect XML xsi:nil="true" to null when deserializing #790 (goetas)
  • Added support for a third deserialize parameter for the DateTime type #788 (bobvandevijver)
  • Added trim to xml metadata reader for groups parameter, and added support for groups element #781 (mrosiu)
  • Add propertyMetdata to dynamic expression variables #778 (goetas)
  • Fix xml deserialization when xsi:nil="true" is set #771 (Bouwdie)

Fixed bugs:

  • do not disappear type params in DoctrineProxySubscriber #793 (kriswallsmith)
  • #784 fix with inline array of type array<K, V> #785 (aviortm)

Closed issues:

  • inline array with type array<K, V> not serialized #784
  • [2.0] [Feature-request] Provide InitializedObjectConstructor as default #775
  • Allow access to PropertyMetadata in Dynamic Exclusion strategies #772
  • Overriding groups at runtime does not work, or? #767
  • DateTime format and control characters #94

Merged pull requests:

  • Missing features of the compiler pass #789 (mikemix)
  • Updated documentation related to PR #778 #780 (bblue)
  • [RFC] Move to PSR 4 #770 (goetas)
  • Re-formatted code for better PSR compliance #769 (goetas)
  • Proposing some guidelines for contributing #763 (goetas)
serializer - 1.7.1 - Doctrine proxies and type handlers bugfix

Published by goetas over 7 years ago

The 1.7.1 release fixes an important bug introduced in 1.7.0 (#765 [custom handlers on virtual types were not triggered if the underlying object was a doctrine proxy] ).

Suggested immediate update to everybody using the serializer in combination with doctrine.

Fixed bugs:

  • Custom type handlers does not work with doctrine proxies anymore #765
  • Doctrine listener should not change the type on proxies with virtual type #768 (goetas)

Closed issues:

  • Missing bool type in graphNavigator.php in method accept() #764
  • The sub-class "Proxy-Class" is not listed in the discriminator of the base class "DiscriminatorClass" #459
  • Configure whether serializing empty array. #124
serializer - 1.7.0

Published by goetas over 7 years ago

1.7.0 stable release

The 1.7.0 release contains a big set of improvements, especially when talking about:

  • consistency when dealing with arrays, hashes/maps (#728) and stdClass instances (#749, #730).
    This was a long standing group if inconsistencies and unexpected behaviors that now are finally solved.
    If you had issues with JSON arrays/hashes/maps serialization, and you were relying on internal/undocumented behaviors (example: extending JsonSerializationVisitor and overriding visitArray), recommended a more careful update process;
  • various fixes regarding Doctrine proxies (#750) and Doctrine objects instantiation (#751).
    This was a long standing feature request to configure the doctrine object constructor behavior when a requested entity is not found;

Details

Implemented enhancements:

  • Allow to configure the doctrine object constructor #751 (goetas)
  • Trigger doctrine events on doctrine proxies #750 (goetas)
  • Added stdClass serialization handler #749 (goetas)
  • Allow to typehint for the type (array/hash) of the root item to be serialized #728 (goetas)

Fixed bugs:

  • Array gets serialized as object, not as array, depending on order. #709
  • Doctrine Proxies and serializer.pre_serialize #666
  • Fix stdClass inconsistencies when serializing to JSON #730 (goetas)
  • Allow to typehint for the type \(array/hash\) of the root item to be serialized #728 (goetas)
  • Allow to skip "empty serialization result" when serializing #757 (goetas)

Closed issues:

  • Error deserializing a map of (nullable) objects #762
  • Add data using setData produces hashes instead of arrays #761
  • Is it possible to use @XmlNamespace & @XmlRoot in a class at same time ? #759
  • Serializes FOS:User datas with ExclusionPolicy("all") #599
  • Array serialized as JSON object #706
  • From old issue #290 #670
  • Form validation error response - field names not converted from camel case to underscore #587
  • Ability to getGroups on Context #554
  • SerializedName misleading usage and constructor issue #548
  • Discriminator should support xmlAttribute #547
  • Public method accessor is required for excluded/not exposed properties #519
  • Entity changed via preserialize and wrongly persisted #509
  • XML deserialization properties null when using default namespace #504
  • AccessorOrder is ignored #501
  • Deserialization of sub entites with non existing id #492
  • [Question] Handler/Converter for specific field #476
  • getClassName regex may incorrectly retrieve a false class name from comments above the class. #460
  • The sub-class "Proxy-Class" is not listed in the discriminator of the base class "DiscriminatorClass" #459
  • Multiple types for property? #445
  • Allow non-qualified XML serialization when XML namespaces are part of the metadata #413
  • Discriminator field name #412
  • Serializing to and deserializing from DateTime is inconsistent #394
  • ManyToOne and OneToMany Serialization Groups #387
  • Static SubscribingHandlerInterface::getSubscribingMethod #380
  • User defined ordering function #379
  • serialized_name for discriminator #372
  • Serializing object with empty array #350
  • VirtualProperty(s) are ignored with AccessorOrder #349
  • When setting a group of serialization, the inheritance doesn't work anymore #328
  • Serialization of empty object #323
  • "Can't pop from an empty datastructure" error when multiple serializer calls #319
  • virtual_properties cannot be excluded with groups #291
  • Integer serialized as String using VirtualProperty #289
  • SimpleObjectProxy is not implement abstract methods of Proxy class #287
  • Serializing array that have one of the element or member of an element an empty object #277
  • Serialization with groups return json object instead array #267
  • The purpose of "Force JSON output to "{}" instead of "[]" if it contains either no properties or all properties are null" #248
  • Json array serialisation #242
  • Ignoring "Assert" in output doc if excluded #241
  • Alphabetical accessor order doesn't respect SerializedName overrides #240
  • Request Annotation for Array Data #234
  • Allow @var instead of @Type when deserializing #233
  • Strange issue with groups exclusion strategy #230
  • Warning when deserializing removed entity #216
  • Where in the JMS code does the navigator call VisitProperty method for visitor #207
  • Property of the type array is not in alphabetic order after serialization #196
  • Magic and inconsistencies in array serialization #191
  • PreSerialization Event not handled if the value is not object #162
  • Hierarchical object serialization does not appear to inherit metadata from ancestors for metadata defined in XML #151
  • When using MaxDepth, Serialization of an array entitiy is not working #132
  • Switch to change default naming strategy #128
  • Throw exceptions on invalid input #112
  • Recursion detected error when serialization groups are in use #96
  • Allow serialization groups to be accessible within event subscriber callbacks. #84
  • Allow Constructed Object to be Passed to Deserialize #79
  • JSON recursion when first object in root list is empty #61
  • Can't serialize an array with an empty object #59

Merged pull requests:

  • Added runtime twig extension support (significant performance improvements) #747 (goetas)
serializer - 1.7.0 2nd release candidate

Published by goetas over 7 years ago

Fixed bugs:

  • Allow to skip "empty serialization result" when serializing #757 (goetas)

Closed issues:

  • Is it possible to use @XmlNamespace & @XmlRoot in a class at same time ? #759
  • Serializes FOS:User datas with ExclusionPolicy("all") #599
serializer - 1.7.0 release candidate

Published by goetas over 7 years ago

Highlights

This release contains a big set of improvements, especially when talking about:

  • consistency when dealing with arrays, hashes/maps (#728) and stdClass instances (#749, #730);
  • various fixes regarding Doctrine proxies (#750) and Doctrine objects instantiation (#751);
  • added some optimizations when using the serializer combined with Twig (#747)

Details

Implemented enhancements:

  • Allow to configure the doctrine object constructor #751 (goetas)
  • Trigger doctrine events on doctrine proxies #750 (goetas)
  • Added stdClass serialization handler #749 (goetas)
  • Allow to typehint for the type (array/hash) of the root item to be serialized #728 (goetas)

Fixed bugs:

  • Array gets serialized as object, not as array, depending on order. #709
  • Doctrine Proxies and serializer.pre_serialize #666
  • Fix stdClass inconsistencies when serializing to JSON #730 (goetas)
  • Allow to typehint for the type \(array/hash\) of the root item to be serialized #728 (goetas)

Closed issues:

  • Array serialized as JSON object #706
  • From old issue #290 #670
  • Form validation error response - field names not converted from camel case to underscore #587
  • Ability to getGroups on Context #554
  • SerializedName misleading usage and constructor issue #548
  • Discriminator should support xmlAttribute #547
  • Public method accessor is required for excluded/not exposed properties #519
  • Entity changed via preserialize and wrongly persisted #509
  • XML deserialization properties null when using default namespace #504
  • AccessorOrder is ignored #501
  • Deserialization of sub entites with non existing id #492
  • [Question] Handler/Converter for specific field #476
  • getClassName regex may incorrectly retrieve a false class name from comments above the class. #460
  • The sub-class "Proxy-Class" is not listed in the discriminator of the base class "DiscriminatorClass" #459
  • Multiple types for property? #445
  • Allow non-qualified XML serialization when XML namespaces are part of the metadata #413
  • Discriminator field name #412
  • Serializing to and deserializing from DateTime is inconsistent #394
  • ManyToOne and OneToMany Serialization Groups #387
  • Static SubscribingHandlerInterface::getSubscribingMethod #380
  • User defined ordering function #379
  • serialized_name for discriminator #372
  • Serializing object with empty array #350
  • VirtualProperty(s) are ignored with AccessorOrder #349
  • When setting a group of serialization, the inheritance doesn't work anymore #328
  • Serialization of empty object #323
  • "Can't pop from an empty datastructure" error when multiple serializer calls #319
  • virtual_properties cannot be excluded with groups #291
  • Integer serialized as String using VirtualProperty #289
  • SimpleObjectProxy is not implement abstract methods of Proxy class #287
  • Serializing array that have one of the element or member of an element an empty object #277
  • Serialization with groups return json object instead array #267
  • The purpose of "Force JSON output to "{}" instead of "[]" if it contains either no properties or all properties are null" #248
  • Json array serialisation #242
  • Ignoring "Assert" in output doc if excluded #241
  • Alphabetical accessor order doesn't respect SerializedName overrides #240
  • Request Annotation for Array Data #234
  • Allow @var instead of @Type when deserializing #233
  • Strange issue with groups exclusion strategy #230
  • Warning when deserializing removed entity #216
  • Where in the JMS code does the navigator call VisitProperty method for visitor #207
  • Property of the type array is not in alphabetic order after serialization #196
  • Magic and inconsistencies in array serialization #191
  • PreSerialization Event not handled if the value is not object #162
  • Hierarchical object serialization does not appear to inherit metadata from ancestors for metadata defined in XML #151
  • When using MaxDepth, Serialization of an array entitiy is not working #132
  • Switch to change default naming strategy #128
  • Throw exceptions on invalid input #112
  • Recursion detected error when serialization groups are in use #96
  • Allow serialization groups to be accessible within event subscriber callbacks. #84
  • Allow Constructed Object to be Passed to Deserialize #79
  • JSON recursion when first object in root list is empty #61
  • Can't serialize an array with an empty object #59

Merged pull requests:

  • Added runtime twig extension support (significant performance improvements) #747 (goetas)
serializer - Fixed issues with expression virtual prop and exclude all policy

Published by goetas over 7 years ago

Fixed bugs:

  • @VirtualProperty "exp" does not play nice with @ExclusionPolicy("ALL") #746
serializer - Fixed XML edge-case when using max-depth exclusion strategy

Published by goetas over 7 years ago

Fixed bugs:

  • Do not output the XML node when the object will be emtpy #744 (goetas)

Closed issues:

  • XmlList not working since version 1.5.0 with xmlns attributes #742
  • DoctrineObjectConstructor: how to use it without Symfony, in a PHP project #741
  • Outdated docs site #733
  • Allow data access to Property naming strategy #717
  • Can't hint interface using @Type to trigger custom handler #631
  • JSON/YAML encoding changes #617
  • Why do we need this check inside SerializedName constructor, if there is name? #558
  • Is it possible to deserialize Collection from Json #534
  • PhpCollection 0.4 #531
  • Possible mismatch of xml-attribute-map and $pMetadata->xmlAttribute in XmlDriver.php #422
  • Access level propose for Handler/DateHandler.php #386
  • Type DateTime and Timestamp (U format) #343
serializer - Expression language based virtual properties and other improvements

Published by goetas over 7 years ago

1.6.0 stable

Implemented enhancements:

  • Add DateTimeImmutable support to DateHandler #543

Fixed bugs:

  • Virtual property having type overriden by doctrine metadata #276

Closed issues:

  • Serialize a subclass #735
  • How to handle Doctrine not found entity ? #731
  • Regression with 1.5.0 => Undefined offset 15 #715
  • detect serialisation without groups set #546
  • Introducing the NormalizerInterface #537
  • How to set JSON serialization options? #535
  • @MaxDepth doesn't seem to be working #522
  • max_depth in YML config is ignored #498
  • Dynamic property type annotation #436
  • How to deserialize JSON if property might have a list of subobjects? #355
  • Object to array normalization #354
  • Serialize Doctrine object without references #353
  • Post_serialize doesn't serialize relation! #236
  • parsing string to date #217
  • Discriminator is not exposed when using a group exclusion strategy #157
serializer - Expression language based virtual properties and other improvements

Published by goetas over 7 years ago

The main feature that will be released with the 1.6.0 release is the "expression language based virtual properties" support.

For more info about expression language based virtual properties you can read this document.

Other things contained in the release candidate:

Implemented enhancements:

  • Expression language based virtual properties #708 (goetas)
  • check that cache directory was not created before throwing exception #729 (mente)
  • #720 - Adding support for DateInterval deserialization #721 (c0ntax)
  • Xml namespaces improvements #644 (goetas)

Fixed bugs:

  • Serialize correctly empty intervals according to ISO-8601 #722 (goetas)

Closed issues:

  • Add symfony expression in exclusions/expositions #406
  • Is it possible to achieve something like - shouldSerializeEmpty #725
  • How to handle DateTime serialization with fromArray method ? #723
  • DateInterval supported for serialization but not deserialization #720
  • Deserialization of collection when wraped by aditional xml tags #719
  • SerializedName based on a property value #716
  • Blank XML breaks XmlDeserializationVisitor error handling #701
  • Problem with FOSUserBundle ROLE serialization #690
  • Doctrine cache dependency when using setCacheDir #676
  • OneToOne entities are not deserialized if passing a nested one-to-one property #652
  • [RFC] Serialization refacotring #609
  • Object handler callback returns array, but serialized object = null #594
  • Cannot add @Discriminator field into specific @Group #557
  • Object check on SerializationContext::isVisiting() #502
  • Define cdata and namespace for @XmlList elements #480
  • Serializer working with parent class #376
  • Add support for array format #374
  • Obtain VirtualProperty value using a service #359
  • make deserialisation of non existing id's configurable #333
  • HHVM compatibility issue with undefined property JMS\Serializer\Metadata\ClassMetadata::$inline #312
  • resources serialization #275
  • I'm receiving "Class ArrayCollection does not exist" when serializing (temporarily solved with a workaround) #274
  • Can't use handlers on strings (and other simple types) #194
  • composer.json update for doctrine #178
  • Use expression for virtual properties #171
  • Handle classes that implement collections (e.g. ArrayObject) and properties #137
  • Check CDATA is needed #136
  • property path support #22

Merged pull requests:

serializer - 1.5.0 stable

Published by goetas over 7 years ago

The main feature included in the 1.5.0 release is the expression language exclusion policy implemented with #673.

Here a more detailed changelog:

Implemented enhancements:

  • Implemented dynamic exclusion using symfony expression language #673 (goetas)
  • added support for xml-attributes as discriminators #692 (twtinteractive)
  • Prevent doctrine proxy loading for virtual types #684 (goetas)

Fixed bugs:

  • Deserializing XMLList with Namespaces not (always) working as intended #697 (goetas)

Merged pull requests:

  • Added doc reference for disabling discriminator #699 (dragosprotung)
  • Use GroupsExclusionStrategy::DEFAULT_GROUP instead default group. #694 (Aliance)
  • Improved Symfony 3.x compatibility #682 (goetas)

Closed issues:

  • Deserializing XMLList with Namespaces not (always) working as intended #695
  • Groups logic #693
  • BC from 1.1.* to ^1.2 #643
  • DoctrineProxySubscriber forces loading of the proxy even if custom handler exist #575
  • ConditionalExpose/Exclude annotation #540
  • Deprecated usage of ValidatorInterface #438
  • Missing addData in XmlSerializerVisitor makes it impossible to add data in serializer.post_serialize event #235
  • Support JSON PATCH for updating object graph #231
  • Dynamic expose, aka 'fields' query param #195
serializer - 1.5.0-RC1 release candidate

Published by goetas almost 8 years ago

The 1.5.0 release is going to be one of the most important releases till now for the 1.x series of the JMS serializer.

The main feature included in the 1.5.0 release is the expression language exclusion policy implemented with #673.

Here a more detailed changelog:

Implemented enhancements:

  • Implemented dynamic exclusion using symfony expression language #673 (goetas)
  • added support for xml-attributes as discriminators #692 (twtinteractive)
  • Prevent doctrine proxy loading for virtual types #684 (goetas)

Fixed bugs:

  • Deserializing XMLList with Namespaces not (always) working as intended #697 (goetas)

Merged pull requests:

  • Added doc reference for disabling discriminator #699 (dragosprotung)
  • Use GroupsExclusionStrategy::DEFAULT_GROUP instead default group. #694 (Aliance)
  • Improved Symfony 3.x compatibility #682 (goetas)

Closed issues:

  • Deserializing XMLList with Namespaces not (always) working as intended #695
  • Groups logic #693
  • BC from 1.1.* to ^1.2 #643
  • DoctrineProxySubscriber forces loading of the proxy even if custom handler exist #575
  • ConditionalExpose/Exclude annotation #540
  • Deprecated usage of ValidatorInterface #438
  • Missing addData in XmlSerializerVisitor makes it impossible to add data in serializer.post_serialize event #235
  • Support JSON PATCH for updating object graph #231
  • Dynamic expose, aka 'fields' query param #195

A stable 1.5.0 will be tagged in 3 weeks

serializer - 2016-11-02

Published by goetas almost 8 years ago

serializer - v1.4.1 (2016-11-02)

Published by goetas almost 8 years ago

Fixed https://github.com/schmittjoh/serializer/issues/668 that creates some issues with nelmio apidoc and in general when trying to use group based exclusion strategies without a properly initialized context

serializer - v1.4.0 (2016-10-31)

Published by goetas almost 8 years ago

  • Xml setters ignored when deserializing #665 (goetas)
  • Document the implied 'Default' property group when no group is specified #661 (akoebbe)
  • Nullable array inconsistency #660 (goetas)
  • Allow discriminator map in the middle of the hierarchy when deserializing #659 (goetas)
  • Fixed PHP 7.0.11 BC break (or bugfix) #658 (goetas)
  • Handle both int and integer #657 (Aliance)
  • Renamed replaceData to setData #653 (goetas)
  • add required sqlite extension for developing #649 (scasei)
  • Run serialization benchmarks in the build process #647 (goetas)
  • Alcalyn feature default serializer context #645 (goetas)
  • Add format output option #640 (AyrtonRicardo)
  • Remove deprecated FileCacheReader for doctrine annotations #634 (goetas)
  • Added tests to ensure SerializeNull policy #633 (goetas)
  • Fix inheritance of discriminators on Doctrine entities #382 (xoob)
  • Allow Post Serialize Event to overwrite existing data #273 (jockri)
serializer - Added "hasData" on generic seialization visitors and other minor bugfixes

Published by goetas about 8 years ago

serializer - HHVM & PHP7 support XML features, bugfixes and infrastructure improvements

Published by goetas about 8 years ago

This release includes many improvements and bugfixes, some of them are:
#580 HHVM compatibility
#301 Generate namespaced element on XmlList entries
#595 Fix xml-attribute-map for the xml driver
#611 Allow to not skip empty not inline array root node
#610 Allow to use custom serializer with primitive type
#397 Exclude annotation not preventing attempt to find public methods when using AccessType
#608 Composer is not able to resolve a dependency
#550 Generic way to solve setValue on a property which respects its setter
#584 Test on Travis always high and low deps
#583 Update Symfony validator and allow PHPUnit 7
#399 Added travis-ci label
#553 [doc] fix AccessorOrder documentation
#578 Fixed test suite on master
#577 Fix for a broken test: a missing (incorrectly positioned) argument

serializer - Some Yaml Fixes & Improved Twig Support

Published by schmittjoh almost 9 years ago

This release improves Twig support and fixes a bug in Yaml serialization.

serializer - Further Compatibility Updates and Bug Fixes

Published by schmittjoh over 9 years ago

This release contains updates for newer PHP versions, and also fixes a few edge-cases. Notable in this release:

  • adds convenience toArray and fromArray methods to the Serializer
  • better handling of polymorphic objects in collections
  • fixes some bugs in the YAML metadata format
Package Rankings
Top 0.12% on Packagist.org
Badges
Extracted from project README
GitHub Actions Packagist