From ccbaa59d08d59df8e4ad643090fc9827c9dadce9 Mon Sep 17 00:00:00 2001 From: Mirek Simek Date: Wed, 28 Feb 2024 20:20:08 +0100 Subject: [PATCH] Fixing record inclusion - made the heuristics more tight (#256) Small fix - made better detection of a top-level record in case we are inside the top-level record --- oarepo_model_builder/loaders/extend.py | 6 +++++- setup.cfg | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/oarepo_model_builder/loaders/extend.py b/oarepo_model_builder/loaders/extend.py index 3f4029b..5978260 100644 --- a/oarepo_model_builder/loaders/extend.py +++ b/oarepo_model_builder/loaders/extend.py @@ -12,7 +12,11 @@ def extract_extended_record(included_data, *, context, **kwargs): and keep those in "other_properties" inside the context so that other processors can add some of those selectively. """ - if "record" in included_data: + if ( + "record" in included_data + and "properties" in included_data["record"] + and "properties" not in included_data + ): extended_object = included_data["record"] elif "properties" in included_data: extended_object = included_data diff --git a/setup.cfg b/setup.cfg index 0ad7af3..b393e14 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-model-builder -version = 4.0.77 +version = 4.0.78 description = A utility library that generates OARepo required data model files from a JSON specification file authors = Miroslav Bauer , Miroslav Simek readme = README.md