heroku / buildpacks-python

Heroku's Cloud Native Buildpack for Python applications.
BSD 3-Clause "New" or "Revised" License
26 stars 2 forks source link

Deny unknown fields #194

Closed schneems closed 4 months ago

schneems commented 4 months ago

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