Skip to content

Commit b555eec

Browse files
committed
phpstn
1 parent 86f42bf commit b555eec

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

src/OpenApi/Factory/OpenApiFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ private function collectPaths(ApiResource $resource, ResourceMetadataCollection
498498

499499
private function buildOpenApiResponse(array $existingResponses, int|string $status, string $description, ?Operation $openapiOperation = null, ?HttpOperation $operation = null, ?array $responseMimeTypes = null, ?array $operationOutputSchemas = null, ?ResourceMetadataCollection $resourceMetadataCollection = null): Operation
500500
{
501-
$noOutput = \is_array($operation?->getOutput()) && null === $operation?->getOutput()['class'];
501+
$noOutput = \is_array($operation?->getOutput()) && null === $operation->getOutput()['class'];
502502

503503
if (isset($existingResponses[$status])) {
504504
return $openapiOperation;

src/State/Exception/ParameterNotSupportedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getType(): string
2828
return '/error/400';
2929
}
3030

31-
public function getTitle(): ?string
31+
public function getTitle(): string
3232
{
3333
return $this->message;
3434
}

tests/Fixtures/TestBundle/ApiResource/WithParameter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,21 @@
9696
uriTemplate: 'validate_parameters{._format}',
9797
parameters: [
9898
'enum' => new QueryParameter(
99-
schema: ['enum' => ['a', 'b'], 'uniqueItems' => true, 'type' => 'string'],
99+
schema: ['enum' => ['a', 'b'], 'uniqueItems' => true, 'type' => 'array'],
100100
castToArray: true,
101101
openApi: new OpenApiParameter(name: 'enum', in: 'query', style: 'deepObject')
102102
),
103103
'enumNotDeepObject' => new QueryParameter(
104104
schema: ['enum' => ['a', 'b'], 'uniqueItems' => true, 'type' => 'string'],
105105
castToArray: true,
106+
castToNativeType: true,
106107
),
107108
'num' => new QueryParameter(
108109
schema: ['minimum' => 1, 'maximum' => 3, 'type' => 'integer'],
109110
nativeType: new BuiltinType(TypeIdentifier::STRING),
110111
),
111112
'numMultipleType' => new QueryParameter(
112-
schema: ['minimum' => 1, 'maximum' => 3, 'type' => 'integer'],
113+
schema: ['minimum' => 1, 'maximum' => 3, 'type' => 'array'],
113114
),
114115
'exclusiveNum' => new QueryParameter(
115116
schema: ['exclusiveMinimum' => 1, 'exclusiveMaximum' => 3, 'type' => 'integer'],

tests/Functional/Parameters/ValidationTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ public static function provideQueryStrings(): array
5858
[
5959
'enumNotDeepObject[]=c&enumNotDeepObject[]=c',
6060
[
61-
[
62-
'propertyPath' => 'enumNotDeepObject', 'message' => 'The value you selected is not a valid choice.',
63-
],
6461
[
6562
'propertyPath' => 'enumNotDeepObject', 'message' => 'The value you selected is not a valid choice.',
6663
],

0 commit comments

Comments
 (0)