Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Documentation is deprecated #2322

Open
4d4ch4u32 opened this issue Jul 18, 2024 · 4 comments
Open

[Bug]: Documentation is deprecated #2322

4d4ch4u32 opened this issue Jul 18, 2024 · 4 comments
Labels

Comments

@4d4ch4u32
Copy link

4d4ch4u32 commented Jul 18, 2024

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.

@4d4ch4u32 4d4ch4u32 added the bug label Jul 18, 2024
@tworzenieweb
Copy link

can you provide the correct version? I'm also struggling with this

@4d4ch4u32
Copy link
Author

This is the version I have added via composer. But the OA\JsonContent-Object has no property type which accepts string as value 🤷‍♂️

@tworzenieweb
Copy link

tworzenieweb commented Jul 26, 2024

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants