@@ -1534,6 +1534,7 @@ use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
1534
1534
use ApiPlatform\M etadata\O peration;
1535
1535
use Doctrine\O RM\Q ueryBuilder;
1536
1536
use Symfony\C omponent\P ropertyInfo\T ype;
1537
+ use ApiPlatform\O penApi\M odel\P arameter;
1537
1538
1538
1539
final class RegexpFilter extends AbstractFilter
1539
1540
{
@@ -1567,12 +1568,14 @@ final class RegexpFilter extends AbstractFilter
1567
1568
'type' => Type::BUILTIN_TYPE_STRING,
1568
1569
'required' => false,
1569
1570
'description' => 'Filter using a regex. This will appear in the OpenApi documentation!',
1570
- 'openapi' => [
1571
- 'example' => 'Custom example that will be in the documentation and be the default value of the sandbox',
1572
- 'allowReserved' => false,// if true, query parameters will be not percent-encoded
1573
- 'allowEmptyValue' => true,
1574
- 'explode' => false, // to be true, the type must be Type::BUILTIN_TYPE_ARRAY, ?product=blue,green will be ?product=blue&product=green
1575
- ],
1571
+ 'openapi' => new Parameter(
1572
+ name: $property,
1573
+ in: 'query',
1574
+ allowEmptyValue: true,
1575
+ explode: false, // to be true, the type must be Type::BUILTIN_TYPE_ARRAY, ?product=blue,green will be ?product=blue&product=green
1576
+ allowReserved: false, // if true, query parameters will be not percent-encoded
1577
+ example: 'Custom example that will be in the documentation and be the default value of the sandbox',
1578
+ ),
1576
1579
];
1577
1580
}
1578
1581
0 commit comments