buildpacks-ruby icon indicating copy to clipboard operation
buildpacks-ruby copied to clipboard

Deny unknown fields

Open schneems opened this issue 1 year ago • 3 comments

Add:

#[serde(deny_unknown_fields)]

To all structs that implement deserialize. For example:

#[derive(Deserialize, Serialize, Debug)]
#[serde(deny_unknown_fields)]
struct PersonV2 {
    name: String,
    updated_at: DateTime<Utc>
}

More info: https://github.com/schneems/magic_migrate/blob/3e43a72c329a2f03c016e0d37cd8ec085af7982f/README.md

schneems avatar Apr 23 '24 15:04 schneems

Either confirm they exist or add them

schneems avatar Nov 06 '24 20:11 schneems

We are still missing some of the metadata structs

#[derive(Deserialize, Serialize, Debug, Clone)]
pub(crate) struct MetadataV1 {
    pub(crate) version: ResolvedBundlerVersion,
}

schneems avatar Nov 15 '24 15:11 schneems

Ok I'll add the remaining. Thanks for pointing that out.

BrianBorge avatar Nov 15 '24 18:11 BrianBorge