0

Using JMS Serializer I need to get self closing tag setting empty string

<logout/>

I always get

<logout></logout>

I can't use

->setSerializeNull(true)

because the class I'm serializing has many properties that if they are null they can't be serialized

Any idea how to get it done ?

Unamata Sanatarai
  • 6,475
  • 3
  • 29
  • 51
mysiar
  • 430
  • 1
  • 5
  • 14
  • It is odd, as it behaves like LIBXML_NOEMPTYTAG was set, but this option is not set when \DOMDocument::saveXML is invoked (at least in current version). Which version of JMSSerializer are you using? – Eloar Aug 21 '17 at 21:14
  • 1
    jms/serializer 1.8.1 The only reason I wanted to achieve it was that provider I was sending requests was failing. The only change in the request was this tag difference. At the end it appeared that logout command doesn't work at all despite this tag formatting. This is not the issue anymore. – mysiar Aug 24 '17 at 12:02

0 Answers0