From 16b48452b131f4fd9356e56bed937dd5e1f3dc6b Mon Sep 17 00:00:00 2001 From: strawgate Date: Tue, 12 May 2026 23:00:56 -0500 Subject: [PATCH] Fix ruff ERA001 and format issues Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- fastmcp_slim/fastmcp/utilities/json_schema_type.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fastmcp_slim/fastmcp/utilities/json_schema_type.py b/fastmcp_slim/fastmcp/utilities/json_schema_type.py index b3163872b..d2f7d3172 100644 --- a/fastmcp_slim/fastmcp/utilities/json_schema_type.py +++ b/fastmcp_slim/fastmcp/utilities/json_schema_type.py @@ -453,7 +453,12 @@ def _schema_to_type( if not schema: return object - if "type" not in schema and "properties" in schema and "allOf" not in schema and "oneOf" not in schema: + if ( + "type" not in schema + and "properties" in schema + and "allOf" not in schema + and "oneOf" not in schema + ): return _create_dataclass(schema, schema.get("title", ""), schemas) # Handle references first @@ -529,8 +534,8 @@ def _schema_to_type( merged[key] = sub[key] # Include sibling properties/required from the schema itself, - # not just from allOf children. This handles schemas like - # {"properties": {"local": ...}, "allOf": [{"properties": {"inherited": ...}}]} + # not just from allOf children — covers schemas where top-level + # properties coexist with an allOf list of inherited properties. merged_properties.update(schema.get("properties", {})) merged_required.extend(schema.get("required", []))