Our great sponsors
-
serde_arrays
A simple module to support serializing and deserializing const generic or arbitrarily-large arrays
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Recently I needed to be able to deserialize/serialize a struct that contained a [f64; N] const generic array. After some errors and some Googling, I eventually found that Serde can't handle these (nor even regular arrays with a size greater than 32). So with the help of Serde's excellent documentation, and much trial-and-error (oh! so much error!), I managed to put together a simple library that allows you to serialize not only const generic arrays, but arrays of any size!
I've created an issue for your use case. Unfortunately all I've managed to accomplish today is proving that it's impossible, outside of Serde implementing it themselves, to handle arbitrary levels of nesting, which is what I was hoping to do. Thus a separate module has to be implemented for each such collection.
From a language/cargo point of view, there is no issue. But the issue arises when you look at the ecosystem. It's really well explained in the semver-trick readme. semver-trick isn't a complete solution to the problem, but rather equivalent to a band-aid (or a hack).