You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
25 Parameter $ref of class OpenApi\Attributes\Property constructor
expects string|null, Nelmio\ApiDocBundle\Annotation\Model given.
31 Parameter $content of class OpenApi\Attributes\Response constructor
expects
array<OpenApi\Annotations\JsonContent|OpenApi\Annotations\MediaType|O
penApi\Annotations\XmlContent>|OpenApi\Annotations\JsonContent|OpenAp
i\Annotations\MediaType|OpenApi\Annotations\XmlContent|null,
Nelmio\ApiDocBundle\Annotation\Model given.
Src:
<?php
declare(strict_types=1);
namespace App\Controller\Api;
use App\Request\Api\Config\ConfigRequest;
use App\Response\Api\ConfigResponse;
use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Attributes as OA;
use Symfony\Component\HttpFoundation\{Request, Response};
use Symfony\Component\Routing\Annotation\Route;
#[OA\Tag(name: 'Config')]
class ConfigController extends AbstractApiController
{
#[OA\Post(
requestBody: new OA\RequestBody(
content: new OA\JsonContent(
properties: [
new OA\Property(property: 'request_data', ref: new Model(type: ConfigRequest::class)),
new OA\Property(property: 'ts', type: 'string'),
]
)
),
responses: [
new OA\Response(response: Response::HTTP_OK, description: 'success', content: new Model(type: ConfigResponse::class)),
new OA\Response(response: '4XX/5XX', description: 'error'),
]
)]
#[Route('/api/config', methods: [Request::METHOD_POST])]
public function getConfig(
): Response {
return $this->json('XXX');
}
}
The text was updated successfully, but these errors were encountered:
use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Attributes as OpenApi;
use Symfony\Component\HttpFoundation\Response;
#[OpenApi\Response(
response: Response::HTTP_OK,
description: 'Response when data was successfully returned.',
content: new OpenApi\JsonContent(
type: 'array',
items: new OpenApi\Items(
ref: new Model(type: Expert::class)
)
)
)]
Hi, I am use
"nelmio/api-doc-bundle": "^4.9"
After fix 6e13ebb#diff-8962249d92fe80c501dbd3daac234614f6ea464693982f14ac70822549bfcd3aL23
I got an error:
Src:
The text was updated successfully, but these errors were encountered: