The worlds defined in my wit file contain uses variants with resources which causes wit-bindgen to fail if I use additional_derives: [serde::Deserialize]
.
Would either of these ideas be acceptable? We allow the user to specify records/variants to ignore, or we could confine the additional_derives to specific interfaces.
additional_derives: {
traits: [serde::Serialize, serde::Deserialize, Hash, Clone, PartialEq, Eq],
ignore: [input-stream]
}
or
additional_derives: {
traits: [serde::Serialize, serde::Deserialize, Hash, Clone, PartialEq, Eq],
interface: "adobe:cai/types@0.1.0",
}
That seems like a reasonable extension to me yeah, I'm not sure how exactly to encode this in the macro configuration or CLI but regardless I thnk it's a reasonable feature to have one way or another
I don't know how many people are using it, but the change could be backwards compatible:
additional_derives: [serde::Serialize, serde::Deserialize, Hash, Clone, PartialEq, Eq],
additional_derives_ignore: [input-stream],
}
or
additional_derives: [serde::Serialize, serde::Deserialize, Hash, Clone, PartialEq, Eq],
additional_derives_interface: "adobe:cai/types@0.1.0",
}
both seem reasonable enough to me yeah
PR opened: feat: Allow variants and records to be ignored by additional_derives
Last updated: Apr 08 2025 at 02:30 UTC