Skip to content

Commit c739646

Browse files
committed
fix: Update test to match Pydantic's JSON schema output for model references with defaults
Pydantic now uses allOf to combine model references with default values in JSON schema output.
1 parent 8a3029b commit c739646

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/server/fastmcp/test_func_metadata.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,11 @@ def test_complex_function_json_schema():
316316
"type": "string",
317317
},
318318
"my_model_a_with_default": {
319-
"$ref": "#/$defs/SomeInputModelA",
319+
"allOf": [
320+
{
321+
"$ref": "#/$defs/SomeInputModelA"
322+
}
323+
],
320324
"default": {},
321325
},
322326
"an_int_with_default": {

0 commit comments

Comments
 (0)