for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App;
use Psr\Http\Message\ResponseInterface;
use Yiisoft\DataResponse\DataResponseFactoryInterface;
use OpenApi\Annotations as OA;
/**
* @OA\Info(title="Yii API application", version="1.0")
*/
class InfoController
{
public function __construct(private VersionProvider $versionProvider)
}
* @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' => $this->versionProvider->version, 'author' => 'yiisoft']);