serializer: XmlList(skipWhenEmpty=true) or @SkipWhenEmpty() does not work
Hello,
I am trying to deserializer an arraycollection, however this attribute is optional, but the following error occurs: “Warning: JMS \ Serializer \ XmlDeserializationVisitor :: visitProperty (): Node no longer exists”
namespace Presentation\DataTransferObject;
use Doctrine\Common\Collections\ArrayCollection;
use JMS\Serializer\Annotation as A;
use Presentation\DataTransferObject\ListTest;
/**
* @A\XmlRoot("Test")
*/
class Test
{
/**
* @var ListTest
* @A\Type("ArrayCollection<Presentation\DataTransferObject\ListTest>")
* @A\SkipWhenEmpty()
* @A\XmlList(skipWhenEmpty=true,entry = "Presentation\DataTransferObject\ListTest")
*/
private $ListTest;
}
Is there any way to when it is empty, it does not deserialize?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18
@SerializedName
@XmlList
thenamespace
propertyentry="child::*"
is not valid, please put the node nameto higlight the code you can use
more info on https://help.github.com/articles/creating-and-highlighting-code-blocks/