Bug #45290

Base Distribution - Work Package #45088: Improved REST support

Body arguments should not be merged before property mapping takes place

Added by Bastian Waidelich over 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Should have
Category:
Http
Target version:
-
Start date:
2013-02-08
Due date:
2013-04-13
% Done:

100%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

Currently body and POST arguments are merged with GET arguments in Http\Request::__construct().
Instead the merging should happen after routing took place in order to know more about the affected arguments.

Now, if you invoke a PUT request to http://localhost/products/product-1 with a body of

{
  "product": {
    "title": "new title" 
  }
}

GET arguments:

array('product' => '<uuid of product-1>')

Body arguments:

array('product' => array('title' => 'new title'));

Obviously \Http\Request::buildUnifiedArguments() can't properly merge those and - as a result - ignores the body arguments.

Instead the property mapper should probably fetch body arguments separately before calling the action (probably in ActionController::mapRequestArgumentsToControllerArguments())


Related issues

Related to TYPO3.Flow - Task #44712: Decouple Argument-Building in the HTTP-Request-ConstructorAccepted2013-01-22

Actions

Also available in: Atom PDF