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-11-14 23:59:06 +01:00
|
|
|
use FOS\RestBundle\Controller\Annotations\RequestParam;
|
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;
|
2013-03-27 16:20:42 +01:00
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
|
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
|
|
|
|
2013-03-21 12:15:44 +01:00
|
|
|
/**
|
|
|
|
* @ApiDoc(
|
|
|
|
* description="post test 2",
|
|
|
|
* resource=true
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function postTest2Action()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
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-11-19 18:21:12 +01:00
|
|
|
* output="dependency_type"
|
2012-08-27 12:56:19 -04:00
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function jmsReturnTestAction()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-11-14 23:59:06 +01:00
|
|
|
/**
|
|
|
|
* @ApiDoc()
|
2013-02-15 11:37:02 +01:00
|
|
|
* @RequestParam(name="param1", requirements="string", description="Param1 description.")
|
2012-11-14 23:59:06 +01:00
|
|
|
*/
|
|
|
|
public function zActionWithRequestParamAction()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-12-10 10:21:04 -08:00
|
|
|
/**
|
|
|
|
* @ApiDoc()
|
|
|
|
*/
|
|
|
|
public function secureRouteAction()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-12-26 12:23:28 +01:00
|
|
|
/**
|
|
|
|
* @ApiDoc(
|
|
|
|
* authentication=true
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
public function authenticatedAction()
|
|
|
|
{
|
|
|
|
}
|
2013-03-27 16:20:42 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @ApiDoc()
|
|
|
|
* @Cache(maxage=60, public=1)
|
|
|
|
*/
|
|
|
|
public function cachedAction()
|
|
|
|
{
|
|
|
|
}
|
2012-04-13 14:11:54 +02:00
|
|
|
}
|