-
Notifications
You must be signed in to change notification settings - Fork 519
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
XSD schema for XML mapping #1334
Conversation
Excuse the clumsiness while typing on the recording, but here is an example of autocomplete using the XSD schema on PhpStorm: https://share.cleanshot.com/wrDBOU |
Just another little doubt: should we update the docs as well? |
sorry, I was out on holidays. I'll update the XML in the docs as well, so users know they can benefit from the schema. |
show schema in use
@@ -6,7 +6,8 @@ format and comes with the following syntax to declare your uploadable fields: | |||
```xml | |||
<!-- config/vich_uploader/Entity.Product.xml --> | |||
<!-- Attributes "mapping", "name" and "filename_property" are required --> | |||
<vich_uploader class="Acme\DemoBundle\Entity\Product"> | |||
<vich_uploader xmlns="https://vich-uploader-bundle/schema/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I know that the "xmlns" attribute is not required to be a reachable URL, but I'm wondering how can the IDE understand where it's located (and so providing autocompletion). Could you clarify that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least on phpstorm, if the file is within the project directories it will be picked up automatically.
Thank you @yivi |
Provides an XSD schema so that creating XML mapping is easier, since IDE can use it for autocompletion
Improvement
Summary
Creating an XML document without an associated XSD schema is error prone. With the provided XSD schema, IDEs can provide autocompletion, and XML files can be validated.