docs(core): add "type" tag-collision invariant to ItemCore
Reviewer note: flatten semantics of serde tag = "type" means no *Core struct may ever use "type" as a field name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,9 @@ pub enum ItemType {
|
|||||||
Totp,
|
Totp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// INVARIANT: no *Core struct may have a field serialized as "type" —
|
||||||
|
// that key is reserved for serde's internal tag. Use "kind" for
|
||||||
|
// type-discriminant fields within core structs (CardKind, TotpKind).
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
#[serde(tag = "type", rename_all = "snake_case")]
|
#[serde(tag = "type", rename_all = "snake_case")]
|
||||||
pub enum ItemCore {
|
pub enum ItemCore {
|
||||||
|
|||||||
Reference in New Issue
Block a user