core
core copied to clipboard
'openapi' key doesn't work in getDescription method ApiPlatform\Doctrine\Orm\Filter\FilterInterface
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
- Create a custom filter implementing interface ApiPlatform\Doctrine\Orm\Filter\FilterInterface
- Implement the getDescription method like the two examples above
- See the first example doesn't work, but the second does
https://github.com/api-platform/core/blob/main/src/OpenApi/Factory/OpenApiFactory.php#L636
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.