From 9ee52e4e39cfd2a5d2aad253221d7ed283fdbd28 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 22 Aug 2024 16:48:00 -0400 Subject: [PATCH] Deny invalid members in workspace schema (#6450) ## Summary This has bitten me a few times. --- crates/uv-workspace/src/pyproject.rs | 3 ++- uv.schema.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/uv-workspace/src/pyproject.rs b/crates/uv-workspace/src/pyproject.rs index 62738e2d6..6914f70e3 100644 --- a/crates/uv-workspace/src/pyproject.rs +++ b/crates/uv-workspace/src/pyproject.rs @@ -150,6 +150,7 @@ pub struct ToolUv { #[derive(Serialize, Deserialize, OptionsMetadata, Default, Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] +#[serde(rename_all = "kebab-case", deny_unknown_fields)] pub struct ToolUvWorkspace { /// Packages to include as workspace members. /// @@ -206,7 +207,7 @@ impl Deref for SerdePattern { /// A `tool.uv.sources` value. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] -#[serde(untagged, deny_unknown_fields)] +#[serde(rename_all = "kebab-case", untagged, deny_unknown_fields)] pub enum Source { /// A remote Git repository, available over HTTPS or SSH. /// diff --git a/uv.schema.json b/uv.schema.json index 96adf2a3c..123576428 100644 --- a/uv.schema.json +++ b/uv.schema.json @@ -1423,7 +1423,8 @@ "$ref": "#/definitions/String" } } - } + }, + "additionalProperties": false } } } \ No newline at end of file