2019-12-20 10:49:22 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file is part of the NelmioApiDocBundle package.
|
|
|
|
*
|
|
|
|
* (c) Nelmio
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace Nelmio\ApiDocBundle\Tests\Functional\Controller;
|
|
|
|
|
|
|
|
use FOS\RestBundle\Controller\Annotations\QueryParam;
|
|
|
|
use FOS\RestBundle\Controller\Annotations\RequestParam;
|
|
|
|
use Symfony\Component\Routing\Annotation\Route;
|
2021-03-16 10:40:12 +01:00
|
|
|
use Symfony\Component\Validator\Constraints\DateTime;
|
2019-12-20 10:49:22 +01:00
|
|
|
use Symfony\Component\Validator\Constraints\IsTrue;
|
|
|
|
use Symfony\Component\Validator\Constraints\Regex;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @Route("/api", host="api.example.com")
|
|
|
|
*/
|
|
|
|
class FOSRestController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @Route("/fosrest.{_format}", methods={"POST"})
|
|
|
|
* @QueryParam(name="foo", requirements=@Regex("/^\d+$/"))
|
2020-11-03 10:10:31 +01:00
|
|
|
* @QueryParam(name="mapped", map=true)
|
2020-02-21 10:42:13 +01:00
|
|
|
* @RequestParam(name="Barraa", key="bar", requirements="\d+")
|
2019-12-20 10:49:22 +01:00
|
|
|
* @RequestParam(name="baz", requirements=@IsTrue)
|
2021-03-24 18:01:32 +01:00
|
|
|
* @RequestParam(name="datetime", requirements=@DateTime("Y-m-d\TH:i:sP"))
|
2021-03-16 11:05:00 +01:00
|
|
|
* @RequestParam(name="datetimeAlt", requirements=@DateTime("c"))
|
2021-03-24 18:01:32 +01:00
|
|
|
* @RequestParam(name="datetimeNoFormat", requirements=@DateTime())
|
2021-03-16 10:40:12 +01:00
|
|
|
* @RequestParam(name="date", requirements=@DateTime("Y-m-d"))
|
2019-12-20 10:49:22 +01:00
|
|
|
*/
|
|
|
|
public function fosrestAction()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}
|