Skip to content

Q: Is it possible to diff a struct where one of the fields is serde_json::Value #21

@AdamJSoftware

Description

@AdamJSoftware

I want to ensure that the data is proper json when ser/de, so I made the struct_value a serde_json::Value. However, if I try to diff it I get the following JsonValue: Diff is not satisfied


#[derive(Deserialize, Debug, Clone, Serialize, PartialEq, Diff)]
pub struct Field {
    pub r#type: PostgresTypes,
    #[serde(default = "default_false")]
    pub unique: bool,
    #[serde(default = "default_false")]
    pub required: bool,
    #[serde(default = "default_false")]
    pub primary: bool,
    #[serde(default = "default_empty_json")]
    pub metadata: Option<serde_json::Value>,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions