For the following schema:
"field": {
"allOf": [
{
"$ref": "#/components/schemas/MyStruct"
}
],
"default": "0",
},
The part of generated code is:
...
pub mod defaults {
pub(super) fn object_field() -> super::MyStruct {
super::MyStruct("0".to_string())
}
}
...
It can be, there is no constructor for MyStruct which accepts string.
So it's better to use serde deserialization rather than using constructor