Skip to content

[Serializer] Serializer improvements #14924

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy