Questions tagged [jms-serializer]

Serializer is a library, that allows you to (de-)serialize data of any complexity. It supports XML, JSON, and YAML.

Serializer is a library, that allows you to (de-)serialize data of any complexity. Currently, it supports XML, JSON, and YAML.

Website: http://jmsyst.com/libs/serializer

It also provides you with a rich tool-set to adapt the output to your specific needs.

Built-in features include:

  • (De-)serialize data of any complexity; circular references are handled gracefully.
  • Supports many built-in PHP types (such as dates)
  • Integrates with Doctrine ORM, et. al.
  • Supports versioning, e.g. for APIs
  • Configurable via PHP, XML, YAML, or Doctrine Annotations
222 questions
3
votes
0 answers

JMS error : Error while deserialising an object

Getting Following strange exception weblogic.jms.commom.JMSException:[JMSClientExceptions:055115]Error deserialising an object Caused by: java.lang.ClassNotFoundException: com.my.TestClass To my surprise , this is not happening for all…
Balaji Reddy
  • 5,576
  • 3
  • 36
  • 47
3
votes
1 answer

How can I remove proxies field in symfony json

I want to remove proxies fields like __initializer__: null,__cloner__: null, __isInitialized__: true, from my returned json but I have no idea. I dont want to use * @Serializer\Exclude() because there are some more fields next to those fields. here…
3
votes
3 answers

Unable to override JMS Serializer's default handler for Symfony ConstraintViolationList

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. And tagged it correctly as described in the…
dnshio
  • 914
  • 1
  • 8
  • 21
3
votes
3 answers

How to handle recursive objects with JMS Serializer

I am trying to serialize and deserialize a Doctrine object graph. The structure is pretty complex, but this example sums up my problem: There is a Company entity with a OneToMany relationship to Employee. The Employee entity has a ManyToOne…
Dennis Haarbrink
  • 3,738
  • 1
  • 27
  • 54
3
votes
1 answer

How to serialize slice of ArrayCollection using JMS Serializer?

I want to serialize into JSON entity Category with collection of Presentation entities (see below) to use for REST API. The endpoint will look something like this /api/v1/categories/1 When dataset is small and when Category only has only 5-10…
Dimitry K
  • 2,236
  • 1
  • 28
  • 37
3
votes
0 answers

Use JMSSerializer groups to serialize object with or without the inline option

I'd like to have two different representations for the same entity using the PHP library JMSSerializer, which can easily be achieved by its groups feature. The problem is that I have one representation where the properties of a sub object are…
Daniel Rotter
  • 1,998
  • 2
  • 16
  • 33
3
votes
1 answer

How to Initialize JMS Serializer in Symfony3?

I am trying to use the JMSSerializerBundle for Symfony3 (which just came out). These are the namespaces I've loaded in my TestController.php use JMS\Serializer\Serializer; use JMS\Serializer\SerializerBuilder; use…
TrieuNomad
  • 1,651
  • 1
  • 21
  • 24
3
votes
3 answers

FOSElastica why my result is not serialized?

I have configured FOSElasticaBundle as follow: fos_elastica: clients: default: { host: %elasticsearch_host%, port: %elasticsearch_port% } serializer: ~ indexes: app: types: tags: …
vardius
  • 6,326
  • 8
  • 52
  • 97
3
votes
1 answer

Add dynamic property on entity to be serialized

I have this REST API. Whenever request comes to get a resource by id ( /resource/{id}) I want to add a permissions array on that object on the fly (entity itself does not have that field). What I came up with is this event listener. It checks the…
andrius.k
  • 799
  • 1
  • 10
  • 26
3
votes
0 answers

change xml format of JMSSerializer

I have an array like this: $a = array("test" => array("foo" => "bar") ); By serilizing it as xml, I expected to get something like: bar But I get:
user4271704
  • 723
  • 1
  • 12
  • 37
3
votes
2 answers

How to achieve model side-loading with JMS Serializer and Symfony2

I'm building a project with Ember.js and Ember-data for the UI and Symfony2, FOSRestBundle and JMS Serializer for the backend JSON API. JMS Serializer always embeds nested models in its output, but Ember-data requires that the models are…
2
votes
3 answers

Automatically implementing JMS serialization for many php backed enums

Context By using the JMS serializer library, I need to serialize/unserialize data which are internally represented by php backed enums. What's the problem I found a solution by using the SubscribingHandlerInterface interface, but I would like to…
yolenoyer
  • 8,797
  • 2
  • 27
  • 61
2
votes
0 answers

Is it possible to create a group dependency in JMS

Lets say I have following structure: Article: name content galleries: array of Gallery Gallery: name description media : array of Media thumbnail: Media Media: name file Now when I am serializing The article or something that contains a…
HubertNNN
  • 1,727
  • 1
  • 14
  • 29
2
votes
0 answers

How to specify several object type within single property using Swagger and/or JMS serializer?

I use Swagger and JMS serializer and show built OpenAPI JSON using NelmioAPIDocBundle https://github.com/nelmio/NelmioApiDocBundle I have an object with a property, which is an array, that might include several different type of another objects that…
ambrous
  • 194
  • 2
  • 11
2
votes
1 answer

Deserialize XML element which could have different namespaces

I'm trying to get element from XML under one variable, where I'm having the same xml tree, but with another xml namespace prefix. I've got a lot similar elements, and that would be annoying to write 3x the same classes or elements and validating if…
LubasQ
  • 21
  • 1
1 2
3
14 15