Open
Description
If I have a struct TOld and add a field to my code to make TNew, I may want to hydrate a TOld into a TNew.
As a concrete example, if I add a new Option<X>
field, (perhaps configurably) it should treat missing field as a None
.
If I add a field that has implements Default
I could also see it treating a missing field as that ::default()
.
Currently the Hydrate implementation for Option throws an Unexpected when a field is missing.
Quick notes:
- There's lots of decisions needed in how the API could look for this
- I think in general this kind of forward-compatibility should be doable if semantically TOld is a subtype of TNew (Liskov substitutable)
- Thinking about forward-compatibility obviously raises the idea of push-safety / backward compatibility, which would suggest explicitly doing the opposite of Autosurgeon reconcile not clearing all old data #46 so old code could still read new documents. I believe changes are backward compatible if TNew is a subtype of TOld.
Metadata
Metadata
Assignees
Labels
No labels
Activity