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

Support default values for non-enum types #149

Open
shamanskyh opened this issue Sep 12, 2018 · 1 comment
Open

Support default values for non-enum types #149

shamanskyh opened this issue Sep 12, 2018 · 1 comment

Comments

@shamanskyh
Copy link

We have a Plank schema where we have an integer property. We'd like to specify a default value for that property so that when any new models are initialized, they could have a default value set. In our instance, we'd like the integer property to be preset to -1 when the model is initialized.

Something like this would be ideal:

{
    "id": "button.json",
    "title": "button",
    "description" : "Schema definition of Pinterest button",
    "$schema": "http://json-schema.org/schema#",
    "type": "object",
    "properties": {
        "id" : { "type": "string" },
        "element_type" : {
            "type": "integer",
            "default": -1
        },
    },
    "required": ["id"]
}
@NightlyNexus
Copy link

This would be great for Kotlin or Java as well!

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

No branches or pull requests

2 participants