[Bug]: Documentation is deprecated
Opened this issue · 4 comments
4d4ch4u32 commented
Version
4.28.0
Description
The documentation is deprecated.
For example,
response: 200,
description: 'Returns the rewards of an user',
content: new OA\JsonContent(
type: 'array',
items: new OA\Items(ref: new Model(type: AlbumDto::class, groups: ['full']))
)
)]
is not correct.
Please update the docs.
tworzenieweb commented
can you provide the correct version? I'm also struggling with this
4d4ch4u32 commented
This is the version I have added via composer. But the OA\JsonContent
-Object has no property type
which accepts string
as value 🤷♂️
tworzenieweb commented
I just checked and the workign version for me is:
use Nelmio\ApiDocBundle\Annotation\Model;
#[OA\Response(
response: 200,
description: "Returns the list of customers",
content: new OA\JsonContent(
type: "array",
items: new OA\Items(ref: new Model(type: Customer::class))
)
)]
under
"nelmio/api-doc-bundle": "^4.29",
DjordyKoert commented
This is the version I have added via composer. But the OA\JsonContent-Object has no property type which accepts string as value 🤷♂️
swagger-php provides 2 JsonContent
classes.
One for annotations
use OpenApi/Annotations as OA
And one for attributes (the one you are using)
use OpenApi/Attributes as OA
I think you are using the wrong namespace (and thus the wrong class), updating your import should fix this issue.