Debian Codegraph @

share/tests/draft2019-09/optional/format/uri.json

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