mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
Added 'type' to API item if applicable.
This commit is contained in:
parent
9d3c0a8c29
commit
abaeb374e8
@ -246,6 +246,8 @@ class SwaggerFormatter implements FormatterInterface
|
||||
);
|
||||
}
|
||||
|
||||
$type = isset($responseMessages[200]['responseModel']) ? $responseMessages[200]['responseModel'] : null;
|
||||
|
||||
foreach ($apiDoc->getRoute()->getMethods() as $method) {
|
||||
$operation = array(
|
||||
'method' => $method,
|
||||
@ -255,6 +257,10 @@ class SwaggerFormatter implements FormatterInterface
|
||||
'responseMessages' => array_values($responseMessages),
|
||||
);
|
||||
|
||||
if ($type !== null) {
|
||||
$operation['type'] = $type;
|
||||
}
|
||||
|
||||
$apiBag[$path][] = $operation;
|
||||
}
|
||||
}
|
||||
|
@ -237,6 +237,7 @@ class SwaggerFormatterTest extends WebTestCase
|
||||
'responseModel' => 'Nelmio.ApiDocBundle.Tests.Fixtures.Model.JmsNested',
|
||||
),
|
||||
),
|
||||
'type' => 'Nelmio.ApiDocBundle.Tests.Fixtures.Model.JmsNested',
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user