diff --git a/tiramisu_api/api.py b/tiramisu_api/api.py index 364069f..53470b6 100644 --- a/tiramisu_api/api.py +++ b/tiramisu_api/api.py @@ -225,13 +225,14 @@ class _Value: withwarning: bool=False, flatten: bool=False): ret = {} - self._dict_walk(ret, - self.schema, - self.path, - fullpath, - withwarning, - flatten, - None) + if self.schema: + self._dict_walk(ret, + self.schema, + self.path, + fullpath, + withwarning, + flatten, + None) return ret @@ -609,9 +610,12 @@ class ContextValue(_Value): config: 'Config', schema: Dict) -> None: self.config = config - first = next(iter(schema.keys())) - self.path = first.rsplit('.', 1)[0] - self.schema = {'properties': schema} + if schema: + first = next(iter(schema.keys())) + self.path = first.rsplit('.', 1)[0] + self.schema = {'properties': schema} + else: + self.schema = {} def __call__(self) -> TiramisuOptionValue: return TiramisuOptionValue(self.config,