mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
commit
6c01424a95
@ -309,7 +309,7 @@ class ApiDocExtractor
|
|||||||
|
|
||||||
foreach ($this->parsers as $parser) {
|
foreach ($this->parsers as $parser) {
|
||||||
if ($parser->supports($normalizedOutput)) {
|
if ($parser->supports($normalizedOutput)) {
|
||||||
$response = $parser->parse($normalizedOutput);
|
$response = $this->mergeParameters($response, $parser->parse($normalizedOutput));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$response = $this->clearClasses($response);
|
$response = $this->clearClasses($response);
|
||||||
|
@ -15,7 +15,7 @@ use Nelmio\ApiDocBundle\Tests\WebTestCase;
|
|||||||
|
|
||||||
class ApiDocExtractorTest extends WebTestCase
|
class ApiDocExtractorTest extends WebTestCase
|
||||||
{
|
{
|
||||||
const ROUTES_QUANTITY = 21;
|
const ROUTES_QUANTITY = 22;
|
||||||
|
|
||||||
public function testAll()
|
public function testAll()
|
||||||
{
|
{
|
||||||
|
@ -200,6 +200,15 @@ class TestController
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiDoc(
|
||||||
|
* output="Nelmio\ApiDocBundle\Tests\Fixtures\Model\MultipleTest"
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
public function zReturnJmsAndValidationOutputAction()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ApiDoc(
|
* @ApiDoc(
|
||||||
* description="Returns a collection of Object",
|
* description="Returns a collection of Object",
|
||||||
|
23
Tests/Fixtures/Model/MultipleTest.php
Normal file
23
Tests/Fixtures/Model/MultipleTest.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Nelmio\ApiDocBundle\Tests\Fixtures\Model;
|
||||||
|
|
||||||
|
use JMS\Serializer\Annotation as JMS;
|
||||||
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
|
class MultipleTest
|
||||||
|
{
|
||||||
|
public $nothing;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Assert\Type("DateTime")
|
||||||
|
*/
|
||||||
|
public $bar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @JMS\Type("DateTime")
|
||||||
|
* @JMS\SerializedName("number");
|
||||||
|
*/
|
||||||
|
public $baz;
|
||||||
|
|
||||||
|
}
|
@ -122,6 +122,10 @@ test_return_nested_output:
|
|||||||
pattern: /return-nested-output
|
pattern: /return-nested-output
|
||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:jmsReturnNestedOutput, _format: json }
|
defaults: { _controller: NelmioApiDocTestBundle:Test:jmsReturnNestedOutput, _format: json }
|
||||||
|
|
||||||
|
test_route_18:
|
||||||
|
pattern: /z-return-jms-and-validator-output
|
||||||
|
defaults: { _controller: NelmioApiDocTestBundle:Test:zReturnJmsAndValidationOutput }
|
||||||
|
|
||||||
test_route_named_resource:
|
test_route_named_resource:
|
||||||
pattern: /named-resource
|
pattern: /named-resource
|
||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:namedResource }
|
defaults: { _controller: NelmioApiDocTestBundle:Test:namedResource }
|
||||||
|
@ -468,6 +468,20 @@ param1:
|
|||||||
* type: string
|
* type: string
|
||||||
* required: true
|
* required: true
|
||||||
* description: Param1 description.
|
* description: Param1 description.
|
||||||
|
|
||||||
|
|
||||||
|
### `ANY` /z-return-jms-and-validator-output ###
|
||||||
|
|
||||||
|
|
||||||
|
#### Response ####
|
||||||
|
|
||||||
|
bar:
|
||||||
|
|
||||||
|
* type: DateTime
|
||||||
|
|
||||||
|
number:
|
||||||
|
|
||||||
|
* type: DateTime
|
||||||
MARKDOWN;
|
MARKDOWN;
|
||||||
|
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result);
|
||||||
|
@ -820,6 +820,30 @@ With multiple lines.',
|
|||||||
'authenticationRoles' => array(),
|
'authenticationRoles' => array(),
|
||||||
'deprecated' => false,
|
'deprecated' => false,
|
||||||
),
|
),
|
||||||
|
15 =>
|
||||||
|
array(
|
||||||
|
'method' => 'ANY',
|
||||||
|
'uri' => '/z-return-jms-and-validator-output',
|
||||||
|
'https' => false,
|
||||||
|
'authentication' => false,
|
||||||
|
'deprecated' => false,
|
||||||
|
'response' => array (
|
||||||
|
'bar' => array(
|
||||||
|
'dataType' => 'DateTime',
|
||||||
|
'required' => null,
|
||||||
|
'readonly' => null
|
||||||
|
),
|
||||||
|
'number' => array(
|
||||||
|
'dataType' => 'DateTime',
|
||||||
|
'required' => false,
|
||||||
|
'description' => '',
|
||||||
|
'readonly' => false,
|
||||||
|
'sinceVersion' => null,
|
||||||
|
'untilVersion' => null
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'authenticationRoles' => array(),
|
||||||
|
)
|
||||||
),
|
),
|
||||||
'/tests2' =>
|
'/tests2' =>
|
||||||
array(
|
array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user