...

Text file src/github.com/go-openapi/validate/fixtures/jsonschema_suite/optional/format.json

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

View as plain text