3
0

upd(codegen): spec update for nested message apis

This commit is contained in:
Tit Petric
2018-07-19 21:00:25 +02:00
parent bb9fdf3107
commit 0954e5c53d
17 changed files with 604 additions and 214 deletions

View File

@@ -47,7 +47,18 @@ exec("find -L " . __DIR__ . "/" . $project . " -name index.php", $generators);
$api_files = glob($project . "/docs/src/spec/*.json");
$apis = array_map(function($filename) {
return array_change_key_case_recursive(json_decode(file_get_contents($filename), true));
$api = array_change_key_case_recursive(json_decode(file_get_contents($filename), true));
if (empty($api['parameters'])) {
$api['parameters'] = array();
}
foreach ($api['apis'] as $kk => $call) {
if (empty($call['parameters'])) {
$call['parameters'] = array();
}
$call['parameters'] = array_merge($api['parameters'], $call['parameters']);
$api['apis'][$kk] = $call;
}
return $api;
}, $api_files);
usort($apis, function($a, $b) {