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

Enabling filtering capabilities #273

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Brieux1
Copy link

@Brieux1 Brieux1 commented Feb 29, 2024

Proposal for enabling field filtering capabilities in serialization.

Functional description:

  • new attribute filteringAttribute in @CompiledJson annotation to reference an attribute of the current object that may contain attribute names to serialize (the filteringAttribute must be a Collection)
  • if filteringAttribute is set, then the generated converter add a check on it to only serialize fields listed in the collection

@zapov
Copy link
Member

zapov commented Mar 3, 2024

This looks a bit too specific to me.
While its certainly useful to have some runtime configuration of the serialization/deserialization behavior,
I would prefer some more general interface than using a collection field on an instance.

Also, not sure I would like to have this check on each instance, seems much better to have it only during initialization.

While its certainly useful for some cases to perform this serialization on an instance, it should be possible to do it in a different way.
It looks like overlap between minimal serialization, which will serialize properties conditionally and different check for serialization eligebility which is currently is this value null/known and can be reconstructed without more information.

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

Successfully merging this pull request may close these issues.

2 participants