Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

RequestDataObject as in java spring #46991

Copy link
Copy link
Closed
@dozsan

Description

@dozsan
Issue body actions

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.