Skip to content

Commit 9332442

Browse files
committed
Merge 3.4
2 parents 5aa7993 + a11c213 commit 9332442

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ Notes:
130130

131131
* [0d5f35683](https://github.com/api-platform/core/commit/0d5f356839eb6aa9f536044abe4affa736553e76) feat(laravel): laravel component (#5882)
132132

133+
## v3.4.3
134+
135+
### Bug fixes
136+
137+
* [3ca599158](https://github.com/api-platform/core/commit/3ca599158139d56fbd6ee66f2de3e586120d735c) fix(hydra): hydra_prefix on errors (#6704)
138+
* [f7f605dc8](https://github.com/api-platform/core/commit/f7f605dc8b798b975d2286c970c9091436d7f890) fix: check that api-platform/ramsey-uuid is installed before registering related services (#6696)
139+
* [fbb53e5e3](https://github.com/api-platform/core/commit/fbb53e5e35ca0ec3de26ddc7de7ea4d1dda5c20b) fix(symfony): metadata aware name converter has 0 arguments by default (#6711)
140+
133141
## v3.4.2
134142

135143
### Bug fixes

docs/guides/error-resource.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ class MyDomainException extends \Exception implements ProblemExceptionInterface
1818
{
1919
public function getType(): string
2020
{
21-
return 'teapot';
21+
return '/errors/418';
2222
}
2323

2424
public function getTitle(): ?string
2525
{
26-
return null;
26+
return 'Teapot error';
2727
}
2828

2929
public function getStatus(): ?int
@@ -40,6 +40,8 @@ public function getInstance(): ?string
4040
{
4141
return null;
4242
}
43+
44+
public string $myCustomField = 'I usually prefer coffee.';
4345
}
4446

4547
use ApiPlatform\Metadata\ApiResource;
@@ -83,7 +85,12 @@ public function testBookDoesNotExists(): void
8385
// you can override this by looking at the [Error Provider guide](/docs/guides/error-provider).
8486
$this->assertResponseStatusCodeSame(418);
8587
$this->assertJsonContains([
88+
'@id' => '/my_domain_exceptions',
89+
'@type' => 'MyDomainException',
90+
'type' => '/errors/418',
91+
'title' => 'Teapot error',
8692
'detail' => 'I am teapot',
93+
'myCustomField' => 'I usually prefer coffee.'
8794
]);
8895
}
8996
}

0 commit comments

Comments
 (0)