@@ 187-189 (lines=3) @@ | ||
184 | $output = []; |
|
185 | $schema = new ResponseObject(); |
|
186 | foreach ($mappings as $key => $map) { |
|
187 | if (substr($key, 0, strlen('response.')) == 'response.') { |
|
188 | $key = substr($key, strlen('response.')); |
|
189 | } |
|
190 | ArrayHelper::set($output, $key, $map); |
|
191 | } |
|
192 | //TODO 支持 header、status 等 |
@@ 86-88 (lines=3) @@ | ||
83 | $output = []; |
|
84 | foreach($mappings as $key=>$map){ |
|
85 | $val = \JmesPath\search($map->source, $input); |
|
86 | if(substr($key, 0, strlen('response.')) == 'response.'){ |
|
87 | $key = substr($key, strlen('response.')); |
|
88 | } |
|
89 | ArrayHelper::set($output, $key, $val); |
|
90 | } |
|
91 | $renderer = $app->get(ResponseRenderer::class); |