You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem when creating a new record using DTO and Processor, when sending the data the following message is returned: Unable to generate an IRI for the item of type "App\Entity\Client""
That is not explicit in the documentation, if I should use a custom controller.
I have done the test with the controller and it works, but even so, if the documentation is not complete, more cases like mine will be presented, so the most basic thing is to understand that a bug can occur.
I will take your recommendation into account, but if I have problems again I will request "SUPPORT QUESTION" again.
Hi everyone
I have a problem when creating a new record using DTO and Processor, when sending the data the following message is returned: Unable to generate an IRI for the item of type "App\Entity\Client""
I have followed the process in the documentation but it doesn't work: https://api-platform.com/docs/core/dto/
This is the code I generated:
DTO
PROCESSOR
ENTITY
RESPONSE ERROR
{
"@context": "/api/contexts/Error",
"@type": "hydra:Error",
"hydra:title": "An error occurred",
"hydra:description": "Unable to generate an IRI for the item of type "App\Entity\Client"",
"trace": [
{
"namespace": "",
"short_class": "",
"class": "",
"type": "",
"function": "",
"file": "/var/www/vendor/api-platform/core/src/Symfony/Routing/IriConverter.php",
"line": 151,
"args": []
},
{
"namespace": "ApiPlatform\Symfony\Routing",
"short_class": "IriConverter",
"class": "ApiPlatform\Symfony\Routing\IriConverter",
"type": "->",
"function": "getIriFromResource",
"file": "/var/www/vendor/api-platform/core/src/Symfony/EventListener/WriteListener.php",
"line": 104,
"args": [
[
"object",
"App\Entity\Client"
]
]
},
{
"namespace": "ApiPlatform\Symfony\EventListener",
"short_class": "WriteListener",
"class": "ApiPlatform\Symfony\EventListener\WriteListener",
"type": "->",
"function": "onKernelView",
"file": "/var/www/vendor/symfony/event-dispatcher/Debug/WrappedListener.php",
"line": 115,
"args": [
[
"object",
"Symfony\Component\HttpKernel\Event\ViewEvent"
],
[
"string",
"kernel.view"
],
[
"object",
"Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher"
]
]
},
{
"namespace": "Symfony\Component\EventDispatcher\Debug",
"short_class": "WrappedListener",
"class": "Symfony\Component\EventDispatcher\Debug\WrappedListener",
"type": "->",
"function": "__invoke",
"file": "/var/www/vendor/symfony/event-dispatcher/EventDispatcher.php",
"line": 230,
"args": [
[
"object",
"Symfony\Component\HttpKernel\Event\ViewEvent"
],
[
"string",
"kernel.view"
],
[
"object",
"Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher"
]
]
},
{
"namespace": "Symfony\Component\EventDispatcher",
"short_class": "EventDispatcher",
"class": "Symfony\Component\EventDispatcher\EventDispatcher",
"type": "->",
"function": "callListeners",
"file": "/var/www/vendor/symfony/event-dispatcher/EventDispatcher.php",
"line": 59,
"args": [
[
"array",
[
[
"object",
"Symfony\Component\EventDispatcher\Debug\WrappedListener"
],
[
"object",
"Symfony\Component\EventDispatcher\Debug\WrappedListener"
],
[
"object",
"Symfony\Component\EventDispatcher\Debug\WrappedListener"
],
[
"object",
"Symfony\Component\EventDispatcher\Debug\WrappedListener"
],
[
"object",
"Symfony\Component\EventDispatcher\Debug\WrappedListener"
]
]
],
[
"string",
"kernel.view"
],
[
"object",
"Symfony\Component\HttpKernel\Event\ViewEvent"
]
]
},
{
"namespace": "Symfony\Component\EventDispatcher",
"short_class": "EventDispatcher",
"class": "Symfony\Component\EventDispatcher\EventDispatcher",
"type": "->",
"function": "dispatch",
"file": "/var/www/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php",
"line": 153,
"args": [
[
"object",
"Symfony\Component\HttpKernel\Event\ViewEvent"
],
[
"string",
"kernel.view"
]
]
},
{
"namespace": "Symfony\Component\EventDispatcher\Debug",
"short_class": "TraceableEventDispatcher",
"class": "Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher",
"type": "->",
"function": "dispatch",
"file": "/var/www/vendor/symfony/http-kernel/HttpKernel.php",
"line": 168,
"args": [
[
"object",
"Symfony\Component\HttpKernel\Event\ViewEvent"
],
[
"string",
"kernel.view"
]
]
},
{
"namespace": "Symfony\Component\HttpKernel",
"short_class": "HttpKernel",
"class": "Symfony\Component\HttpKernel\HttpKernel",
"type": "->",
"function": "handleRaw",
"file": "/var/www/vendor/symfony/http-kernel/HttpKernel.php",
"line": 75,
"args": [
[
"object",
"Symfony\Component\HttpFoundation\Request"
],
[
"integer",
1
]
]
},
{
"namespace": "Symfony\Component\HttpKernel",
"short_class": "HttpKernel",
"class": "Symfony\Component\HttpKernel\HttpKernel",
"type": "->",
"function": "handle",
"file": "/var/www/vendor/symfony/http-kernel/Kernel.php",
"line": 202,
"args": [
[
"object",
"Symfony\Component\HttpFoundation\Request"
],
[
"integer",
1
],
[
"boolean",
true
]
]
},
{
"namespace": "Symfony\Component\HttpKernel",
"short_class": "Kernel",
"class": "Symfony\Component\HttpKernel\Kernel",
"type": "->",
"function": "handle",
"file": "/var/www/vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php",
"line": 35,
"args": [
[
"object",
"Symfony\Component\HttpFoundation\Request"
]
]
},
{
"namespace": "Symfony\Component\Runtime\Runner\Symfony",
"short_class": "HttpKernelRunner",
"class": "Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner",
"type": "->",
"function": "run",
"file": "/var/www/vendor/autoload_runtime.php",
"line": 29,
"args": []
},
{
"namespace": "",
"short_class": "",
"class": "",
"type": "",
"function": "require_once",
"file": "/var/www/public/index.php",
"line": 5,
"args": [
[
"string",
"/var/www/vendor/autoload_runtime.php"
]
]
}
]
}
`
Please help
The text was updated successfully, but these errors were encountered: