jmsserializerbundle Questions

2

Solved

I want to deserialize something like this: [ { "id": 42 }, { "id": 43 } ] Any idea how to do this?
Hydric asked 11/6, 2017 at 8:53

3

I am unable to override default handlers in jms serializer bundle. I'd like to change the way Symfony\Component\Validator\ConstraintViolationList is serialized so I wrote my own custom handler. An...

2

Solved

I am getting this message: Invalid datetime "2017-11-07T19:46:57.118Z", expected format Y-m-d\\TH:i:sP. When using JMS Serializer and the config: jms_serializer: handlers: datetime: default_...
Naphthalene asked 7/11, 2017 at 14:50

6

Solved

I have a json object that I received by making a get API call. I make this call to receive a list of objects. It's a list of post... So I have an array of Post Objects. Here the output : { "tot...
Birdcage asked 14/4, 2014 at 3:38

5

I'm using FOS Rest bundle and JMS Serializer to create a REST Api. The problem is I would like to keep the property names in the JSON response camel cased instead of using _. For example, I have a...
Tilsit asked 20/4, 2017 at 20:26

1

I have a Doctrine entity and I use JMS serializer to render it in my API. I'd like to add a boolean field like this : /** * @var bool * * @ORM\Column(name = "is_serialized", type = "boolean") ...
Carsoncarstensz asked 6/3, 2017 at 9:23

2

Solved

Why are new entities instantiated with null for all values except the data in the json, why is the entity constructor not setting defaults - putting a die() in the constructor never gets executed. ...
Hophead asked 11/8, 2015 at 17:21

3

I have a problem with serializing entity with many relations using groups. I have a problem with serializing related entities this way. Let's say I have two entities: Product and related Element....
Kershner asked 5/10, 2012 at 12:39

6

Solved

I've an entity I usually serialize using the JMS Serializer bundle. I have to add to the serialization some fields that doesn't reside in the entity itself but are gathered with some db queries. M...
Lissner asked 21/2, 2013 at 16:25

2

When trying to serialize a model that uses traits, JMSSerializer does not serialize properties included by that trait. I am using yaml to configure the serializer but it seems that it's not working...
Withers asked 14/11, 2014 at 17:59

6

Solved

I'm trying to serialize a entity relation with JMS Serializer. Here is the Entity: class Ad { /** * @Type("string") * @Groups({"manage"}) * * @var string */ private $description; /** ...
Deneb asked 13/4, 2013 at 22:19

6

Solved

I am attempting to use JMSSerializer as a stand alone library to map JSON responses from an API to my model classes and am running into some issues. Executing the following code results in an exce...
Licha asked 31/1, 2013 at 15:20

2

Solved

I read this article about overriding groups of child properties: use JMS\Serializer\SerializationContext; $context = SerializationContext::create()->setGroups(array( 'Default', // Serialize Jo...
Guthry asked 22/9, 2017 at 14:35

1

Solved

I have a Symfony rest api build with fos restbundle and I'm deserializing a json PUT request in order to update a doctrine entity with a to-many relation. However, the to-many child objects which a...
Autolysis asked 30/3, 2018 at 11:29

3

Solved

I had a read through this : https://github.com/schmittjoh/serializer/issues/77 but did not find any way to serialize null values in JSON for FOS Rest bundle with JMS serializer (meaning just show t...
Coastline asked 28/5, 2013 at 6:11

4

Solved

I'm using the JMSSerializerBundle to serialize my entity. but I have the following problem: the attribute name is "className" but in my Json object I get a "class_name". this is my entity: /** *...
Systematize asked 29/3, 2014 at 23:53

2

Solved

As far as i understand it right JMSSerializerBundle's deserialisation does the same same as the symfony form component when a controller gets an post/put/patch request? So either i create a symfon...
Stead asked 4/7, 2014 at 10:27

3

Solved

I'm trying to update symfony2/doctrine entities using JMSSerializer with an @ExclusionPolicy:None @Groups Inclusion Policy. * @Serializer\ExclusionPolicy("none") */ class Foo { /** * @Serial...
Harappa asked 13/5, 2013 at 15:32

1

I have Category OneToMany Post association in doctrine2 setup like this: Category: ... /** * @ORM\OneToMany(targetEntity="Post", mappedBy="category") * @Type("ArrayCollection<Platform\BlogBu...

2

Solved

As the title says, I am trying to make a run-time decision on whether or not to include fields in the serialization. In my case, this decision will be based on permissions. I am using Symfony 2, s...
Encasement asked 20/2, 2014 at 18:27

1

i'm using JMSSerializer to deserialize a JSON request and i'm having troubles with ManyToOne relations. I would like to deserialize the relation entity from a id given. Example: Class Game { /**...
Bondman asked 5/2, 2017 at 11:44

1

Solved

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 i...
Luigi asked 10/1, 2017 at 13:12

2

Solved

I have entities in a OneToMany relation: Forecast -> has many -> Brick(s) I've created serialization mappings for each in Resources/config/serializer/Entity.xxx.yml where xxx is entity name. Eac...
Antipodal asked 11/1, 2014 at 21:46

5

Solved

Im using Doctrine 2 ORM in my Zend project and need to serialize my Entities to JSON in several cases. ATM i use the Querybuilder and join all tables i need. But my serializer causes doctrine to l...
Gascony asked 20/7, 2012 at 8:7

2

Solved

I am trying to make a Rest web service using Symfony 3 and FOSRestBundle. I come from a Spring + Jackson background so i'm trying to make it so that you can pass objects to controllers as request b...
Cadmarr asked 29/9, 2016 at 19:16

© 2022 - 2024 — McMap. All rights reserved.