@@ -20,6 +20,7 @@ describe('Code Generator', () => {
20
20
"$.bar['children']" ,
21
21
"$.bar['0']" ,
22
22
"$.bar['children.bar']" ,
23
+ "$.paths[*]['400']" ,
23
24
'$.paths[*][404,202]' ,
24
25
'$.channels[*][publish,subscribe][?(@.schemaFormat === void 0)].payload' ,
25
26
] ) ,
@@ -38,8 +39,8 @@ const zones = {
38
39
}
39
40
}, {
40
41
zone: {
41
- keys: [404, 202],
42
- zones: [{}, {}]
42
+ keys: ["400", 404, 202],
43
+ zones: [{}, {}, {} ]
43
44
}
44
45
}, {
45
46
zone: {
@@ -123,6 +124,12 @@ const tree = {
123
124
if (scope === null) return;
124
125
scope.emit("$.bar['children.bar']", 0, false);
125
126
},
127
+ "$.paths[*]['400']": function (scope) {
128
+ if (scope.path.length !== 3) return;
129
+ if (scope.path[0] !== "paths") return;
130
+ if (String(scope.path[2]) !== "400") return;
131
+ scope.emit("$.paths[*]['400']", 0, false);
132
+ },
126
133
"$.paths[*][404,202]": function (scope) {
127
134
if (scope.path.length !== 3) return;
128
135
if (scope.path[0] !== "paths") return;
@@ -160,6 +167,7 @@ export default function (input, callbacks) {
160
167
tree["$.servers[*].url"](scope);
161
168
tree["$.servers[0:2]"](scope);
162
169
tree["$.servers[:5]"](scope);
170
+ tree["$.paths[*]['400']"](scope);
163
171
tree["$.paths[*][404,202]"](scope);
164
172
tree["$.channels[*][publish,subscribe][?(@.schemaFormat === void 0)].payload"](scope, state0);
165
173
}, zones);
0 commit comments