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

'openapi' key doesn't work in getDescription method ApiPlatform\Doctrine\Orm\Filter\FilterInterface #6353

Open
mikec655 opened this issue May 6, 2024 · 1 comment

Comments

@mikec655
Copy link

mikec655 commented May 6, 2024

API Platform version(s) affected: 3.2.19

Description

    {
        return [
            self::PROPERTY_NAME => [
                'property' => self::PROPERTY_NAME ,
                'type' => Type::BUILTIN_TYPE_ARRAY,
                'required' => false,
                'openapi' => [
                    'name' => self::PROPERTY_NAME,
                    'schema' => [
                        'type' => 'array',
                        'item' => [
                            'type' => 'string'
                        ]
                    ],
                ],
            ],
        ];
    }

In the above code anything in the 'openapi' is not shown in the openapi docs.

    {
        return [
            self::PROPERTY_NAME => [
                'property' => self::PROPERTY_NAME,
                'type' => Type::BUILTIN_TYPE_ARRAY,
                'required' => false,
                'schema' => [
                    'type' => 'array',
                    'items' => [
                        'type' => 'string'
                    ]
                ],
            ],
        ];
    }

But placing the properties outside of 'openapi' does change the openapi docs. This is against what the ApiPlatfrom docs says on this page: https://api-platform.com/docs/core/filters/.

How to reproduce

  1. Create a custom filter implementing interface ApiPlatform\Doctrine\Orm\Filter\FilterInterface
  2. Implement the getDescription method like the two examples above
  3. See the first example doesn't work, but the second does
@soyuka
Copy link
Member

soyuka commented May 7, 2024

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

No branches or pull requests

2 participants