mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-22 05:24:18 +02:00
Fix nesting when making OpenAPI arrays and objects optional (#1178)
This commit is contained in:
parent
ebe817601c
commit
3543c13ca9
2 changed files with 50 additions and 6 deletions
|
|
@ -95,8 +95,6 @@ async def test_optional_parameter_allows_null_for_type(param_schema):
|
|||
# Should have anyOf with the original type and null
|
||||
assert "anyOf" in optional_param_schema
|
||||
assert {"type": "null"} in optional_param_schema["anyOf"]
|
||||
# Check that original schema is preserved (either simple type or complex schema)
|
||||
if "type" in param_schema:
|
||||
assert {"type": param_schema["type"]} in optional_param_schema["anyOf"]
|
||||
else:
|
||||
assert param_schema in optional_param_schema["anyOf"]
|
||||
|
||||
# Check that original schema is fully preserved under anyOf
|
||||
assert param_schema in optional_param_schema["anyOf"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue