Skip to content

model.datatypes: UnsignedInt mapped to wrong XSD name, UnsignedByte missing from XSD_TYPE_NAMES #560

@s-heppner

Description

@s-heppner

Currently, XSD_TYPE_NAMES in basyx/aas/model/datatypes.py contains a typo and a missing entry:

  • UnsignedInt is mapped to "unsignedByte" instead of "unsignedInt"
  • UnsignedByte has no entry at all

Because XSD_TYPE_CLASSES is generated as the inverse of XSD_TYPE_NAMES, this produces three concrete failures:

  • XSD_TYPE_CLASSES["xs:unsignedInt"] is absent → deserializing any Extension, Property, Qualifier, etc. with valueType: xs:unsignedInt raises a KeyError
  • XSD_TYPE_CLASSES["xs:unsignedByte"] returns UnsignedInt instead of UnsignedByte → silent wrong-class deserialization
  • XSD_TYPE_NAMES[UnsignedByte] raises a KeyError → serialization of UnsignedByte values is also broken

Both the JSON adapter (json_deserialization.py) and XML adapter (xml_deserialization.py) look up valueType strings through XSD_TYPE_CLASSES, so both serialization formats are affected.

The AAS spec (IDTA-01001), aas.json, and AAS.xsd all define xs:unsignedInt (32-bit, 0–4 294 967 295) and xs:unsignedByte (8-bit, 0–255) as distinct, valid data types.

Fix: in basyx/aas/model/datatypes.py, replace:

UnsignedInt: "unsignedByte",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsdkSomething to do with the `sdk` package

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions