-
-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot generate IRI errors when enabling rfc_7807_compliant_errors
#6718
Comments
Hi @darthf1 API Platform was not able to gather identifiers from Organization, can you maybe |
What I found so far (I put some breakpoints in my app):
|
Yes absolutely! But that error is not handled gracefully anymore. My tests does: public function testGetOwnOrganisationWhenNotMemberOfOrganisationThrowsHttpNotFound(): void
{
$referenceRepository = self::loadFixtures([
UserTestFixture::class,
OrganisationTestFixture::class,
]);
$user3 = $referenceRepository->getReference(UserTestFixture::USER_3, User::class);
$client = self::createAuthenticatedClient('[email protected]', 'user_3');
$client->request('GET', \sprintf('/v1/users/%s/organisation', $user3->getId()));
self::assertResponseStatusCodeSame(Response::HTTP_NOT_FOUND);
}
|
May you provide a reproducer please? |
API Platform version(s) affected: 3.4.3
Description
I'm trying to enable
rfc_7807_compliant_errors
as an upgrade path to v4. When I do this, in my project, not only the error output changes (obviously), but I also get:How to reproduce
I have the following code:
I have two test cases:
The following happens:
rfc_7807_compliant_errors
tofalse
, both test cases succeed.rfc_7807_compliant_errors
totrue
, the second test case throws:ApiPlatform\Metadata\Exception\InvalidArgumentException: Unable to generate an IRI for the item of type "App\Organisation"
. When I then remove the line'item_uri_template' => '/organisations/{id}',
from the operation, the test succeeds again.Additional Context
My (partial) config:
Full stacktrace:
The text was updated successfully, but these errors were encountered: