| @@ 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); |
|
| @@ 193-195 (lines=3) @@ | ||
| 190 | $output = []; |
|
| 191 | $schema = new ResponseObject(); |
|
| 192 | foreach ($mappings as $key => $map) { |
|
| 193 | if (substr($key, 0, strlen('response.')) == 'response.') { |
|
| 194 | $key = substr($key, strlen('response.')); |
|
| 195 | } |
|
| 196 | ArrayHelper::set($output, $key, $map); |
|
| 197 | } |
|
| 198 | //TODO 支持 header、status 等 |
|