mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +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) {
|
foreach ($annotations as $annot) {
|
||||||
if ($annot instanceof PreAuthorize) {
|
if ($annot instanceof PreAuthorize) {
|
||||||
$annotation->setAuthentication(true);
|
$annotation->setAuthentication(true);
|
||||||
} else if ($annot instanceof Secure) {
|
} elseif ($annot instanceof Secure) {
|
||||||
$annotation->setAuthentication(true);
|
$annotation->setAuthentication(true);
|
||||||
$annotation->setAuthenticationRoles(is_array($annot->roles) ? $annot->roles : explode(',', $annot->roles));
|
$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)
|
public function parse(array $input)
|
||||||
{
|
{
|
||||||
$className = $input['class'];
|
$className = $input['class'];
|
||||||
|
|
||||||
return $this->doParse($className, array());
|
return $this->doParse($className, array());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +63,7 @@ class ValidationParser implements ParserInterface, PostParserInterface
|
|||||||
* @param array $visited
|
* @param array $visited
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function doParse ($className, array $visited)
|
protected function doParse($className, array $visited)
|
||||||
{
|
{
|
||||||
$params = array();
|
$params = array();
|
||||||
$classdata = $this->factory->getMetadataFor($className);
|
$classdata = $this->factory->getMetadataFor($className);
|
||||||
|
@ -200,6 +200,15 @@ class TestController
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiDoc(
|
||||||
|
* output="Nelmio\ApiDocBundle\Tests\Fixtures\Model\JmsChild"
|
||||||
|
* )
|
||||||
|
*/
|
||||||
|
public function jmsReturnNestedExtendedOutputAction()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ApiDoc(
|
* @ApiDoc(
|
||||||
* output="Nelmio\ApiDocBundle\Tests\Fixtures\Model\MultipleTest"
|
* 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
|
pattern: /return-nested-output
|
||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:jmsReturnNestedOutput, _format: json }
|
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:
|
test_route_18:
|
||||||
pattern: /z-return-jms-and-validator-output
|
pattern: /z-return-jms-and-validator-output
|
||||||
defaults: { _controller: NelmioApiDocTestBundle:Test:zReturnJmsAndValidationOutput }
|
defaults: { _controller: NelmioApiDocTestBundle:Test:zReturnJmsAndValidationOutput }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user