Closed
Description
Description
As it is included in FOSRest and ApiPlatfom, I would be happy if there was a native symfony component. Actually, the main point is to be able to create a RequestDataObject from the Request with the help of a serializer. Of course, it can also be projected now, but all of them are external packages.
Example
POST: /foo/bar/{barId}?status=active
{
"id": 1,
"name": "Name"
}
FooBarRequestData:
class FooBarRequestData {
private int $barId;
private string $status;
private int $id;
private string $name;
/**
* @return int
*/
public function getBarId(): int
{
return $this->barId;
}
/**
* @return string
*/
public function getStatus(): string
{
return $this->status;
}
/**
* @return int
*/
public function getId(): int
{
return $this->id;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
}
Serialize an Object from the Symfony Request data