Currently, _construct_value_reference_pair in basyx/aas/adapter/json/json_deserialization.py (line 429) uses the mandatory _get_ts(dct, 'valueId', dict) to read valueId. This raises a KeyError whenever a ValueReferencePair object in JSON does not include a valueId key, making it impossible to deserialize any such object.
valueId is optional (cardinality 0..1) in ValueReferencePair according to:
- IDTA-01003-a (IEC 61360 data specification template), section "Value Reference Pair Attributes":
valueId has cardinality 0..1,
and the spec note reads "if the valueId is defined as well, then the value needs to be consistent…", explicitly framing it as optional.
aas.json (JSON schema): the required array for ValueReferencePair contains only "value" — valueId is absent.
model/base.py: ValueReferencePair.__init__ declares value_id: Optional[Reference] = None.
A ValueReferencePair without valueId is therefore fully spec-conformant and must deserialize without error.
When fixing this, please also check if the XML deserializer has the same bug.
Currently,
_construct_value_reference_pairinbasyx/aas/adapter/json/json_deserialization.py(line 429) uses the mandatory_get_ts(dct, 'valueId', dict)to readvalueId. This raises aKeyErrorwhenever aValueReferencePairobject in JSON does not include avalueIdkey, making it impossible to deserialize any such object.valueIdis optional (cardinality0..1) inValueReferencePairaccording to:valueIdhas cardinality0..1,and the spec note reads "if the valueId is defined as well, then the value needs to be consistent…", explicitly framing it as optional.
aas.json(JSON schema): therequiredarray forValueReferencePaircontains only"value"—valueIdis absent.model/base.py:ValueReferencePair.__init__declaresvalue_id: Optional[Reference] = None.A
ValueReferencePairwithoutvalueIdis therefore fully spec-conformant and must deserialize without error.When fixing this, please also check if the XML deserializer has the same bug.