fix(shared): load env from oneOf union schema

This commit is contained in:
jo 2022-09-12 12:49:59 +02:00 committed by Jonas L
parent ef44ad392d
commit ef091d10cb
1 changed files with 6 additions and 0 deletions

View File

@ -176,6 +176,12 @@ class EnvLoader:
# Merging all subtypes data together # Merging all subtypes data together
return dict(ChainMap(*all_of_mapping.values())) 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 # Get all the properties and resolve conflicts after
if "anyOf" in schema: if "anyOf" in schema:
any_of_mapping = self._get_mapping(env_name, *schema["anyOf"]) any_of_mapping = self._get_mapping(env_name, *schema["anyOf"])