Spaces:
Running
Running
FabrizioSandri commited on
Commit ·
74ef555
1
Parent(s): ecc4161
Check for non empty array and dictionary parameter
Browse files
src/fastmcp/server/openapi.py
CHANGED
|
@@ -367,7 +367,11 @@ class OpenAPITool(Tool):
|
|
| 367 |
) # Default explode for query is True
|
| 368 |
|
| 369 |
# Handle deepObject style for object parameters
|
| 370 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
if param_explode:
|
| 372 |
# deepObject with explode=true: object properties become separate parameters
|
| 373 |
# e.g., target[id]=123&target[type]=user
|
|
@@ -386,6 +390,7 @@ class OpenAPITool(Tool):
|
|
| 386 |
elif (
|
| 387 |
isinstance(param_value, list)
|
| 388 |
and p.schema_.get("type") == "array"
|
|
|
|
| 389 |
):
|
| 390 |
if param_explode:
|
| 391 |
# When explode=True, we pass the array directly, which HTTPX will serialize
|
|
|
|
| 367 |
) # Default explode for query is True
|
| 368 |
|
| 369 |
# Handle deepObject style for object parameters
|
| 370 |
+
if (
|
| 371 |
+
param_style == "deepObject"
|
| 372 |
+
and isinstance(param_value, dict)
|
| 373 |
+
and len(param_value) > 0
|
| 374 |
+
):
|
| 375 |
if param_explode:
|
| 376 |
# deepObject with explode=true: object properties become separate parameters
|
| 377 |
# e.g., target[id]=123&target[type]=user
|
|
|
|
| 390 |
elif (
|
| 391 |
isinstance(param_value, list)
|
| 392 |
and p.schema_.get("type") == "array"
|
| 393 |
+
and len(param_value) > 0
|
| 394 |
):
|
| 395 |
if param_explode:
|
| 396 |
# When explode=True, we pass the array directly, which HTTPX will serialize
|