Skip to content

Feature request: automatically add nested defaults #178

@theahura

Description

@theahura

If I have a jsonschema like:

schema = {
    "type": "object",
    "properties": {
        "foo": {
            "type": "object",
            "properties": {
                "bar": {
                    "type": "string",
                    "default": "bar"
                }
            }
        },
    },
    "required": [],
    "additionalProperties": False
}

the output of validation will be

{}

instead of

{
  foo: {
    bar: "bar"
  }
}

is there a way to make it so that nested defaults are automatically populated?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions