mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-28 02:10:38 +02:00
Fix schema wrapping for non-object union types in output schemas
This commit is contained in:
parent
3b0caebab8
commit
7e0a237945
5 changed files with 101 additions and 60 deletions
|
|
@ -1063,7 +1063,9 @@ class TestTransformToolOutputSchema:
|
|||
# Should inherit parent's wrapped string schema
|
||||
expected_schema = {
|
||||
"type": "object",
|
||||
"properties": {"result": {"type": "string"}},
|
||||
"properties": {"result": {"type": "string", "title": "Result"}},
|
||||
"required": ["result"],
|
||||
"title": "_WrappedResult",
|
||||
"x-fastmcp-wrap-result": True,
|
||||
}
|
||||
assert new_tool.output_schema == expected_schema
|
||||
|
|
@ -1121,7 +1123,9 @@ class TestTransformToolOutputSchema:
|
|||
# Should infer string schema from custom function and wrap it
|
||||
expected_schema = {
|
||||
"type": "object",
|
||||
"properties": {"result": {"type": "string"}},
|
||||
"properties": {"result": {"type": "string", "title": "Result"}},
|
||||
"required": ["result"],
|
||||
"title": "_WrappedResult",
|
||||
"x-fastmcp-wrap-result": True,
|
||||
}
|
||||
assert new_tool.output_schema == expected_schema
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue