I have an Rest API built on Symfony 2.7 Framework with FOSRestBundle and JMSSerializerBundle. I have a look to yml reference and annotations.
I have choosen to define how each entity of my model is serialized with yml.
I have seen that we can serialize Datetime
object on a specific format :
@JMS\Type("DateTime<'d-m-Y'>")
But I don't know the correct syntax used with yml definition, I have tried :
my_field:
expose: true
type: datetime
format: 'd-m-Y'
And
my_field:
expose: true
type: datetime<'d-m-Y'>
I don't want to use Annotations
because I have a lot of yaml files.
But the field is not serialized...
Anyone can help me ?
type: "DateTime<'d-m-Y'>"
ortype: "DateTime('d-m-Y')"
– DollhouseDateTime<'d-m-Y'>
, thanks for the help ! – Luigi