Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.0]XML schema validation seems too strict #2529

Open
rupeshwankhede opened this issue Apr 20, 2023 · 4 comments
Open

[2.0]XML schema validation seems too strict #2529

rupeshwankhede opened this issue Apr 20, 2023 · 4 comments

Comments

@rupeshwankhede
Copy link

rupeshwankhede commented Apr 20, 2023

BC Break Report

Q A
BC Break yes
Version 2.0.1
--

Summary

After updating version 2.0. Getting exception for below line. It is working on previous version.
XML Schema validation throw an exception about this line

<field field-name="created" type="date" name="created"> <gedmo:timestampable on="create"/> </field>

Previous behavior

There wasn't any error about that line in previous versions. We just return.
if (@$document->schemaValidate(__DIR__ . '/../../../../../../doctrine-mongo-mapping.xsd')) { return; }

Current behavior

In current version throwing exception.
if (! $document->schemaValidate(__DIR__ . '/../../../../../../doctrine-mongo-mapping.xsd')) { throw MappingException::xmlMappingFileInvalid($filename, $this->formatErrors(libxml_get_errors())); }
I don't know if it's possible, but maybe the validation should be less strict same like in ORM.

Refer: #2095

@malarzm
Copy link
Member

malarzm commented Apr 23, 2023

Well, there's still no resolution in doctrine-extensions/DoctrineExtensions#2055 for which we hoped. I believe the only tangible thing we can do is to let users opt-out from the XSD validation, but that's obviously a footgun.

@rupeshwankhede
Copy link
Author

Yeah. Can we do that if it is possible?

@malarzm
Copy link
Member

malarzm commented May 19, 2023

Sure, are you up for the implementation?

@rupeshwankhede
Copy link
Author

@malarzm Can you check PR and let us know if we need to change anything.
https://github.com/doctrine/mongodb-odm/pull/2535/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants