Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] Serializer improvements #14924

Closed
@GuilhemN

Description

@GuilhemN

The symfony serializer is a great tool but it's probably underused now.

2.7 introduces the groups and I think that we could think to else fields we could create !

Firstly, the fields exposition isn't really present now. I suggest to add an Expose config (definable to true/false) and the possibility to change a field serialized name ExportsAs.
It could also be useful to implement virtual properties.

Besides that I think it's important to have the choice to split readable field and writable fields:
So I suggest to have a normal policy NormalizePolicy, a readable policy ReadablePolicy and a writable policy WritablePolicy on classes that define a default exposition, a default security (expression, overwritable) and a global security (expression, not overwritable).

We should develop maybe a verification mechanism too with a type verification and normalization.

If you don't see what I mean, I created some annotation classes : https://github.com/Ener-Getick/symfony/tree/ticket_14924/src/Symfony/Component/Serializer/Annotation.

Please give your feedbacks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions