fix for unusually formatted vol schemas in service registry

This commit is contained in:
Alex O'Connell
2024-01-29 20:35:35 -05:00
parent 680ab96bb7
commit 96d5c2a809

View File

@@ -179,9 +179,12 @@ def flatten_schema(schema):
if isinstance(current_schema.schema, vol.validators._WithSubValidators):
for subval in current_schema.schema.validators:
_flatten(subval, prefix)
else:
elif isinstance(current_schema.schema, dict):
for key, val in current_schema.schema.items():
_flatten(val, prefix + str(key) + '/')
else:
# what other types to we need to support????
_LOGGER.debug(f"hit unknown schema type while flattening at {prefix}: {current_schema.schema}")
elif isinstance(current_schema, vol.validators._WithSubValidators):
for subval in current_schema.validators:
_flatten(subval, prefix)