Category: serialization

API Platform Serialization issue for custom Output

I have created this resource in order to request a password reset token: POST {{api_base_url}}/users/password/reset-request Payload example { “email” :”[email protected]” } Everything works fine but the response doesn’t serialize ResetPasswordRequestOutput to show the result. I got this response instead (as…

Serializing entiy with property referencing an entity of the same type?

I have an entity that has a property that points to another object of the same type. E.g. duplicatedFrom. The entity is something like this: class Foo { private string $id; private string $name; private string $content; private ?Foo duplicatedFrom;…

How to list all defined serializer groups, and related settings?

How can I retrieve a list of all defined Serializer groups (and related settings, like “serialized_name” or “max_depth”)? These can be defined via annotations, XML, or YAML; but it’s rather clumsy having to check all the different files; I’d like…

How to convert Serializer annotations to YML or XML configuration?

We’ve been tasked with converting all the serialization annotations in our classes to dedicated configuration classes. There are a few dozen classes in this application, with at around 20 of them with custom annotations for the serializer (with the rest…