Skip to content

[2.0]XML schema validation seems too strict #2095

@etshy

Description

@etshy

BC Break Report

Q A
BC Break yes
Version 2.0.1

Summary/Reproduce

  • Update my composer.json to use 2.0 (ODM bundle 4.0)
  • run composer update
  • XML Schema validation throw an exception about this line
        <field name="slug" type="string">
            <gedmo:slug unique="true" fields="name" updatable="true"/>
        </field>

I think it comes from the gedmo line to add the slug behavior.
The thing is it's impossible to add a content element from another .xsd (from the xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping" in this case).
I tried for another issue about xsd few months ago.
So, this issued can't be resolved in the gedmo repo.

I don't know if it's possible, but maybe the validation should be less strict ?

Previous behavior

There wasn't any error about that line in previous versions

Current behavior

throw XML schama validation exception during composer update

File

I paste here my whole xml mapping file, if that could help

<?xml version="1.0" encoding="UTF-8"?>
<doctrine-mongo-mapping xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping"
                        xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
                        xsi:schemaLocation="http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping
                http://doctrine-project.org/schemas/odm/doctrine-mongo-mapping.xsd">
    <document name="App\Model\Persistence\Series" repository-class="App\Model\ODM\Repository\SeriesRepository">
        <field name="name" type="string"/>
        <field name="additionalNames" type="string"/>
        <field name="slug" type="string">
            <gedmo:slug unique="true" fields="name" updatable="true"/>
        </field>
        <field name="author" type="string"/>
        <field name="artist" type="string"/>
        <field name="description" type="string"/>
        <field name="adult" type="bool"/>
        <field name="visible" type="bool"/>
        <field name="customTitle" type="string"/>

        <embed-one field="readerSettings" target-document="App\Model\Persistence\ReaderSettings">
        </embed-one>
        <reference-one field="image" target-document="App\Model\Persistence\Files\Image" store-as="ref">
        </reference-one>
        <reference-many field="chapters" target-document="App\Model\Persistence\Chapter" mapped-by="series"
                        strategy="atomicSetArray" store-as="ref">
        </reference-many>
        <reference-many field="teams" target-document="App\Model\Persistence\Team" mapped-by="teams"
                        strategy="atomicSetArray" store-as="ref">
            <sort>
                <sort field="name" order="asc"/>
            </sort>
        </reference-many>

    </document>
</doctrine-mongo-mapping>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions