I have a Restore API based on Symfony 2.7 Framework with FOSRestBundle and JMSSerializerBundle . I look at yml reference and annotations .
I decided to determine how each object in my model is serialized using yml .
I saw that we can serialize a Datetime object in a specific format:
@JMS\Type("DateTime<'dm-Y'>")
But I do not know the correct syntax used with the yml definition , I tried:
my_field: expose: true type: datetime format: 'dmY'
AND
my_field: expose: true type: datetime<'dm-Y'>
I do not want to use Annotations because I have many yaml files.
But the field is not serialized ...
Can anybody help me?
source share