for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Controller;
use OpenApi\Annotations as OA;
use Psr\Http\Message\ResponseInterface;
use Yiisoft\DataResponse\DataResponseFactoryInterface;
/**
* @OA\Info(title="Yii API application", version="1.0")
*/
class IndexController
{
* @OA\Get(
* path="/",
* summary="Returns info about the API",
* description="",
*
* @OA\Response(
* response="200",
* description="Success",
* @OA\JsonContent(
* allOf={
* @OA\Schema(ref="#/components/schemas/Response"),
* @OA\Schema(
* @OA\Property(
* property="data",
* type="object",
* property="version",
* type="string",
* example="3.0"
* ),
* property="author",
* example="yiisoft"
* },
* )
public function index(DataResponseFactoryInterface $responseFactory): ResponseInterface
return $responseFactory->createResponse(['version' => '3.0', 'author' => 'yiisoft']);
}