I have a custom operation that, once called, performs some more tasks than simply adding an entity.
The result of these operations is the creation of a new entity that is then persisted in the database.
Now, as a return value I'm currently using the IRI of the just created entity.
I generate the IRI using \ApiPlatform\Core\Api\IriConverterInterface.
This approach works but has a drawback: in the frontend I have to issue a new call to retrieve the data of the just created entity.
To avoid this call, I'd like to simply return the entity in the JSON format, but I don't find a way to immediately serialize it to return it.
In practice: I currently return simply the IRI of the entity: how can I return the fully serialized entity, according to its serialization configuration?