core icon indicating copy to clipboard operation
core copied to clipboard

fix: support empty array as object

Open alanpoulain opened this issue 3 years ago • 0 comments

Supersedes https://github.com/api-platform/core/pull/4363.

Fixes an issue with the use of EMPTY_ARRAY_AS_OBJECT and PRESERVE_EMPTY_OBJECTS in the serialization context.

Since the Hydra CollectionNormalizer was taking over the serialization of all iterables for the JSON-LD format, the Symfony serializer was not called when normalizing a "raw" collection.

Adding a better supports method fixes the issue.

alanpoulain avatar Sep 22 '22 10:09 alanpoulain