mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-04-02 21:36:14 +03:00
Merge d4cecc51bc
into a33290c0c9
This commit is contained in:
commit
1be098e692
1 changed files with 12 additions and 1 deletions
|
@ -48,10 +48,21 @@ class HtmlOpenApiRenderer implements OpenApiRenderer
|
|||
'swagger_ui_config' => [],
|
||||
];
|
||||
|
||||
$spec = json_decode($spec->toJson(), true);
|
||||
|
||||
foreach ($spec['paths'] as $path => $methods) {
|
||||
foreach ($methods as $method => $data) {
|
||||
if (array_key_exists('tags', $data)) {
|
||||
$spec['resources'][$data['tags'][0]][$path] = $methods;
|
||||
$spec['resources'][$data['tags'][0]][$path][$method]['id'] = strtolower($method).'-'.str_replace('/', '-', $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $this->twig->render(
|
||||
'@NelmioApiDoc/SwaggerUi/index.html.twig',
|
||||
[
|
||||
'swagger_data' => ['spec' => json_decode($spec->toJson(), true)],
|
||||
'swagger_data' => ['spec' => $spec],
|
||||
'assets_mode' => $options['assets_mode'],
|
||||
'swagger_ui_config' => $options['swagger_ui_config'],
|
||||
]
|
||||
|
|
Loading…
Add table
Reference in a new issue