Skip to content

Commit 681f221

Browse files
committed
Add similar RFC3986 normalization tests for internal IDs.
1 parent fc04125 commit 681f221

10 files changed

+670
-10
lines changed

tests/json-schema-draft-04/rfc3986-normalization-on-insertion.json

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,34 @@
66
"hTtP://exAmpLe.com/case-SENSITIVE-path": {},
77
"http://example.com/escapes/a%c2%b1b": { "spam": "eggs" },
88
"http://example.com/unreserved/%7Efoo": { "snap": "crackle" },
9-
"http://example.com:80/default/port": { "pop": 37 }
9+
"http://example.com:80/default/port": { "pop": 37 },
10+
"http://example.com/internal-ids": {
11+
"definitions": {
12+
"scheme": {
13+
"id": "hTtP://example.com/id/case-insensitive-scheme",
14+
"foo": "bar"
15+
},
16+
"host": {
17+
"id": "http://exAmpLe.com/id/case-insensitive-host",
18+
"baz": "quux"
19+
},
20+
"path": {
21+
"id": "hTtP://exAmpLe.com/id/case-SENSITIVE-path"
22+
},
23+
"escapes": {
24+
"id": "http://example.com/id/escapes/a%c2%b1b",
25+
"spam": "eggs"
26+
},
27+
"unreserved": {
28+
"id": "http://example.com/id/unreserved/%7Efoo",
29+
"snap": "crackle"
30+
},
31+
"port": {
32+
"id": "http://example.com:80/id/default/port",
33+
"pop": 37
34+
}
35+
}
36+
}
1037
},
1138
"tests": [
1239
{
@@ -32,6 +59,45 @@
3259
{
3360
"ref": "http://example.com/default/port",
3461
"target": { "pop": 37 }
62+
},
63+
{
64+
"ref": "http://example.com/id/case-insensitive-scheme",
65+
"target": {
66+
"id": "hTtP://example.com/id/case-insensitive-scheme",
67+
"foo": "bar"
68+
}
69+
},
70+
{
71+
"ref": "http://example.com/id/case-insensitive-host",
72+
"target": {
73+
"id": "http://exAmpLe.com/id/case-insensitive-host",
74+
"baz": "quux"
75+
}
76+
},
77+
{
78+
"ref": "http://example.com/id/case-sensitive-path",
79+
"error": true
80+
},
81+
{
82+
"ref": "http://example.com/id/escapes/a%C2%B1b",
83+
"target": {
84+
"id": "http://example.com/id/escapes/a%c2%b1b",
85+
"spam": "eggs"
86+
}
87+
},
88+
{
89+
"ref": "http://example.com/id/unreserved/~foo",
90+
"target": {
91+
"id": "http://example.com/id/unreserved/%7Efoo",
92+
"snap": "crackle"
93+
}
94+
},
95+
{
96+
"ref": "http://example.com/id/default/port",
97+
"target": {
98+
"id": "http://example.com:80/id/default/port",
99+
"pop": 37
100+
}
35101
}
36102
]
37103
}

tests/json-schema-draft-04/rfc3986-normalization-on-retrieval.json

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,34 @@
66
"http://example.com/case-sensitive-path": {},
77
"http://example.com/escapes/a%C2%B1b": { "spam": "eggs" },
88
"http://example.com/unreserved/~foo": { "snap": "crackle" },
9-
"http://example.com/default/port": { "pop": 37 }
9+
"http://example.com/default/port": { "pop": 37 },
10+
"http://example.com/internal-ids": {
11+
"definitions": {
12+
"scheme": {
13+
"id": "http://example.com/id/case-insensitive-scheme",
14+
"foo": "bar"
15+
},
16+
"host": {
17+
"id": "http://example.com/id/case-insensitive-host",
18+
"baz": "quux"
19+
},
20+
"path": {
21+
"id": "http://example.com/id/case-sensitive-path"
22+
},
23+
"escapes": {
24+
"id": "http://example.com/id/escapes/a%C2%B1b",
25+
"spam": "eggs"
26+
},
27+
"unreserved": {
28+
"id": "http://example.com/id/unreserved/~foo",
29+
"snap": "crackle"
30+
},
31+
"port": {
32+
"id": "http://example.com/id/default/port",
33+
"pop": 37
34+
}
35+
}
36+
}
1037
},
1138
"tests": [
1239
{
@@ -32,6 +59,45 @@
3259
{
3360
"ref": "http://example.com:80/default/port",
3461
"target": { "pop": 37 }
62+
},
63+
{
64+
"ref": "hTtP://example.com/id/case-insensitive-scheme",
65+
"target": {
66+
"id": "http://example.com/id/case-insensitive-scheme",
67+
"foo": "bar"
68+
}
69+
},
70+
{
71+
"ref": "http://exAmpLe.com/id/case-insensitive-host",
72+
"target": {
73+
"id": "http://example.com/id/case-insensitive-host",
74+
"baz": "quux"
75+
}
76+
},
77+
{
78+
"ref": "hTtP://exAmpLe.com/id/case-SENSITIVE-path",
79+
"error": true
80+
},
81+
{
82+
"ref": "http://example.com/id/escapes/a%c2%b1b",
83+
"target": {
84+
"id": "http://example.com/id/escapes/a%C2%B1b",
85+
"spam": "eggs"
86+
}
87+
},
88+
{
89+
"ref": "http://example.com/id/unreserved/%7Efoo",
90+
"target": {
91+
"id": "http://example.com/id/unreserved/~foo",
92+
"snap": "crackle"
93+
}
94+
},
95+
{
96+
"ref": "http://example.com:80/id/default/port",
97+
"target": {
98+
"id": "http://example.com/id/default/port",
99+
"pop": 37
100+
}
35101
}
36102
]
37103
}

tests/json-schema-draft-06/rfc3986-normalization-on-insertion.json

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,34 @@
66
"hTtP://exAmpLe.com/case-SENSITIVE-path": {},
77
"http://example.com/escapes/a%c2%b1b": { "spam": "eggs" },
88
"http://example.com/unreserved/%7Efoo": { "snap": "crackle" },
9-
"http://example.com:80/default/port": { "pop": 37 }
9+
"http://example.com:80/default/port": { "pop": 37 },
10+
"http://example.com/internal-ids": {
11+
"definitions": {
12+
"scheme": {
13+
"$id": "hTtP://example.com/id/case-insensitive-scheme",
14+
"foo": "bar"
15+
},
16+
"host": {
17+
"$id": "http://exAmpLe.com/id/case-insensitive-host",
18+
"baz": "quux"
19+
},
20+
"path": {
21+
"$id": "hTtP://exAmpLe.com/id/case-SENSITIVE-path"
22+
},
23+
"escapes": {
24+
"$id": "http://example.com/id/escapes/a%c2%b1b",
25+
"spam": "eggs"
26+
},
27+
"unreserved": {
28+
"$id": "http://example.com/id/unreserved/%7Efoo",
29+
"snap": "crackle"
30+
},
31+
"port": {
32+
"$id": "http://example.com:80/id/default/port",
33+
"pop": 37
34+
}
35+
}
36+
}
1037
},
1138
"tests": [
1239
{
@@ -32,6 +59,45 @@
3259
{
3360
"ref": "http://example.com/default/port",
3461
"target": { "pop": 37 }
62+
},
63+
{
64+
"ref": "http://example.com/id/case-insensitive-scheme",
65+
"target": {
66+
"$id": "hTtP://example.com/id/case-insensitive-scheme",
67+
"foo": "bar"
68+
}
69+
},
70+
{
71+
"ref": "http://example.com/id/case-insensitive-host",
72+
"target": {
73+
"$id": "http://exAmpLe.com/id/case-insensitive-host",
74+
"baz": "quux"
75+
}
76+
},
77+
{
78+
"ref": "http://example.com/id/case-sensitive-path",
79+
"error": true
80+
},
81+
{
82+
"ref": "http://example.com/id/escapes/a%C2%B1b",
83+
"target": {
84+
"$id": "http://example.com/id/escapes/a%c2%b1b",
85+
"spam": "eggs"
86+
}
87+
},
88+
{
89+
"ref": "http://example.com/id/unreserved/~foo",
90+
"target": {
91+
"$id": "http://example.com/id/unreserved/%7Efoo",
92+
"snap": "crackle"
93+
}
94+
},
95+
{
96+
"ref": "http://example.com/id/default/port",
97+
"target": {
98+
"$id": "http://example.com:80/id/default/port",
99+
"pop": 37
100+
}
35101
}
36102
]
37103
}

tests/json-schema-draft-06/rfc3986-normalization-on-retrieval.json

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,34 @@
66
"http://example.com/case-sensitive-path": {},
77
"http://example.com/escapes/a%C2%B1b": { "spam": "eggs" },
88
"http://example.com/unreserved/~foo": { "snap": "crackle" },
9-
"http://example.com/default/port": { "pop": 37 }
9+
"http://example.com/default/port": { "pop": 37 },
10+
"http://example.com/internal-ids": {
11+
"definitions": {
12+
"scheme": {
13+
"$id": "http://example.com/id/case-insensitive-scheme",
14+
"foo": "bar"
15+
},
16+
"host": {
17+
"$id": "http://example.com/id/case-insensitive-host",
18+
"baz": "quux"
19+
},
20+
"path": {
21+
"$id": "http://example.com/id/case-sensitive-path"
22+
},
23+
"escapes": {
24+
"$id": "http://example.com/id/escapes/a%C2%B1b",
25+
"spam": "eggs"
26+
},
27+
"unreserved": {
28+
"$id": "http://example.com/id/unreserved/~foo",
29+
"snap": "crackle"
30+
},
31+
"port": {
32+
"$id": "http://example.com/id/default/port",
33+
"pop": 37
34+
}
35+
}
36+
}
1037
},
1138
"tests": [
1239
{
@@ -32,6 +59,45 @@
3259
{
3360
"ref": "http://example.com:80/default/port",
3461
"target": { "pop": 37 }
62+
},
63+
{
64+
"ref": "hTtP://example.com/id/case-insensitive-scheme",
65+
"target": {
66+
"$id": "http://example.com/id/case-insensitive-scheme",
67+
"foo": "bar"
68+
}
69+
},
70+
{
71+
"ref": "http://exAmpLe.com/id/case-insensitive-host",
72+
"target": {
73+
"$id": "http://example.com/id/case-insensitive-host",
74+
"baz": "quux"
75+
}
76+
},
77+
{
78+
"ref": "hTtP://exAmpLe.com/id/case-SENSITIVE-path",
79+
"error": true
80+
},
81+
{
82+
"ref": "http://example.com/id/escapes/a%c2%b1b",
83+
"target": {
84+
"$id": "http://example.com/id/escapes/a%C2%B1b",
85+
"spam": "eggs"
86+
}
87+
},
88+
{
89+
"ref": "http://example.com/id/unreserved/%7Efoo",
90+
"target": {
91+
"$id": "http://example.com/id/unreserved/~foo",
92+
"snap": "crackle"
93+
}
94+
},
95+
{
96+
"ref": "http://example.com:80/id/default/port",
97+
"target": {
98+
"$id": "http://example.com/id/default/port",
99+
"pop": 37
100+
}
35101
}
36102
]
37103
}

0 commit comments

Comments
 (0)