Open alper opened 5 months ago
I'm trying to follow this but it looks like it's something of a rabbit hole? https://graham.cool/schemars/examples/5-remote_derive/
The easiest way to achieve this would be do decorate those fields with #[serde(with = "T")]
where T
has an equivalent schema, e.g. BTreeMap
use std::collections::BTreeMap;
#[derive(JsonSchema)]
pub struct MyType {
#[serde(with = "BTreeMap::<String, Value>")]
my_map: toml::map::Map<String, Value>,
}
I have a struct field with a type like this:
toml::map::Map<String, Value>
Schemars can't deal with this. What's a good way to fix this?