Skip to content

Commit baecd8e

Browse files
committed
Fix #4124
1 parent d6f7c59 commit baecd8e

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

src/OpenApi/Factory/OpenApiFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ private function getFiltersParameters(ResourceMetadata $resourceMetadata, string
419419
$schema,
420420
'array' === $schema['type'] && \in_array($data['type'],
421421
[Type::BUILTIN_TYPE_ARRAY, Type::BUILTIN_TYPE_OBJECT], true) ? 'deepObject' : 'form',
422-
'array' === $schema['type'],
422+
$data['openapi']['explode'] ?? ('array' === $schema['type']),
423423
$data['openapi']['allowReserved'] ?? false,
424424
$data['openapi']['example'] ?? null,
425425
isset($data['openapi']['examples']

src/OpenApi/Model/Encoding.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,21 @@ public function canExplode(): bool
5252
return $this->explode;
5353
}
5454

55+
public function getExplode(): bool
56+
{
57+
return $this->explode;
58+
}
59+
5560
public function canAllowReserved(): bool
5661
{
5762
return $this->allowReserved;
5863
}
5964

65+
public function getAllowReserved(): bool
66+
{
67+
return $this->allowReserved;
68+
}
69+
6070
public function withContentType(string $contentType): self
6171
{
6272
$clone = clone $this;

src/OpenApi/Model/Parameter.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function getDeprecated(): bool
8383
return $this->deprecated;
8484
}
8585

86-
public function canAllowEmptyValue(): bool
86+
public function getAllowEmptyValue(): bool
8787
{
8888
return $this->allowEmptyValue;
8989
}
@@ -103,11 +103,21 @@ public function canExplode(): bool
103103
return $this->explode;
104104
}
105105

106+
public function getExplode(): bool
107+
{
108+
return $this->explode;
109+
}
110+
106111
public function canAllowReserved(): bool
107112
{
108113
return $this->allowReserved;
109114
}
110115

116+
public function getAllowReserved(): bool
117+
{
118+
return $this->allowReserved;
119+
}
120+
111121
public function getExample()
112122
{
113123
return $this->example;

tests/OpenApi/Factory/OpenApiFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function testInvoke(): void
158158
'type' => 'string',
159159
'required' => true,
160160
'strategy' => 'exact',
161-
'openapi' => ['example' => 'bar', 'deprecated' => true, 'allowEmptyValue' => true, 'allowReserved' => true],
161+
'openapi' => ['example' => 'bar', 'deprecated' => true, 'allowEmptyValue' => true, 'allowReserved' => true, 'explode' => true],
162162
]]),
163163
'f2' => new DummyFilter(['ha' => [
164164
'property' => 'foo',
@@ -517,7 +517,7 @@ public function testInvoke(): void
517517
]),
518518
new Model\Parameter('name', 'query', '', true, true, true, [
519519
'type' => 'string',
520-
], 'form', false, true, 'bar'),
520+
], 'form', true, true, 'bar'),
521521
new Model\Parameter('ha', 'query', '', false, false, true, [
522522
'type' => 'integer',
523523
]),

0 commit comments

Comments
 (0)