mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-21 13:04:18 +02:00
[BugFix] Fix openapi_version Check So 3.1 Is Included (#2768)
This commit is contained in:
parent
c5a61a7e19
commit
ef84f84d1e
1 changed files with 4 additions and 4 deletions
|
|
@ -539,9 +539,9 @@ def extract_output_schema_from_responses(
|
|||
# Replace $ref with the actual schema definition
|
||||
output_schema = _replace_ref_with_defs(schema_definitions[schema_name])
|
||||
|
||||
# Convert OpenAPI schema to JSON Schema format
|
||||
# Only needed for OpenAPI 3.0 - 3.1 uses standard JSON Schema null types
|
||||
if openapi_version and openapi_version.startswith("3.0"):
|
||||
if openapi_version and openapi_version.startswith("3"):
|
||||
# Convert OpenAPI 3.x schema to JSON Schema format for proper handling
|
||||
# of constructs like oneOf, anyOf, and nullable fields
|
||||
from .json_schema_converter import convert_openapi_schema_to_json_schema
|
||||
|
||||
output_schema = convert_openapi_schema_to_json_schema(
|
||||
|
|
@ -570,7 +570,7 @@ def extract_output_schema_from_responses(
|
|||
processed_defs[name] = _replace_ref_with_defs(schema)
|
||||
|
||||
# Convert OpenAPI schema definitions to JSON Schema format if needed
|
||||
if openapi_version and openapi_version.startswith("3.0"):
|
||||
if openapi_version and openapi_version.startswith("3"):
|
||||
from .json_schema_converter import convert_openapi_schema_to_json_schema
|
||||
|
||||
for def_name in list(processed_defs.keys()):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue