From 78e819443bef6088d2aebb2a7ef2182807f8f91c Mon Sep 17 00:00:00 2001 From: Joshua Benning Date: Mon, 22 Jun 2026 15:54:45 +0200 Subject: [PATCH] adapter.json: Tighten `dataSpecification` ref type Previously, JSON deserialization accepted both `ModelReference` and `ExternalReference` for the `dataSpecification` field of `EmbeddedDataSpecification`. As the spec (constraint AASc-3a-050) requires `EmbeddedDataSpecification.dataSpecification` to be an `ExternalReference`, JSON deserialization was tightened to only accept `ExternalReference`. It now matches the requirement and the current behavior of XML deserialization. Fixes #567 --- sdk/basyx/aas/adapter/json/json_deserialization.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdk/basyx/aas/adapter/json/json_deserialization.py b/sdk/basyx/aas/adapter/json/json_deserialization.py index 79db2a56..4d4cdb32 100644 --- a/sdk/basyx/aas/adapter/json/json_deserialization.py +++ b/sdk/basyx/aas/adapter/json/json_deserialization.py @@ -278,7 +278,8 @@ def _amend_abstract_attributes(cls, obj: object, dct: Dict[str, object]) -> None # TODO: remove the following type: ignore comment when mypy supports abstract types for Type[T] # see https://github.com/python/mypy/issues/5374 model.EmbeddedDataSpecification( - data_specification=cls._construct_reference(_get_ts(dspec, 'dataSpecification', dict)), + data_specification=cls._construct_external_reference( + _get_ts(dspec, 'dataSpecification', dict)), data_specification_content=_get_ts(dspec, 'dataSpecificationContent', model.DataSpecificationContent) # type: ignore )