Currently the default at the root of a schema or subschema is not applied (it's not even looked for) in fill_default if the corresponding level of the instance is empty.
Root defaults should be applied if the corresponding level of the instance is empty.
Modified example from #30 (comment):
schema = {
"properties": {
"pool": {
"properties": {
"max_connections": {"type": "integer"},
"min_connections": {"type": "integer"}
}
}
},
"default": {
"pool": {
"max_connections": 8,
"min_connections": 0
}
}
}
instance = {}
fill_default(instance, schema)
assert instance == {"pool": {"max_connections": 8, "min_connections": 0}}, instance
Currently the default at the root of a schema or subschema is not applied (it's not even looked for) in
fill_defaultif the corresponding level of the instance is empty.Root defaults should be applied if the corresponding level of the instance is empty.
Modified example from #30 (comment):