From 9fdcd41fd97a77cfe176b327243f94e3d162235b Mon Sep 17 00:00:00 2001 From: Christian Monch Date: Fri, 16 May 2025 12:08:32 +0200 Subject: [PATCH] fix type instantiation in _normalize_inlined This commit fixes a problem that was discovered while converting between TTL and JSON using the schema https://concepts.inm7.de/s/simpleinput/unreleased.yaml The original code used a dictionary as argument to the constructor of a pydantic-class, when it should have used the **-operator to cnvert the dictionary into keyword arguments. --- linkml_runtime/utils/yamlutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linkml_runtime/utils/yamlutils.py b/linkml_runtime/utils/yamlutils.py index 8ca8b309..d3090914 100644 --- a/linkml_runtime/utils/yamlutils.py +++ b/linkml_runtime/utils/yamlutils.py @@ -169,7 +169,7 @@ def form_1(entries: dict[Any, Optional[Union[dict, JsonObj]]]) -> None: for lek, lev in items(list_entry): if lek == key_name and not isinstance(lev, (list, dict, JsonObj)): # key_name:value - order_up(list_entry[lek], slot_type(list_entry)) + order_up(list_entry[lek], slot_type(**list_entry)) break # Not strictly necessary, but elif not isinstance(lev, (list, dict, JsonObj)): # key: value --> slot_type(key, value)