Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions fastapi_mcp/openapi/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,13 @@
param_desc = param.get("description", "")
param_required = param.get("required", True) # Path params are usually required

properties[param_name] = {
"type": param_schema.get("type", "string"),
"title": param_name,
"description": param_desc,
}
properties[param_name] = param_schema.copy()
properties[param_name]["title"] = param_name
if param_desc:
properties[param_name]["description"] = param_desc

if "type" not in properties[param_name]:
properties[param_name]["type"] = param_schema.get("type", "string")

Check warning on line 211 in fastapi_mcp/openapi/convert.py

View check run for this annotation

Codecov / codecov/patch

fastapi_mcp/openapi/convert.py#L211

Added line #L211 was not covered by tests

if param_required:
required_props.append(param_name)
Expand All @@ -217,11 +219,14 @@
param_desc = param.get("description", "")
param_required = param.get("required", False)

properties[param_name] = {
"type": get_single_param_type_from_schema(param_schema),
"title": param_name,
"description": param_desc,
}
properties[param_name] = param_schema.copy()
properties[param_name]["title"] = param_name
if param_desc:
properties[param_name]["description"] = param_desc

if "type" not in properties[param_name]:
properties[param_name]["type"] = get_single_param_type_from_schema(param_schema)

if "default" in param_schema:
properties[param_name]["default"] = param_schema["default"]

Expand All @@ -233,10 +238,14 @@
param_schema = param.get("schema", {})
param_required = param.get("required", False)

properties[param_name] = {
"type": get_single_param_type_from_schema(param_schema),
"title": param_name,
}
properties[param_name] = param_schema.copy()
properties[param_name]["title"] = param_name
if param_desc:
properties[param_name]["description"] = param_desc

if "type" not in properties[param_name]:
properties[param_name]["type"] = get_single_param_type_from_schema(param_schema)

if "default" in param_schema:
properties[param_name]["default"] = param_schema["default"]

Expand Down