When using #[serde(flatten)] in combination with the preserve_order feature, Schemars did not actually preserve the order; flattened properites would always be inserted last.
This change modifies the derive macro to insert flattened properties as they come.
I haven't added test cases as there don't seem to be any for preserve_order and I'm not sure how to go about doing this. However, I did add a flattened structure to the serde_attrs example, and tested it manually.
Resolves #122.
When using
#[serde(flatten)]
in combination with thepreserve_order
feature, Schemars did not actually preserve the order; flattened properites would always be inserted last.This change modifies the derive macro to insert flattened properties as they come.
I haven't added test cases as there don't seem to be any for
preserve_order
and I'm not sure how to go about doing this. However, I did add a flattened structure to theserde_attrs
example, and tested it manually.