|
28 | 28 | use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; |
29 | 29 | use Symfony\Component\Serializer\Attribute\Groups; |
30 | 30 | use Symfony\Component\TypeInfo\Type\BuiltinType; |
| 31 | +use Symfony\Component\TypeInfo\Type\CollectionType; |
| 32 | +use Symfony\Component\TypeInfo\Type\GenericType; |
| 33 | +use Symfony\Component\TypeInfo\Type\UnionType; |
31 | 34 | use Symfony\Component\TypeInfo\TypeIdentifier; |
32 | 35 | use Symfony\Component\Validator\Constraints\All; |
33 | 36 | use Symfony\Component\Validator\Constraints as Assert; |
|
61 | 64 | #[GetCollection( |
62 | 65 | uriTemplate: 'with_parameters_country{._format}', |
63 | 66 | parameters: [ |
64 | | - 'country' => new QueryParameter(schema: ['type' => 'string'], constraints: [new Country()]), |
| 67 | + 'country' => new QueryParameter( |
| 68 | + schema: ['type' => 'string'], |
| 69 | + constraints: [new Country()], |
| 70 | + nativeType: new UnionType( |
| 71 | + new BuiltinType(TypeIdentifier::STRING), |
| 72 | + new CollectionType( |
| 73 | + new GenericType( // @phpstan-ignore-line |
| 74 | + new BuiltinType(TypeIdentifier::ARRAY), // @phpstan-ignore-line |
| 75 | + new BuiltinType(TypeIdentifier::INT), |
| 76 | + new BuiltinType(TypeIdentifier::STRING), |
| 77 | + ), |
| 78 | + true, |
| 79 | + ), |
| 80 | + ) |
| 81 | + ), |
65 | 82 | ], |
66 | 83 | provider: [self::class, 'collectionProvider'] |
67 | 84 | )] |
|
104 | 121 | nativeType: new BuiltinType(TypeIdentifier::STRING), |
105 | 122 | ), |
106 | 123 | 'pattern' => new QueryParameter( |
107 | | - schema: ['pattern' => '\d'], |
108 | | - nativeType: new BuiltinType(TypeIdentifier::STRING), |
| 124 | + schema: ['pattern' => '\d', 'type' => 'string'], |
109 | 125 | ), |
110 | 126 | ], |
111 | 127 | provider: [self::class, 'collectionProvider'] |
|
0 commit comments