...

Text file src/github.com/qri-io/jsonschema/testdata/draft6/propertyNames.json

Documentation: github.com/qri-io/jsonschema/testdata/draft6

     1[
     2    {
     3        "description": "propertyNames validation",
     4        "schema": {
     5            "propertyNames": {"maxLength": 3}
     6        },
     7        "tests": [
     8            {
     9                "description": "all property names valid",
    10                "data": {
    11                    "f": {},
    12                    "foo": {}
    13                },
    14                "valid": true
    15            },
    16            {
    17                "description": "some property names invalid",
    18                "data": {
    19                    "foo": {},
    20                    "foobar": {}
    21                },
    22                "valid": false
    23            },
    24            {
    25                "description": "object without properties is valid",
    26                "data": {},
    27                "valid": true
    28            },
    29            {
    30                "description": "ignores arrays",
    31                "data": [1, 2, 3, 4],
    32                "valid": true
    33            },
    34            {
    35                "description": "ignores strings",
    36                "data": "foobar",
    37                "valid": true
    38            },
    39            {
    40                "description": "ignores other non-objects",
    41                "data": 12,
    42                "valid": true
    43            }
    44        ]
    45    },
    46    {
    47        "description": "propertyNames with boolean schema true",
    48        "schema": {"propertyNames": true},
    49        "tests": [
    50            {
    51                "description": "object with any properties is valid",
    52                "data": {"foo": 1},
    53                "valid": true
    54            },
    55            {
    56                "description": "empty object is valid",
    57                "data": {},
    58                "valid": true
    59            }
    60        ]
    61    },
    62    {
    63        "description": "propertyNames with boolean schema false",
    64        "schema": {"propertyNames": false},
    65        "tests": [
    66            {
    67                "description": "object with any properties is invalid",
    68                "data": {"foo": 1},
    69                "valid": false
    70            },
    71            {
    72                "description": "empty object is valid",
    73                "data": {},
    74                "valid": true
    75            }
    76        ]
    77    }
    78]

View as plain text