diff --git a/eve/io/mongo/mongo.py b/eve/io/mongo/mongo.py index d91d7f2b7..b84f4bc9b 100644 --- a/eve/io/mongo/mongo.py +++ b/eve/io/mongo/mongo.py @@ -856,11 +856,10 @@ def dict_sub_schema(base): return next((t for t in possible_types if t), None) elif "schema" in schema[k]: # recursively check the schema - return get_schema_type( - keys, dict_sub_schema(schema[k].get("schema")) - ) + return get_schema_type(keys, dict_sub_schema(schema[k]["schema"])) elif schema_type == "dict": - return get_schema_type(keys, dict_sub_schema(schema[k].get("schema"))) + if "schema" in schema[k]: + return get_schema_type(keys, dict_sub_schema(schema[k]["schema"])) else: return schema_type