symfony - JMSSerializerBundle AccessorOrder custom ignored -
i'm trying order serialized output data using jmsserializerbundle annotation. got this:
use jms\serializer\annotation\accessororder; /** * @orm\entity(repositoryclass="appbundle\entity\customerrepository") * @exclusionpolicy("all") * @accessororder("custom", custom = {"custom_id", "company_name", "first_name", "last_name", "email", "phone_number", * "line1", "line2", "line3", "city", "state", "postal_code", "country_code", "created_at"}) */ /** * @orm\entity(repositoryclass="appbundle\entity\customerrepository") * @exclusionpolicy("all") * @accessororder("custom", custom = {"custom_id", "company_name", "first_name", "last_name", "email", "phone_number", * "line1", "line2", "line3", "city", "state", "postal_code", "country_code", "created_at"}) */ class customer { /** * @var string * @expose */ private $first_name; /** * @var string * @expose */ private $last_name; /** * @var string * @expose */ private $email; /** * @var string * @expose */ private $phone_number; /** * @var string * @expose */ private $company_name; /** * @var string * @expose */ private $line1; /** * @var string * @expose */ private $line2; /** * @var string * @expose */ private $line3; /** * @var string * @expose */ private $city; /** * @var string * @expose */ private $state; /** * @var string * @expose */ private $postal_code; /** * @var string * @expose */ private $country_code; /** * @var \datetime * @expose */ private $created_at; /** * @var string * @expose * @serializedname("id") */ private $customer_id; }
and when made request, this:
{ "id": "edf007d651855ab64f9c", "state": "guanajuato", "created_at": "2015-09-17t12:42:21-0500", "company_name": "foograde", "line1": "gral. ortega #223d", "first_name": "federico", "city": "celaya", "postal_code": "38010", "last_name": "mata", "email": "federico.balderas@foograde.com", "country_code": "mx", "line2": "col. alameda" }
any idea of i'm doing wrong?
it seems problem cocoarestcliente response, postman response correct.
Comments
Post a Comment