mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-23 05:54:19 +02:00
Fix ruff ERA001 and format issues
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
08236c4345
commit
16b48452b1
1 changed files with 8 additions and 3 deletions
|
|
@ -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", "<unknown>"), 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", []))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue