Is there a reasonably simple way to use serde/serde_json to take an existing struct and update only those fields that are present in the JSON? This basically amounts to setting a default value at runtime rather than at compile time by implementing the Default trait or a default value generator function.
This seems like a really common use case when you have a RESTful API where you want to submit updates to state, modifying only specified fields and leaving unspecified fields unchanged.
I could do it by deserializing to the dynamic Value type and then doing a big match or if/else block to update fields, but that's verbose and ugly. I'm wondering if serde has anything to handle this.