Debian Codegraph @

share/tests/draft4/optional/format/uri.json

raw
1 [
2 {
3 "description": "validation of URIs",
4 "schema": { "format": "uri" },
5 "tests": [
6 {
7 "description": "all string formats ignore integers",
8 "data": 12,
9 "valid": true
10 },
11 {
12 "description": "all string formats ignore floats",
13 "data": 13.7,
14 "valid": true
15 },
16 {
17 "description": "all string formats ignore objects",
18 "data": {},
19 "valid": true
20 },
21 {
22 "description": "all string formats ignore arrays",
23 "data": [],
24 "valid": true
25 },
26 {
27 "description": "all string formats ignore booleans",
28 "data": false,
29 "valid": true
30 },
31 {
32 "description": "all string formats ignore nulls",
33 "data": null,
34 "valid": true
35 },
36 {
37 "description": "a valid URL with anchor tag",
38 "data": "http://foo.bar/?baz=qux#quux",
39 "valid": true
40 },
41 {
42 "description": "a valid URL with anchor tag and parentheses",
43 "data": "http://foo.com/blah_(wikipedia)_blah#cite-1",
44 "valid": true
45 },
46 {
47 "description": "a valid URL with URL-encoded stuff",
48 "data": "http://foo.bar/?q=Test%20URL-encoded%20stuff",
49 "valid": true
50 },
51 {
52 "description": "a valid puny-coded URL ",
53 "data": "http://xn--nw2a.xn--j6w193g/",
54 "valid": true
55 },
56 {
57 "description": "a valid URL with many special characters",
58 "data": "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com",
59 "valid": true
60 },
61 {
62 "description": "a valid URL based on IPv4",
63 "data": "http://223.255.255.254",
64 "valid": true
65 },
66 {
67 "description": "a valid URL with ftp scheme",
68 "data": "ftp://ftp.is.co.za/rfc/rfc1808.txt",
69 "valid": true
70 },
71 {
72 "description": "a valid URL for a simple text file",
73 "data": "http://www.ietf.org/rfc/rfc2396.txt",
74 "valid": true
75 },
76 {
77 "description": "a valid URL",
78 "data": "ldap://[2001:db8::7]/c=GB?objectClass?one",
79 "valid": true
80 },
81 {
82 "description": "a valid mailto URI",
83 "data": "mailto:[email protected]",
84 "valid": true
85 },
86 {
87 "description": "a valid newsgroup URI",
88 "data": "news:comp.infosystems.www.servers.unix",
89 "valid": true
90 },
91 {
92 "description": "a valid tel URI",
93 "data": "tel:+1-816-555-1212",
94 "valid": true
95 },
96 {
97 "description": "a valid URN",
98 "data": "urn:oasis:names:specification:docbook:dtd:xml:4.1.2",
99 "valid": true
100 },
101 {
102 "description": "an invalid protocol-relative URI Reference",
103 "data": "//foo.bar/?baz=qux#quux",
104 "valid": false
105 },
106 {
107 "description": "an invalid relative URI Reference",
108 "data": "/abc",
109 "valid": false
110 },
111 {
112 "description": "an invalid URI",
113 "data": "\\\\WINDOWS\\fileshare",
114 "valid": false
115 },
116 {
117 "description": "an invalid URI though valid URI reference",
118 "data": "abc",
119 "valid": false
120 },
121 {
122 "description": "an invalid URI with spaces",
123 "data": "http:// shouldfail.com",
124 "valid": false
125 },
126 {
127 "description": "an invalid URI with spaces and missing scheme",
128 "data": ":// should fail",
129 "valid": false
130 },
131 {
132 "description": "an invalid URI with comma in scheme",
133 "data": "bar,baz:foo",
134 "valid": false
135 },
136 {
137 "description": "invalid userinfo",
138 "data": "https://[@example.org/test.txt",
139 "valid": false
140 },
141 {
142 "description": "unescaped non US-ASCII characters",
143 "data": "https://example.org/foobar®.txt",
144 "valid": false
145 },
146 {
147 "description": "invalid backslash character",
148 "data": "https://example.org/foobar\\.txt",
149 "valid": false
150 },
151 {
152 "description": "invalid \" character",
153 "data": "https://example.org/foobar\".txt",
154 "valid": false
155 },
156 {
157 "description": "invalid <> characters",
158 "data": "https://example.org/foobar<>.txt",
159 "valid": false
160 },
161 {
162 "description": "invalid {} characters",
163 "data": "https://example.org/foobar{}.txt",
164 "valid": false
165 },
166 {
167 "description": "invalid ^ character",
168 "data": "https://example.org/foobar^.txt",
169 "valid": false
170 },
171 {
172 "description": "invalid ` character",
173 "data": "https://example.org/foobar`.txt",
174 "valid": false
175 },
176 {
177 "description": "invalid SPACE character",
178 "data": "https://example.org/foo bar.txt",
179 "valid": false
180 },
181 {
182 "description": "invalid | character",
183 "data": "https://example.org/foobar|.txt",
184 "valid": false
185 },
186 {
187 "description": "URI with leading-zero IPv4 is structurally valid as a reg-name",
188 "comment": "RFC 3986, Section 3.2.2: If an IP literal fails strict IPv4address parsing, it falls back to reg-name. A string of digits and dots is valid under unreserved characters. JSON Schema format asserts syntax, not scheme-specific DNS semantics.",
189 "data": "http://087.10.0.1/",
190 "valid": true
191 },
192 {
193 "description": "URI with out-of-bounds IPv4 is structurally valid as a reg-name",
194 "comment": "RFC 3986, Section 3.2.2: Fallback to reg-name allows digits and dots.",
195 "data": "http://999.999.999.999/",
196 "valid": true
197 },
198 {
199 "description": "invalid percent-encoding with non-hex digits",
200 "data": "http://example.com/%6G",
201 "valid": false
202 },
203 {
204 "description": "incomplete percent-encoding triplet",
205 "data": "http://example.com/%A",
206 "valid": false
207 },
208 {
209 "description": "lone percent sign is invalid",
210 "data": "http://example.com/%",
211 "valid": false
212 },
213 {
214 "description": "scheme must start with a letter",
215 "data": "1http://example.com",
216 "valid": false
217 },
218 {
219 "description": "invalid character in scheme",
220 "data": "ht_tp://example.com",
221 "valid": false
222 },
223 {
224 "description": "non-numeric port is invalid",
225 "data": "http://example.com:abc/path",
226 "valid": false
227 },
228 {
229 "description": "leading zero in an embedded IPv4 address is invalid",
230 "data": "http://[::ffff:01.2.3.4]",
231 "valid": false
232 },
233 {
234 "description": "square brackets are not allowed in a path segment",
235 "data": "http:/[::1]",
236 "valid": false
237 },
238 {
239 "description": "a trailing newline after a valid URI is invalid",
240 "data": "http://foo.bar/\n",
241 "valid": false
242 }
243 ]
244 }
245 ]