If a struct derives Serialize but not Default, which schemafy does when a struct contains a required field, inject a derive for Default. This allows using Ignition config structs without manually specifying all the fields, but it also generates defaults for mandatory fields. Generating explicit new() methods would be better, but also more work.
I'm on the fence about this one. It makes using the structs more ergonomic, but in a way that isn't fully idiomatic.
It turns out that it's not too hard to generate new() associated functions, so I went ahead and did that in #16. Closing this out. Thanks for the discussion!
If a struct derives
Serialize
but notDefault
, which schemafy does when a struct contains a required field, inject a derive forDefault
. This allows using Ignition config structs without manually specifying all the fields, but it also generates defaults for mandatory fields. Generating explicitnew()
methods would be better, but also more work.I'm on the fence about this one. It makes using the structs more ergonomic, but in a way that isn't fully idiomatic.