admin-shell-io / java-serializer

AAS model serializer in Java
Other
8 stars 14 forks source link

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

Closed fmisir closed 2 years ago

fmisir commented 2 years ago

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.

sebbader commented 2 years ago

@fmisir thanks for reporting this issue! I have opened a new one in the new eclipse repository: https://github.com/eclipse-digitaltwin/aas4j/issues/27 I will close this one as the fix and any additional work will happen there.