From ef091d10cb74ae9d8173509712f467091081d064 Mon Sep 17 00:00:00 2001 From: jo Date: Mon, 12 Sep 2022 12:49:59 +0200 Subject: [PATCH] fix(shared): load env from oneOf union schema --- shared/libretime_shared/config/_env.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shared/libretime_shared/config/_env.py b/shared/libretime_shared/config/_env.py index d8a42a649..03f94b657 100644 --- a/shared/libretime_shared/config/_env.py +++ b/shared/libretime_shared/config/_env.py @@ -176,6 +176,12 @@ class EnvLoader: # Merging all subtypes data together return dict(ChainMap(*all_of_mapping.values())) + # Get all the properties as we won't have typing conflicts + if "oneOf" in schema: + one_of_mapping = self._get_mapping(env_name, *schema["oneOf"]) + # Merging all subtypes data together + return dict(ChainMap(*one_of_mapping.values())) + # Get all the properties and resolve conflicts after if "anyOf" in schema: any_of_mapping = self._get_mapping(env_name, *schema["anyOf"])