Issue #2180111 by linclark: REST should not assume hal_json if no format is provided.
parent
cc27945146
commit
9bbf4b9e34
|
@ -72,8 +72,8 @@ class RequestHandler extends ContainerAware {
|
|||
// Invoke the operation on the resource plugin.
|
||||
// All REST routes are restricted to exactly one format, so instead of
|
||||
// parsing it out of the Accept headers again, we can simply retrieve the
|
||||
// format requirement. If there is no format associated, just pick HAL.
|
||||
$format = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)->getRequirement('_format') ?: 'hal_json';
|
||||
// format requirement. If there is no format associated, just pick JSON.
|
||||
$format = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)->getRequirement('_format') ?: 'json';
|
||||
try {
|
||||
$response = $resource->{$method}($id, $unserialized, $request);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue