summaryrefslogtreecommitdiff
path: root/json/tests/draft-next/optional/format/uri.json
blob: 792d71a058369b5a8e3a5b7664cf193feb7a3898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[
    {
        "description": "validation of URIs",
        "schema": { "format": "uri" },
        "tests": [
            {
                "description": "a valid URL with anchor tag",
                "data": "http://foo.bar/?baz=qux#quux",
                "valid": true
            },
            {
                "description": "a valid URL with anchor tag and parentheses",
                "data": "http://foo.com/blah_(wikipedia)_blah#cite-1",
                "valid": true
            },
            {
                "description": "a valid URL with URL-encoded stuff",
                "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff",
                "valid": true
            },
            {
                "description": "a valid puny-coded URL ",
                "data": "http://xn--nw2a.xn--j6w193g/",
                "valid": true
            },
            {
                "description": "a valid URL with many special characters",
                "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
                "valid": true
            },
            {
                "description": "a valid URL based on IPv4",
                "data": "http://223.255.255.254",
                "valid": true
            },
            {
                "description": "a valid URL with ftp scheme",
                "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
                "valid": true
            },
            {
                "description": "a valid URL for a simple text file",
                "data": "http://www.ietf.org/rfc/rfc2396.txt",
                "valid": true
            },
            {
                "description": "a valid URL ",
                "data": "ldap://[2001:db8::7]/c=GB?objectClass?one",
                "valid": true
            },
            {
                "description": "a valid mailto URI",
                "data": "mailto:John.Doe@example.com",
                "valid": true
            },
            {
                "description": "a valid newsgroup URI",
                "data": "news:comp.infosystems.www.servers.unix",
                "valid": true
            },
            {
                "description": "a valid tel URI",
                "data": "tel:+1-816-555-1212",
                "valid": true
            },
            {
                "description": "a valid URN",
                "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2",
                "valid": true
            },
            {
                "description": "an invalid protocol-relative URI Reference",
                "data": "//foo.bar/?baz=qux#quux",
                "valid": false
            },
            {
                "description": "an invalid relative URI Reference",
                "data": "/abc",
                "valid": false
            },
            {
                "description": "an invalid URI",
                "data": "\\\\WINDOWS\\fileshare",
                "valid": false
            },
            {
                "description": "an invalid URI though valid URI reference",
                "data": "abc",
                "valid": false
            },
            {
                "description": "an invalid URI with spaces",
                "data": "http:// shouldfail.com",
                "valid": false
            },
            {
                "description": "an invalid URI with spaces and missing scheme",
                "data": ":// should fail",
                "valid": false
            },
            {
                "description": "an invalid URI with comma in scheme",
                "data": "bar,baz:foo",
                "valid": false
            }
        ]
    }
]