-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Labels
Description
Description
Hi! Sorry in advance if that issue is a duplicate (didn't find anything like it). What if we add new method in AbstractController to deserialize from json (opposite to AbstractController::json()
) ? AbstractController already has lots of methods, but still this opertation seem to be routine one while developing APIs :)
Example
protected function fromJson(string $body, string $to, array $context = [])
{
// check if serializer available
// return deserialized value
}
...
public function createUser(Request $request)
{
$resource = $this->fromJson($request->getContent(), UserResource::class);
}
If OK, I would like to implement it.
WDYT? Thanks!