Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: Support for "default" values, output document with defaults, accept "default" values for "required" fields #89

Open
Garagoth opened this issue Apr 4, 2023 · 0 comments

Comments

@Garagoth
Copy link

Garagoth commented Apr 4, 2023

Given the schema:

{
    "$id": "https://jschon.dev/schema",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": ["p1", "p2"],
    "properties": {
        "p1": {"type": "string", "default": "def_val"},
        "p2": {"type": "integer", "default": 7, "minimum": 5},
        "p3": {"type": "string"}
    }
}

following document does not validate:

{
    "p2": 6,
    "p3": "test_p3"
}

Finally, as a result of validation, I would like to be able to get document that was validated extended with all fields with default values that were not present in original document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant