@@ -1534,6 +1534,7 @@ use ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface;
15341534use ApiPlatform\M etadata\O peration;
15351535use Doctrine\O RM\Q ueryBuilder;
15361536use Symfony\C omponent\P ropertyInfo\T ype;
1537+ use ApiPlatform\O penApi\M odel\P arameter;
15371538
15381539final class RegexpFilter extends AbstractFilter
15391540{
@@ -1567,12 +1568,14 @@ final class RegexpFilter extends AbstractFilter
15671568 'type' => Type::BUILTIN_TYPE_STRING,
15681569 'required' => false,
15691570 '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+ ),
15761579 ];
15771580 }
15781581
0 commit comments