Magento 2 XML – Resolve ‘Array’ Type Definition in DI.xml

dependency-injectionmagento2xml

Im new in magento 2. using DI.xml I'm creating a price adjustment. Weird to find that argument -> inside arguments is displayed in red with error cannot resolve 'array' to a type definition for element 'argument'.

any idea if it changed in the last release?.

enter image description here

UPDATE————————————————————–
I realized in C:\Zend\Apache2\htdocs\magento2\lib\internal\Magento\Framework\ObjectManager\etc\config.xsd is not defined. error says 'URI is not registered'

Best Answer

In Magento2 2.0.0, it change xml schema validation. It using URN schema validation.

You can read more at http://devdocs.magento.com/guides/v2.0/extension-dev-guide/XSD-XML-validation.html

You have to create my own config file with it's own validation schema?

You can read at Magento 2 custom xml schema validation

In di.xml file, you need change to:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
....
<config>
Related Topic