zf-rest - error "title":"Not Found","status":404,"detail":"Entity not found."
I configured the routes as well as the other parts pretty well.
An important step to solving the issue was adding the following configuration section into my project "local.php".
//this is possible overwritten by the zf-rest module
'view-manager' => array(
'display_exceptions' => true,
'display_not_found_reason' => true
)
After that, I got back an response with the following content:
{"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html","title":"Not Found","status":404,"detail":"Entity not found."
After adding a lot of debugging statements in the "ZF\Rest\RestController" (search for "Entity not found." ;-)), started understanding the issue.
The answer is pretty clear after all. Whenever you listen on a GET HTTP Method with your listener, you have to return an array with the configured "route_identifier_name" (the entity identifier), otherwise the controller as well as the HAL post processor is not able to successful build the response.
Trackbacks
Die Kommentarfunktion wurde vom Besitzer dieses Blogs in diesem Eintrag deaktiviert.
Kommentare
Ansicht der Kommentare: Linear | Verschachtelt