We are storing to database FQCN to later use them to know which class the Entity has to be casted to through a Discriminator map.
We found out the problem updating to newer version of Doctrine which changed the default value of $isXsdValidationEnabled to true.
Actually, the attribute value of discriminator-mapping is set as XS:NMTOKEN in the XSD schema
Allow FQCN in value attribute of discriminator-mapping (or just loosen the type validation)
Current behavior
An exception is thrown when the XML is validated against the XSD configuration.
Doctrine\ORM\Mapping\MappingException: libxml error: Element '{http://doctrine-project.org/schemas/orm/doctrine-mapping}discriminator-mapping', attribute 'value': 'App\Core\Part\Domain\Model\Part' is not a valid value of the atomic type 'xs:NMTOKEN'.
in /src/Common/Infrastructure/Persistence/Doctrine/XmlMetadata/App.Core.EntityVersioning.Domain.Model.EntityVersion.dcm.xml at line 6
libxml error: Element '{http://doctrine-project.org/schemas/orm/doctrine-mapping}discriminator-mapping', attribute 'value': 'App\Core\Card\Domain\Model\Card' is not a valid value of the atomic type 'xs:NMTOKEN'.
in /src/Common/Infrastructure/Persistence/Doctrine/XmlMetadata/App.Core.EntityVersioning.Domain.Model.EntityVersion.dcm.xml at line 7
How to reproduce
Just write a backslash, or FQCN, inside the attribute "value" of a discriminator mapping field and let it be validated against XSD schema
Bug Report
We are storing to database FQCN to later use them to know which class the Entity has to be casted to through a Discriminator map. We found out the problem updating to newer version of Doctrine which changed the default value of
$isXsdValidationEnabled
to true. Actually, the attributevalue
ofdiscriminator-mapping
is set as XS:NMTOKEN in the XSD schemaOur XML Configuration of the entity:
Found out this related issue: https://github.com/doctrine/orm/issues/10627
Summary
Allow FQCN in value attribute of discriminator-mapping (or just loosen the type validation)
Current behavior
An exception is thrown when the XML is validated against the XSD configuration.
How to reproduce
Just write a backslash, or FQCN, inside the attribute "value" of a discriminator mapping field and let it be validated against XSD schema
Expected behavior
No exception to be thrown