Skip to content

It don't validate minimum constratint with oneOf definition for integer or number types #503

Closed
@luigimoyano

Description

@luigimoyano

Using the library we have find this scenario. It allows negative numbers with this definition. It works well for the other constraints but no for check the minimum constraint.

{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "type": "object",
    "properties": {
        "attributes": {
            "type": "object",
            "properties": {
                "spaces": {
                    "description": "Number of spaces",
                    "type": ["string", "integer"],
                    "oneOf": [
                        {
                            "type": "integer",
                            "minimum": 0
                        },
                        {
                            "type": "string",
                            "enum": [
                                "Ample"
                            ]
                        }
                    ]
                }
            }
        }
    }
}

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