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

Improve handling of default fields #6

Open
dodomorandi opened this issue May 16, 2022 · 0 comments
Open

Improve handling of default fields #6

dodomorandi opened this issue May 16, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@dodomorandi
Copy link
Contributor

We should improve the handling of default parameters during serialization/deserialization.
There are some similar situations that has a common ground:

  • Fields that can be a T, a Vec<T> and that can be omitted
  • Fields that get a specific value if omitted
  • Fields for which the empty value corresponds to being omitted

We should really define at least a new type that supports Serde and that behaves in the same way for omitted and empty values, also supporting both singular and plural types.

This issue also relates to the possibility of avoiding allocations for plural types (i.e.: Vec, HashMap) with a single value.

@lu-zero lu-zero added the enhancement New feature or request label May 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants