mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
[Test] Extended Class test case
This commit is contained in:
parent
cb8b0c6f90
commit
dc9c706b51
@ -24,7 +24,7 @@ class JmsSecurityExtraHandler implements HandlerInterface
|
||||
foreach ($annotations as $annot) {
|
||||
if ($annot instanceof PreAuthorize) {
|
||||
$annotation->setAuthentication(true);
|
||||
} else if ($annot instanceof Secure) {
|
||||
} elseif ($annot instanceof Secure) {
|
||||
$annotation->setAuthentication(true);
|
||||
$annotation->setAuthenticationRoles(is_array($annot->roles) ? $annot->roles : explode(',', $annot->roles));
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ class ValidationParser implements ParserInterface, PostParserInterface
|
||||
public function parse(array $input)
|
||||
{
|
||||
$className = $input['class'];
|
||||
|
||||
return $this->doParse($className, array());
|
||||
}
|
||||
|
||||
@ -62,7 +63,7 @@ class ValidationParser implements ParserInterface, PostParserInterface
|
||||
* @param array $visited
|
||||
* @return array
|
||||
*/
|
||||
protected function doParse ($className, array $visited)
|
||||
protected function doParse($className, array $visited)
|
||||
{
|
||||
$params = array();
|
||||
$classdata = $this->factory->getMetadataFor($className);
|
||||
|
@ -200,6 +200,15 @@ class TestController
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @ApiDoc(
|
||||
* output="Nelmio\ApiDocBundle\Tests\Fixtures\Model\JmsChild"
|
||||
* )
|
||||
*/
|
||||
public function jmsReturnNestedExtendedOutputAction()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @ApiDoc(
|
||||
* output="Nelmio\ApiDocBundle\Tests\Fixtures\Model\MultipleTest"
|
||||
|
13
Tests/Fixtures/Model/JmsChild.php
Normal file
13
Tests/Fixtures/Model/JmsChild.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
namespace Nelmio\ApiDocBundle\Tests\Fixtures\Model;
|
||||
|
||||
use JMS\Serializer\Annotation as JMS;
|
||||
|
||||
class JmsChild extends JmsTest
|
||||
{
|
||||
/**
|
||||
* @JMS\Type("string");
|
||||
*/
|
||||
public $child;
|
||||
|
||||
}
|
@ -122,6 +122,10 @@ test_return_nested_output:
|
||||
pattern: /return-nested-output
|
||||
defaults: { _controller: NelmioApiDocTestBundle:Test:jmsReturnNestedOutput, _format: json }
|
||||
|
||||
test_return_nested_extend_output:
|
||||
pattern: /return-nested-extend-output
|
||||
defaults: { _controller: NelmioApiDocTestBundle:Test:jmsReturnNestedExtendOutput, _format: json }
|
||||
|
||||
test_route_18:
|
||||
pattern: /z-return-jms-and-validator-output
|
||||
defaults: { _controller: NelmioApiDocTestBundle:Test:zReturnJmsAndValidationOutput }
|
||||
|
Loading…
x
Reference in New Issue
Block a user