I have some trouble with JMS Serializer - I need to deserialize a XML but i have an exception.
For example, for the xml
<test><name>Test</name></test>
I'm doing :
$xml = $paramFetcher->get('xml');
$serializer = SerializerBuilder::create()->build();
$serializer->deserialize($stack, MyObject::class, 'xml');
And with that, JMS return :
<exception class="JMS\Parser\SyntaxErrorException" message="Expected end of input, but got ">" of type T_CLOSE_BRACKET at position 37 (0-based).">
at JMS\Serializer\Serializer->deserialize('<test><name>Test</name></test>', 'MyObject::class', 'xml')
The XML is sent in POST 'form-data' with other RequestParam.
jms/serializer-bundle 2.4.2
Foo\BarBundle\Entity\MyObject
instead ofMyObject::class
– john Smith$serializer->serialize($testObject,"xml")
so you can see what jms expects for deserialisation, all the propertynames and types must match – john Smith$serializer->deserialize($stack,'AppBundle\Model\MyObject', 'xml');
but i have the same problem – Hussein