Skip to content

Default Integer Values Cause Validation Error #357

@daishisystems

Description

@daishisystems

I have the following definition in my *.json file:

"Card": {
    "required": [
        "number",
        "exp_month",
        "exp_year"
    ],
    "properties": {
        "number": {
            "type": "string",
            "default": "0123456789123456"
        },
        "exp_month": {
            "type": "integer",
            "format": "int64",
            "default": 12
        },
        "exp_year": {
            "type": "integer",
            "format": "int32"
        }
    }
}

Validation fails based on the fact that the default value of exp_month is set to 12. Setting the value to "12" causes successful validation, however, the default value is then of the wrong type in the model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions