From c5416fadf0b0af46de9a5460a918f3d249190c98 Mon Sep 17 00:00:00 2001 From: rvanasa Date: Wed, 9 Jul 2025 11:19:53 -0600 Subject: [PATCH 1/2] Restrict additional properties for canisters in dfx.json schema --- docs/dfx-json-schema.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/dfx-json-schema.json b/docs/dfx-json-schema.json index 3e7240d3a4..03c358bb2c 100644 --- a/docs/dfx-json-schema.json +++ b/docs/dfx-json-schema.json @@ -546,7 +546,8 @@ } ] } - } + }, + "additionalProperties": false }, "ConfigCanistersCanisterRemote": { "title": "Remote Canister Configuration", From 76e3eb236be7a426c2c2e42b1b0f61c05e3a2fbb Mon Sep 17 00:00:00 2001 From: rvanasa Date: Wed, 9 Jul 2025 12:04:27 -0600 Subject: [PATCH 2/2] Add '#[schemars(deny_unknown_fields)]' --- src/dfx-core/src/config/model/dfinity.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dfx-core/src/config/model/dfinity.rs b/src/dfx-core/src/config/model/dfinity.rs index e26edada97..a4100a4862 100644 --- a/src/dfx-core/src/config/model/dfinity.rs +++ b/src/dfx-core/src/config/model/dfinity.rs @@ -232,6 +232,7 @@ pub const DEFAULT_REPLICA_PORT: u16 = 8080; /// # Canister Configuration /// Configurations for a single canister. #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema)] +#[schemars(deny_unknown_fields)] pub struct ConfigCanistersCanister { /// # Declarations Configuration /// Defines which canister interface declarations to generate,