Skip to content

Commit f82d343

Browse files
authored
fix(metadata): ApiProperty::$example mixed instead of string|null (api-platform#4922)
Fixes api-platform#4911
1 parent babfaef commit f82d343

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Metadata/ApiProperty.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class ApiProperty
2929
* @param bool|null $required https://api-platform.com/docs/admin/validation/#client-side-validation
3030
* @param bool|null $identifier https://api-platform.com/docs/core/identifiers/
3131
* @param string|null $default
32-
* @param string|null $example https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
32+
* @param mixed $example https://api-platform.com/docs/core/openapi/#using-the-openapi-and-swagger-contexts
3333
* @param string|null $deprecationReason https://api-platform.com/docs/core/deprecations/#deprecating-resource-classes-operations-and-properties
3434
* @param bool|null $fetchEager https://api-platform.com/docs/core/performance/#eager-loading
3535
* @param array|null $jsonldContext https://api-platform.com/docs/core/extending-jsonld-context/#extending-json-ld-and-hydra-contexts
@@ -50,7 +50,7 @@ public function __construct(
5050
private ?bool $required = null,
5151
private ?bool $identifier = null,
5252
private $default = null,
53-
private $example = null,
53+
private mixed $example = null,
5454
private ?string $deprecationReason = null,
5555
private ?bool $fetchable = null,
5656
private ?bool $fetchEager = null,
@@ -176,12 +176,12 @@ public function withDefault($default): self
176176
return $self;
177177
}
178178

179-
public function getExample()
179+
public function getExample(): mixed
180180
{
181181
return $this->example;
182182
}
183183

184-
public function withExample($example): self
184+
public function withExample(mixed $example): self
185185
{
186186
$self = clone $this;
187187
$self->example = $example;

0 commit comments

Comments
 (0)