Skip to content

Commit d9c7918

Browse files
committed
remove redundant leftover code
1 parent b3471e4 commit d9c7918

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

fastapi_mcp/openapi/utils.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def extract_model_examples_from_components(
140140
return examples
141141

142142

143-
def generate_example_from_schema(schema: Dict[str, Any], model_name: Optional[str] = None) -> Any:
143+
def generate_example_from_schema(schema: Dict[str, Any]) -> Any:
144144
"""
145145
Generate a simple example response from a JSON schema.
146146
@@ -154,20 +154,6 @@ def generate_example_from_schema(schema: Dict[str, Any], model_name: Optional[st
154154
if not schema or not isinstance(schema, dict):
155155
return None
156156

157-
# Special handling for known model types
158-
if model_name == "Item":
159-
# Create a realistic Item example since this is commonly used
160-
return {
161-
"id": 1,
162-
"name": "Hammer",
163-
"description": "A tool for hammering nails",
164-
"price": 9.99,
165-
"tags": ["tool", "hardware"],
166-
}
167-
elif model_name == "HTTPValidationError":
168-
# Create a realistic validation error example
169-
return {"detail": [{"loc": ["body", "name"], "msg": "field required", "type": "value_error.missing"}]}
170-
171157
# Handle different types
172158
schema_type = schema.get("type")
173159

0 commit comments

Comments
 (0)