This could be done as a bang-style procedural macro or a function to call from your build.rs file. Not sure which to do yet.
I've implemented this, utilizing serde_bare underneath: https://git.sr.ht/~chiefnoah/bare_proc
serde_bare