Make Query extractor use Default impl for deserialization
Closed this issue · 2 comments
vszakd commented
- I have looked for existing issues (including closed) about this
Feature Request
Motivation
When using the Query extractor, it is already possible to use structs that have Option fields. However it is not possible to rely on the Default trait in case the whole struct (or parts thereof) is not present.
Proposal
Use the Default trait, when available, for structs extracted via Query, so that if fields are missing, those from the Default impl are used.
Alternatives
Continue wrapping every single field in Option, as it's possible now. This leads to much useless boilerplate.