...

Text file src/github.com/qri-io/jsonschema/testdata/draft4/optional/format.json

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

     1[
     2    {
     3        "description": "validation of date-time strings",
     4        "schema": {"format": "date-time"},
     5        "tests": [
     6            {
     7                "description": "a valid date-time string",
     8                "data": "1963-06-19T08:30:06.283185Z",
     9                "valid": true
    10            },
    11            {
    12                "description": "a valid date-time string without second fraction",
    13                "data": "1963-06-19T08:30:06Z",
    14                "valid": true
    15            },
    16            {
    17                "description": "a valid date-time string with plus offset",
    18                "data": "1937-01-01T12:00:27.87+00:20",
    19                "valid": true
    20            },
    21            {
    22                "description": "a valid date-time string with minus offset",
    23                "data": "1990-12-31T15:59:50.123-08:00",
    24                "valid": true
    25            },
    26            {
    27                "description": "a invalid day in date-time string",
    28                "data": "1990-02-31T15:59:60.123-08:00",
    29                "valid": false
    30            },
    31            {
    32                "description": "an invalid offset in date-time string",
    33                "data": "1990-12-31T15:59:60-24:00",
    34                "valid": false
    35            },
    36            {
    37                "description": "an invalid date-time string",
    38                "data": "06/19/1963 08:30:06 PST",
    39                "valid": false
    40            },
    41            {
    42                "description": "case-insensitive T and Z",
    43                "data": "1963-06-19t08:30:06.283185z",
    44                "valid": true
    45            },
    46            {
    47                "description": "only RFC3339 not all of ISO 8601 are valid",
    48                "data": "2013-350T01:01:01",
    49                "valid": false
    50            }
    51        ]
    52    },
    53    {
    54        "description": "validation of URIs",
    55        "schema": {"format": "uri"},
    56        "tests": [
    57            {
    58                "description": "a valid URL with anchor tag",
    59                "data": "http://foo.bar/?baz=qux#quux",
    60                "valid": true
    61            },
    62            {
    63                "description": "a valid URL with anchor tag and parantheses",
    64                "data": "http://foo.com/blah_(wikipedia)_blah#cite-1",
    65                "valid": true
    66            },
    67            {
    68                "description": "a valid URL with URL-encoded stuff",
    69                "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff",
    70                "valid": true
    71            },
    72            {
    73                "description": "a valid puny-coded URL ",
    74                "data": "http://xn--nw2a.xn--j6w193g/",
    75                "valid": true
    76            },
    77            {
    78                "description": "a valid URL with many special characters",
    79                "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
    80                "valid": true
    81            },
    82            {
    83                "description": "a valid URL based on IPv4",
    84                "data": "http://223.255.255.254",
    85                "valid": true
    86            },
    87            {
    88                "description": "a valid URL with ftp scheme",
    89                "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
    90                "valid": true
    91            },
    92            {
    93                "description": "a valid URL for a simple text file",
    94                "data": "http://www.ietf.org/rfc/rfc2396.txt",
    95                "valid": true
    96            },
    97            {
    98                "description": "a valid URL ",
    99                "data": "ldap://[2001:db8::7]/c=GB?objectClass?one",
   100                "valid": true
   101            },
   102            {
   103                "description": "a valid mailto URI",
   104                "data": "mailto:John.Doe@example.com",
   105                "valid": true
   106            },
   107            {
   108                "description": "a valid newsgroup URI",
   109                "data": "news:comp.infosystems.www.servers.unix",
   110                "valid": true
   111            },
   112            {
   113                "description": "a valid tel URI",
   114                "data": "tel:+1-816-555-1212",
   115                "valid": true
   116            },
   117            {
   118                "description": "a valid URN",
   119                "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2",
   120                "valid": true
   121            },
   122            {
   123                "description": "an invalid protocol-relative URI Reference",
   124                "data": "//foo.bar/?baz=qux#quux",
   125                "valid": false
   126            },
   127            {
   128                "description": "an invalid relative URI Reference",
   129                "data": "/abc",
   130                "valid": false
   131            },
   132            {
   133                "description": "an invalid URI",
   134                "data": "\\\\WINDOWS\\fileshare",
   135                "valid": false
   136            },
   137            {
   138                "description": "an invalid URI though valid URI reference",
   139                "data": "abc",
   140                "valid": false
   141            },
   142            {
   143                "description": "an invalid URI with spaces",
   144                "data": "http:// shouldfail.com",
   145                "valid": false
   146            },
   147            {
   148                "description": "an invalid URI with spaces and missing scheme",
   149                "data": ":// should fail",
   150                "valid": false
   151            }
   152        ]
   153    },
   154    {
   155        "description": "validation of e-mail addresses",
   156        "schema": {"format": "email"},
   157        "tests": [
   158            {
   159                "description": "a valid e-mail address",
   160                "data": "joe.bloggs@example.com",
   161                "valid": true
   162            },
   163            {
   164                "description": "an invalid e-mail address",
   165                "data": "2962",
   166                "valid": false
   167            }
   168        ]
   169    },
   170    {
   171        "description": "validation of IP addresses",
   172        "schema": {"format": "ipv4"},
   173        "tests": [
   174            {
   175                "description": "a valid IP address",
   176                "data": "192.168.0.1",
   177                "valid": true
   178            },
   179            {
   180                "description": "an IP address with too many components",
   181                "data": "127.0.0.0.1",
   182                "valid": false
   183            },
   184            {
   185                "description": "an IP address with out-of-range values",
   186                "data": "256.256.256.256",
   187                "valid": false
   188            },
   189            {
   190                "description": "an IP address without 4 components",
   191                "data": "127.0",
   192                "valid": false
   193            },
   194            {
   195                "description": "an IP address as an integer",
   196                "data": "0x7f000001",
   197                "valid": false
   198            }
   199        ]
   200    },
   201    {
   202        "description": "validation of IPv6 addresses",
   203        "schema": {"format": "ipv6"},
   204        "tests": [
   205            {
   206                "description": "a valid IPv6 address",
   207                "data": "::1",
   208                "valid": true
   209            },
   210            {
   211                "description": "an IPv6 address with out-of-range values",
   212                "data": "12345::",
   213                "valid": false
   214            },
   215            {
   216                "description": "an IPv6 address with too many components",
   217                "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
   218                "valid": false
   219            },
   220            {
   221                "description": "an IPv6 address containing illegal characters",
   222                "data": "::laptop",
   223                "valid": false
   224            }
   225        ]
   226    },
   227    {
   228        "description": "validation of host names",
   229        "schema": {"format": "hostname"},
   230        "tests": [
   231            {
   232                "description": "a valid host name",
   233                "data": "www.example.com",
   234                "valid": true
   235            },
   236            {
   237                "description": "a host name starting with an illegal character",
   238                "data": "-a-host-name-that-starts-with--",
   239                "valid": false
   240            },
   241            {
   242                "description": "a host name containing illegal characters",
   243                "data": "not_a_valid_host_name",
   244                "valid": false
   245            },
   246            {
   247                "description": "a host name with a component too long",
   248                "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
   249                "valid": false
   250            }
   251        ]
   252    }
   253]

View as plain text