eclipse-aas4j / aas4j

Eclipse AAS Model for Java
Apache License 2.0
40 stars 27 forks source link

AASX XML generated with jackson 2.13.* is invalid #27

Closed sebbader closed 1 year ago

sebbader commented 2 years ago

from https://github.com/admin-shell-io/java-serializer/issues/66:

" Using the AASX XML generator with jackson-dataformat-xml versions 2.13.* results in invalid XML.

The deepest child elements are not prefixed. Here is the generated XML with version jackson-dataformat-xml 2.13.3

<?xml version='1.0' encoding='UTF-8'?>
<aas:aasenv xmlns:aas="http://www.admin-shell.io/aas/3/0" xmlns:IEC61360="http://www.admin-shell.io/IEC61360/3/0" xmlns:abac="http://www.admin-shell.io/aas/abac/3/0" xmlns:aas_common="http://www.admin-shell.io/aas_common/3/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.admin-shell.io/aas/3/0 AAS.xsd http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd http://www.admin-shell.io/aas/abac/3/0 AAS_ABAC.xsd">
    <aas:assetAdministrationShells>
        <aas:assetAdministrationShell>
            <idShort>defaultAdminShell</idShort>  <!-- missing prefix is here! -->
        </aas:assetAdministrationShell>
    </aas:assetAdministrationShells>
    <aas:assets>
        <aas:asset>
            <idShort>defaultAsset</idShort> <!-- missing prefix is here! -->
        </aas:asset>
    </aas:assets>
......

Here is the generated XML with version jackson-dataformat-xml 2.12.7:

<?xml version='1.0' encoding='UTF-8'?>
<aas:aasenv xmlns:aas="http://www.admin-shell.io/aas/3/0" xmlns:IEC61360="http://www.admin-shell.io/IEC61360/3/0" xmlns:abac="http://www.admin-shell.io/aas/abac/3/0" xmlns:aas_common="http://www.admin-shell.io/aas_common/3/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.admin-shell.io/aas/3/0 AAS.xsd http://www.admin-shell.io/IEC61360/3/0 IEC61360.xsd http://www.admin-shell.io/aas/abac/3/0 AAS_ABAC.xsd">
    <aas:assetAdministrationShells>
        <aas:assetAdministrationShell>
            <aas:idShort>defaultAdminShell</aas:idShort> <!-- prefixes are set correctly -->
        </aas:assetAdministrationShell>
    </aas:assetAdministrationShells>
    <aas:assets>
        <aas:asset>
            <aas:idShort>defaultAsset</aas:idShort> <!-- prefixes are set correctly -->
        </aas:asset>
    </aas:assets>

We detected this issue after an upgrade of Spring Boot that depends on Jackson 2.13.3. "

andreas-schilling commented 1 year ago

Also stumbled upon this. Is this really an issue due to the jackson update? Or is it rather because the used mixins do not cover all child elements and thus do not define the namespaces?