oxidecomputer / amd-apcb

AMD Generic Encapsulated Software Architecture Platform Security Processor Configuration Block manipulation library
Mozilla Public License 2.0
13 stars 1 forks source link

113 Add Permissive Serializer. #114

Open daym opened 9 months ago

daym commented 9 months ago

Right now, the serializer fails on the first invalid field value it finds.

This isn't nice for bringup of new generations where we usually have (a few) unknown values on some fields and then the entire serializion will fail--and what do we do then?

Better to have the serializer just warn on fields that have unknown values and then leave those fields off the json output.

Since serde already supports skip_serializing_if, let's just skip on error. Users then can override *Serializer's skip_field and figure out when skipping happened and infer that that was because of an error.

daym commented 9 months ago

This is part of https://github.com/oxidecomputer/amd-host-image-builder/issues/160

wesolows commented 5 months ago

I'm not an effective reviewer for serde black magic, sorry. Your other requested reviewers are highly capable so please don't wait on me to complete this work and get it tested and integrated.

dancrossnyc commented 5 months ago

My earlier comment (about lint warnings) stands; probably best to rebase this and fix those up and then it will be ready for review.