2012-04-13 14:11:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the NelmioApiDocBundle.
|
|
|
|
*
|
|
|
|
* (c) Nelmio <hello@nelm.io>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Nelmio\ApiDocBundle\Tests\Fixtures\Controller;
|
|
|
|
|
2012-07-20 00:58:58 +02:00
|
|
|
use FOS\RestBundle\Controller\Annotations\QueryParam;
|
2012-04-13 14:11:54 +02:00
|
|
|
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
|
2012-04-13 15:18:54 +02:00
|
|
|
use Symfony\Component\HttpFoundation\Response;
|
2012-04-13 14:11:54 +02:00
|
|
|
|
|
|
|
class TestController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @ApiDoc(
|
|
|
|
* resource=true,
|
|
|
|
* description="index action",
|
|
|
|
* filters={
|
|
|
|
* {"name"="a", "dataType"="integer"},
|
|
|
|
* {"name"="b", "dataType"="string", "arbitrary"={"arg1", "arg2"}}
|
|
|
|
* }
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function indexAction()
|
|
|
|
{
|
2012-04-13 15:18:54 +02:00
|
|
|
return new Response('tests');
|
2012-04-13 14:11:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ApiDoc(
|
|
|
|
* description="create test",
|
2012-07-24 14:39:43 -04:00
|
|
|
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Form\TestType"
|
2012-04-13 14:11:54 +02:00
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function postTestAction()
|
|
|
|
{
|
|
|
|
}
|
2012-04-13 14:42:28 +02:00
|
|
|
|
|
|
|
public function anotherAction()
|
|
|
|
{
|
|
|
|
}
|
2012-04-13 15:00:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ApiDoc(description="Action without HTTP verb")
|
|
|
|
*/
|
|
|
|
public function anyAction()
|
|
|
|
{
|
|
|
|
}
|
2012-04-19 16:23:26 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This method is useful to test if the getDocComment works.
|
2012-04-19 17:17:36 +02:00
|
|
|
* And, it supports multilines until the first '@' char.
|
2012-04-19 16:23:26 +02:00
|
|
|
*
|
|
|
|
* @ApiDoc()
|
2012-04-19 20:27:27 +02:00
|
|
|
*
|
2012-05-23 00:33:01 +02:00
|
|
|
* @param int $id A nice comment
|
2012-05-07 12:51:22 +02:00
|
|
|
* @param int $page
|
2012-04-19 16:23:26 +02:00
|
|
|
*/
|
|
|
|
public function myCommentedAction()
|
|
|
|
{
|
|
|
|
}
|
2012-04-19 20:27:27 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ApiDoc()
|
|
|
|
*/
|
|
|
|
public function yetAnotherAction()
|
|
|
|
{
|
|
|
|
}
|
2012-06-21 00:12:21 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ApiDoc(
|
|
|
|
* description="create another test",
|
2012-07-24 14:39:43 -04:00
|
|
|
* input="dependency_type"
|
2012-06-21 00:12:21 +02:00
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function anotherPostAction()
|
|
|
|
{
|
|
|
|
}
|
2012-07-20 00:58:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ApiDoc()
|
|
|
|
* @QueryParam(name="page", requirements="\d+", default="1", description="Page of the overview.")
|
|
|
|
*/
|
|
|
|
public function zActionWithQueryParamAction()
|
|
|
|
{
|
|
|
|
}
|
2012-08-07 21:57:36 -04:00
|
|
|
|
2012-08-07 17:50:58 -04:00
|
|
|
/**
|
|
|
|
* @ApiDoc(
|
|
|
|
* description="Testing JMS",
|
|
|
|
* input="Nelmio\ApiDocBundle\Tests\Fixtures\Model\JmsTest"
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function jmsInputTestAction()
|
|
|
|
{
|
|
|
|
}
|
2012-08-27 12:56:19 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ApiDoc(
|
|
|
|
* description="Testing return",
|
2012-08-27 13:25:03 -04:00
|
|
|
* return="dependency_type"
|
2012-08-27 12:56:19 -04:00
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function jmsReturnTestAction()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-04-13 14:11:54 +02:00
|
|
|
}
|