...

Text file src/github.com/qri-io/jsonschema/testdata/draft7/optional/content.json

Documentation: github.com/qri-io/jsonschema/testdata/draft7/optional

     1[
     2    {
     3        "description": "validation of string-encoded content based on media type",
     4        "schema": {
     5            "contentMediaType": "application/json"
     6        },
     7        "tests": [
     8            {
     9                "description": "a valid JSON document",
    10                "data": "{\"foo\": \"bar\"}",
    11                "valid": true
    12            },
    13            {
    14                "description": "an invalid JSON document",
    15                "data": "{:}",
    16                "valid": false
    17            },
    18            {
    19                "description": "ignores non-strings",
    20                "data": 100,
    21                "valid": true
    22            }
    23        ]
    24    },
    25    {
    26        "description": "validation of binary string-encoding",
    27        "schema": {
    28            "contentEncoding": "base64"
    29        },
    30        "tests": [
    31            {
    32                "description": "a valid base64 string",
    33                "data": "eyJmb28iOiAiYmFyIn0K",
    34                "valid": true
    35            },
    36            {
    37                "description": "an invalid base64 string (% is not a valid character)",
    38                "data": "eyJmb28iOi%iYmFyIn0K",
    39                "valid": false
    40            },
    41            {
    42                "description": "ignores non-strings",
    43                "data": 100,
    44                "valid": true
    45            }
    46        ]
    47    },
    48    {
    49        "description": "validation of binary-encoded media type documents",
    50        "schema": {
    51            "contentMediaType": "application/json",
    52            "contentEncoding": "base64"
    53        },
    54        "tests": [
    55            {
    56                "description": "a valid base64-encoded JSON document",
    57                "data": "eyJmb28iOiAiYmFyIn0K",
    58                "valid": true
    59            },
    60            {
    61                "description": "a validly-encoded invalid JSON document",
    62                "data": "ezp9Cg==",
    63                "valid": false
    64            },
    65            {
    66                "description": "an invalid base64 string that is valid JSON",
    67                "data": "{}",
    68                "valid": false
    69            },
    70            {
    71                "description": "ignores non-strings",
    72                "data": 100,
    73                "valid": true
    74            }
    75        ]
    76    }
    77]

View as plain text