Skip to content

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

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>,
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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