Summary
Severity: Medium
File: sdk/basyx/aas/adapter/json/json_deserialization.py:514-515
Description
The JSON deserializer assigns value_id on DataSpecificationIEC61360, but this attribute does not exist on the model class. Python silently accepts the dynamic assignment, but the serializer never writes it back, so valueId is lost on every round-trip.
if 'valueId' in dct:
ret.value_id = cls._construct_reference(_get_ts(dct, 'valueId', dict))
DataSpecificationIEC61360 (defined at model/base.py:2393) has no value_id attribute. Python allows dynamic attribute assignment, so this silently adds an untyped attribute that is never written back by the JSON serializer (json_serialization.py:342-376 has no value_id output). On any round-trip, valueId from input JSON is lost.
Fix
Two options:
- (a) Add
value_id: Optional[Reference] to the DataSpecificationIEC61360 model class and serialize it.
- (b) Remove the dead deserialization code if the AAS spec does not include this field for IEC61360 data specs.
Summary
Severity: Medium
File:
sdk/basyx/aas/adapter/json/json_deserialization.py:514-515Description
The JSON deserializer assigns
value_idonDataSpecificationIEC61360, but this attribute does not exist on the model class. Python silently accepts the dynamic assignment, but the serializer never writes it back, sovalueIdis lost on every round-trip.DataSpecificationIEC61360(defined atmodel/base.py:2393) has novalue_idattribute. Python allows dynamic attribute assignment, so this silently adds an untyped attribute that is never written back by the JSON serializer (json_serialization.py:342-376has novalue_idoutput). On any round-trip,valueIdfrom input JSON is lost.Fix
Two options:
value_id: Optional[Reference]to theDataSpecificationIEC61360model class and serialize it.