Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dehydration #10

Open
rustamwin opened this issue May 7, 2023 · 8 comments
Open

Add dehydration #10

rustamwin opened this issue May 7, 2023 · 8 comments

Comments

@rustamwin
Copy link
Member

No description provided.

@rustamwin rustamwin added the type:feature New feature label May 7, 2023
@vjik
Copy link
Member

vjik commented May 8, 2023

Can you describe you vision of concept?

@xepozz
Copy link
Member

xepozz commented May 8, 2023

Do you mean serialization?

@rustamwin
Copy link
Member Author

rustamwin commented May 8, 2023

I mean hydration and vice versa (aka toArray()).

@xepozz
Copy link
Member

xepozz commented May 8, 2023

@vjik
Copy link
Member

vjik commented May 9, 2023

I mean hydration and vice versa (aka toArray()).

Seems, it's not hydrator package responsibility. Hydration is a one-way process, it's not serilization/deserilization.

@rustamwin
Copy link
Member Author

rustamwin commented May 10, 2023

It's not deserialization exactly. We have Map attribute.

// request data is ['a' => 'foo', 'b' => 'bar']
#[Map(['x' => 'a', 'y' => 'b'])
class MyDto
{
    public string $x;
    public string $y;
}

Result of dehyration should be ['a' => 'foo', 'b' => 'bar'] not ['x' => 'foo', 'y' => 'bar'].

@xepozz
Copy link
Member

xepozz commented May 10, 2023

$request->getParsedBody()?

@rustamwin
Copy link
Member Author

$request->getParsedBody()?

Any input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants