Repository navigation
Expand file tree
/
Copy pathparam-list.json
More file actions
157 lines (157 loc) · 4.89 KB
/
Copy pathparam-list.json
File metadata and controls
157 lines (157 loc) · 4.89 KB
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
[
{
"name": "basic parameterised list",
"raw": ["abc_123;a=1;b=2; cdef_456, ghi;q=9;r=\"+w\""],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "abc_123"}, [["a", 1], ["b", 2], ["cdef_456", true]]],
[{"__type": "token", "value": "ghi"}, [["q", 9], ["r", "+w"]]]
],
"canonical": ["abc_123;a=1;b=2;cdef_456, ghi;q=9;r=\"+w\""]
},
{
"name": "single item parameterised list",
"raw": ["text/html;q=1.0"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, [["q", 1.0]]]
]
},
{
"name": "missing parameter value parameterised list",
"raw": ["text/html;a;q=1.0"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, [["a", true], ["q", 1.0]]]
]
},
{
"name": "missing terminal parameter value parameterised list",
"raw": ["text/html;q=1.0;a"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, [["q", 1.0], ["a", true]]]
]
},
{
"name": "no whitespace parameterised list",
"raw": ["text/html,text/plain;q=0.5"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"}, [["q", 0.5]]]
],
"canonical": ["text/html, text/plain;q=0.5"]
},
{
"name": "whitespace before = parameterised list",
"raw": ["text/html, text/plain;q =0.5"],
"header_type": "list",
"must_fail": true
},
{
"name": "whitespace after = parameterised list",
"raw": ["text/html, text/plain;q= 0.5"],
"header_type": "list",
"must_fail": true
},
{
"name": "whitespace before ; parameterised list",
"raw": ["text/html, text/plain ;q=0.5"],
"header_type": "list",
"must_fail": true
},
{
"name": "whitespace after ; parameterised list",
"raw": ["text/html, text/plain; q=0.5"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"}, [["q", 0.5]]]
],
"canonical": ["text/html, text/plain;q=0.5"]
},
{
"name": "extra whitespace parameterised list",
"raw": ["text/html , text/plain; q=0.5; charset=utf-8"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"},
[["q", 0.5], ["charset", {"__type": "token", "value": "utf-8"}
]]]
],
"canonical": ["text/html, text/plain;q=0.5;charset=utf-8"]
},
{
"name": "two lines parameterised list",
"raw": ["text/html", "text/plain;q=0.5"],
"header_type": "list",
"expected": [
[{"__type": "token", "value": "text/html"}, []],
[{"__type": "token", "value": "text/plain"}, [["q", 0.5]]]
],
"canonical": ["text/html, text/plain;q=0.5"]
},
{
"name": "trailing comma parameterised list",
"raw": ["text/html,text/plain;q=0.5,"],
"header_type": "list",
"must_fail": true
},
{
"name": "empty item parameterised list",
"raw": ["text/html,,text/plain;q=0.5,"],
"header_type": "list",
"must_fail": true
},
{
"name": "duplicate parameter with different positions",
"raw": ["a;b=1;c=2;b=3"],
"header_type": "list",
"expected": [[{"__type": "token", "value": "a"}, [["b", 3], ["c", 2]]]],
"canonical": ["a;b=3;c=2"]
},
{
"name": "parameter ordering",
"raw": ["a;m;z;t"],
"header_type": "list",
"expected": [[{"__type": "token", "value": "a"}, [["m", true], ["z", true], ["t", true]]]]
},
{
"name": "trailing semicolon in parameters",
"raw": ["a;b=1;"],
"header_type": "list",
"must_fail": true
},
{
"name": "trailing semicolon and space in parameters",
"raw": ["a;b=1; "],
"header_type": "list",
"must_fail": true
},
{
"name": "empty parameter key",
"raw": ["a;=1"],
"header_type": "list",
"must_fail": true
},
{
"name": "parameter prefix only",
"raw": ["a;"],
"header_type": "list",
"must_fail": true
},
{
"name": "parameter prefix and space only",
"raw": ["a; "],
"header_type": "list",
"must_fail": true
},
{
"name": "parameter value with thirteen integer digits and no fractional digits",
"raw": ["1;a=1234567890123."],
"header_type": "item",
"must_fail": true
}
]