Description
json_schema_to_type() handles anyOf schemas but has no handling for allOf or oneOf. Both silently resolve to typing.Any, effectively disabling all validation.
allOf is the standard way to compose schemas in OpenAPI 3.x and JSON Schema 2020-12 (schema intersection/inheritance). oneOf is used for discriminated unions. Both are extremely common in real-world specs.
Reproduction
from fastmcp.utilities.json_schema_type import json_schema_to_type
# allOf — standard OpenAPI schema composition
schema = {
"allOf": [
{"type": "object", "properties": {"name": {"type": "string"}}, "required": ["name"]},
{"type": "object", "properties": {"age": {"type": "integer"}}},
]
}
T = json_schema_to_type(schema)
print(T) # typing.Any — no validation at all!
# oneOf — discriminated union
schema2 = {
"oneOf": [
{"type": "string"},
{"type": "integer"},
]
}
T2 = json_schema_to_type(schema2)
print(T2) # typing.Any
Expected behavior
allOf should merge sub-schemas and produce a type with all properties
oneOf should produce a Union type
Impact
The client's result.data for any tool whose output schema uses allOf or oneOf gets no type validation — any shape of data is silently accepted.
Description
json_schema_to_type()handlesanyOfschemas but has no handling forallOforoneOf. Both silently resolve totyping.Any, effectively disabling all validation.allOfis the standard way to compose schemas in OpenAPI 3.x and JSON Schema 2020-12 (schema intersection/inheritance).oneOfis used for discriminated unions. Both are extremely common in real-world specs.Reproduction
Expected behavior
allOfshould merge sub-schemas and produce a type with all propertiesoneOfshould produce aUniontypeImpact
The client's
result.datafor any tool whose output schema usesallOforoneOfgets no type validation — any shape of data is silently accepted.