Skip to content

Commit 78e8194

Browse files
committed
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 eclipse-basyx#567
1 parent 65802ea commit 78e8194

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sdk/basyx/aas/adapter/json/json_deserialization.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,8 @@ def _amend_abstract_attributes(cls, obj: object, dct: Dict[str, object]) -> None
278278
# TODO: remove the following type: ignore comment when mypy supports abstract types for Type[T]
279279
# see https://github.com/python/mypy/issues/5374
280280
model.EmbeddedDataSpecification(
281-
data_specification=cls._construct_reference(_get_ts(dspec, 'dataSpecification', dict)),
281+
data_specification=cls._construct_external_reference(
282+
_get_ts(dspec, 'dataSpecification', dict)),
282283
data_specification_content=_get_ts(dspec, 'dataSpecificationContent',
283284
model.DataSpecificationContent) # type: ignore
284285
)

0 commit comments

Comments
 (0)