Spaces:
Running
Running
File size: 30,530 Bytes
60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b 60e47cc 3ce4c1b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 | """Comprehensive tests for transitive and nested reference handling (Issue #1372)."""
from fastmcp.experimental.utilities.openapi.models import (
HTTPRoute,
ParameterInfo,
RequestBodyInfo,
ResponseInfo,
)
from fastmcp.experimental.utilities.openapi.parser import parse_openapi_to_http_routes
from fastmcp.experimental.utilities.openapi.schemas import (
_combine_schemas_and_map_params,
extract_output_schema_from_responses,
)
class TestTransitiveAndNestedReferences:
"""Comprehensive tests for transitive and nested reference handling (Issue #1372)."""
def test_nested_refs_in_schema_definitions_converted(self):
"""$refs inside schema definitions must be converted from OpenAPI to JSON Schema format."""
route = HTTPRoute(
path="/users/{id}",
method="POST",
operation_id="create_user",
parameters=[
ParameterInfo(
name="id", location="path", required=True, schema={"type": "string"}
)
],
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {
"type": "object",
"properties": {"user": {"$ref": "#/components/schemas/User"}},
}
},
),
request_schemas={
"User": {
"type": "object",
"properties": {"profile": {"$ref": "#/components/schemas/Profile"}},
},
"Profile": {
"type": "object",
"properties": {"name": {"type": "string"}},
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# Root level refs should be converted
assert combined_schema["properties"]["user"]["$ref"] == "#/$defs/User"
# Refs inside schema definitions should also be converted
user_def = combined_schema["$defs"]["User"]
assert user_def["properties"]["profile"]["$ref"] == "#/$defs/Profile"
def test_transitive_dependencies_in_response_schemas(self):
"""Transitive dependencies (A→B→C) must all be preserved in response schemas."""
# This mimics the exact structure reported in issue #1372
responses = {
"201": ResponseInfo(
description="User created",
content_schema={
"application/json": {"$ref": "#/components/schemas/User"}
},
)
}
schema_definitions = {
"User": {
"type": "object",
"properties": {
"id": {"type": "string"},
"profile": {"$ref": "#/components/schemas/Profile"},
},
"required": ["id", "profile"],
},
"Profile": {
"type": "object",
"properties": {
"name": {"type": "string"},
"address": {"$ref": "#/components/schemas/Address"},
},
"required": ["name", "address"],
},
"Address": {
"type": "object",
"properties": {
"street": {"type": "string"},
"city": {"type": "string"},
"zipcode": {"type": "string"},
},
"required": ["street", "city", "zipcode"],
},
}
result = extract_output_schema_from_responses(
responses, schema_definitions=schema_definitions, openapi_version="3.0.3"
)
# All transitive dependencies must be preserved
assert result is not None
assert "$defs" in result
assert "User" in result["$defs"], "User should be preserved"
assert "Profile" in result["$defs"], "Profile should be preserved"
assert "Address" in result["$defs"], "Address must be preserved (main bug)"
# All refs should be converted to #/$defs format
user_def = result["$defs"]["User"]
assert user_def["properties"]["profile"]["$ref"] == "#/$defs/Profile"
profile_def = result["$defs"]["Profile"]
assert profile_def["properties"]["address"]["$ref"] == "#/$defs/Address"
def test_elongl_reported_case_xref_with_nullable_function(self):
"""Test the specific case reported by elongl with nullable function reference."""
responses = {
"200": ResponseInfo(
description="Success",
content_schema={
"application/json": {
"type": "array",
"items": {"$ref": "#/components/schemas/Xref"},
}
},
)
}
schema_definitions = {
"Xref": {
"type": "object",
"properties": {
"address": {"type": "string", "title": "Address"},
"type": {"type": "string", "title": "Type"},
"function": {
"anyOf": [
{"$ref": "#/components/schemas/Function"},
{"type": "null"},
]
},
},
"required": ["address", "type", "function"],
"title": "Xref",
},
"Function": {
"type": "object",
"properties": {
"name": {"type": "string"},
"address": {"type": "string"},
},
"title": "Function",
},
}
result = extract_output_schema_from_responses(
responses, schema_definitions=schema_definitions
)
# Function must be included in $defs
assert result is not None
assert "$defs" in result
assert "Xref" in result["$defs"], "Xref should be preserved"
assert "Function" in result["$defs"], (
"Function must be preserved (reported bug)"
)
# Refs in anyOf should be converted
xref_def = result["$defs"]["Xref"]
function_prop = xref_def["properties"]["function"]
assert function_prop["anyOf"][0]["$ref"] == "#/$defs/Function"
def test_tspicer_reported_case_profile_with_nested_refs(self):
"""Test the specific case reported by tspicer with Profile->countryCode->AccountInfo."""
route = HTTPRoute(
path="/profile",
method="POST",
operation_id="create_profile",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {"$ref": "#/components/schemas/Profile"}
},
),
request_schemas={
"Profile": {
"type": "object",
"properties": {
"profileId": {"type": "integer"},
"countryCode": {"$ref": "#/components/schemas/countryCode"},
"accountInfo": {"$ref": "#/components/schemas/AccountInfo"},
},
},
"countryCode": {
"type": "string",
"enum": ["US", "UK", "CA", "AU"],
},
"AccountInfo": {
"type": "object",
"properties": {
"accountId": {"type": "string"},
"accountType": {"type": "string"},
},
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# All referenced schemas must be included in $defs
assert "Profile" in combined_schema["$defs"], "Profile should be preserved"
assert "countryCode" in combined_schema["$defs"], (
"countryCode must be preserved"
)
assert "AccountInfo" in combined_schema["$defs"], (
"AccountInfo must be preserved"
)
# All refs should be converted
profile_def = combined_schema["$defs"]["Profile"]
assert profile_def["properties"]["countryCode"]["$ref"] == "#/$defs/countryCode"
assert profile_def["properties"]["accountInfo"]["$ref"] == "#/$defs/AccountInfo"
def test_transitive_refs_in_request_body_schemas(self):
"""Transitive $refs in request body schemas must be preserved and converted."""
route = HTTPRoute(
path="/users",
method="POST",
operation_id="create_user",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {"$ref": "#/components/schemas/User"}
},
),
request_schemas={
"User": {
"type": "object",
"properties": {
"id": {"type": "string"},
"profile": {"$ref": "#/components/schemas/Profile"},
},
"required": ["id", "profile"],
},
"Profile": {
"type": "object",
"properties": {
"name": {"type": "string"},
"address": {"$ref": "#/components/schemas/Address"},
},
"required": ["name", "address"],
},
"Address": {
"type": "object",
"properties": {
"street": {"type": "string"},
"city": {"type": "string"},
"zipcode": {"type": "string"},
},
"required": ["street", "city", "zipcode"],
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# All transitive dependencies should be preserved
assert "User" in combined_schema["$defs"]
assert "Profile" in combined_schema["$defs"]
assert "Address" in combined_schema["$defs"]
# All internal refs should be converted to #/$defs format
user_def = combined_schema["$defs"]["User"]
assert user_def["properties"]["profile"]["$ref"] == "#/$defs/Profile"
profile_def = combined_schema["$defs"]["Profile"]
assert profile_def["properties"]["address"]["$ref"] == "#/$defs/Address"
def test_refs_in_array_items_converted(self):
"""$refs inside array items must be converted from OpenAPI to JSON Schema format."""
route = HTTPRoute(
path="/users",
method="POST",
operation_id="create_users",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {
"type": "object",
"properties": {
"users": {
"type": "array",
"items": {"$ref": "#/components/schemas/User"},
}
},
}
},
),
request_schemas={
"User": {
"type": "object",
"properties": {"profile": {"$ref": "#/components/schemas/Profile"}},
},
"Profile": {
"type": "object",
"properties": {"name": {"type": "string"}},
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# Array item refs should be converted
assert combined_schema["properties"]["users"]["items"]["$ref"] == "#/$defs/User"
# Nested refs should be converted
user_def = combined_schema["$defs"]["User"]
assert user_def["properties"]["profile"]["$ref"] == "#/$defs/Profile"
def test_refs_in_composition_keywords_converted(self):
"""$refs inside oneOf/anyOf/allOf must be converted from OpenAPI to JSON Schema format."""
route = HTTPRoute(
path="/data",
method="POST",
operation_id="create_data",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {
"type": "object",
"properties": {
"data": {
"oneOf": [
{"$ref": "#/components/schemas/TypeA"},
{"$ref": "#/components/schemas/TypeB"},
]
},
"alternate": {
"anyOf": [
{"$ref": "#/components/schemas/TypeC"},
{"$ref": "#/components/schemas/TypeD"},
]
},
"combined": {
"allOf": [
{"$ref": "#/components/schemas/BaseType"},
{"properties": {"extra": {"type": "string"}}},
]
},
},
}
},
),
request_schemas={
"TypeA": {
"type": "object",
"properties": {"nested": {"$ref": "#/components/schemas/Nested"}},
},
"TypeB": {
"type": "object",
"properties": {"value": {"type": "string"}},
},
"TypeC": {"type": "string"},
"TypeD": {"type": "number"},
"BaseType": {
"type": "object",
"properties": {"base": {"type": "string"}},
},
"Nested": {"type": "string"},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# oneOf refs should be converted
oneof_refs = combined_schema["properties"]["data"]["oneOf"]
assert oneof_refs[0]["$ref"] == "#/$defs/TypeA"
assert oneof_refs[1]["$ref"] == "#/$defs/TypeB"
# anyOf refs should be converted
anyof_refs = combined_schema["properties"]["alternate"]["anyOf"]
assert anyof_refs[0]["$ref"] == "#/$defs/TypeC"
assert anyof_refs[1]["$ref"] == "#/$defs/TypeD"
# allOf refs should be converted
allof_refs = combined_schema["properties"]["combined"]["allOf"]
assert allof_refs[0]["$ref"] == "#/$defs/BaseType"
# Transitive refs should be converted
type_a_def = combined_schema["$defs"]["TypeA"]
assert type_a_def["properties"]["nested"]["$ref"] == "#/$defs/Nested"
def test_deeply_nested_transitive_refs_preserved(self):
"""Deeply nested transitive refs (A→B→C→D→E) must all be preserved."""
route = HTTPRoute(
path="/deep",
method="POST",
operation_id="create_deep",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {"$ref": "#/components/schemas/Level1"}
},
),
request_schemas={
"Level1": {
"type": "object",
"properties": {"level2": {"$ref": "#/components/schemas/Level2"}},
},
"Level2": {
"type": "object",
"properties": {"level3": {"$ref": "#/components/schemas/Level3"}},
},
"Level3": {
"type": "object",
"properties": {"level4": {"$ref": "#/components/schemas/Level4"}},
},
"Level4": {
"type": "object",
"properties": {"level5": {"$ref": "#/components/schemas/Level5"}},
},
"Level5": {
"type": "object",
"properties": {"value": {"type": "string"}},
},
"UnusedSchema": {"type": "number"},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# All levels should be preserved
assert "Level1" in combined_schema["$defs"]
assert "Level2" in combined_schema["$defs"]
assert "Level3" in combined_schema["$defs"]
assert "Level4" in combined_schema["$defs"]
assert "Level5" in combined_schema["$defs"]
# Unused should be removed (pruning is allowed for unused schemas)
assert "UnusedSchema" not in combined_schema["$defs"]
# All refs should be converted
assert (
combined_schema["$defs"]["Level1"]["properties"]["level2"]["$ref"]
== "#/$defs/Level2"
)
assert (
combined_schema["$defs"]["Level2"]["properties"]["level3"]["$ref"]
== "#/$defs/Level3"
)
assert (
combined_schema["$defs"]["Level3"]["properties"]["level4"]["$ref"]
== "#/$defs/Level4"
)
assert (
combined_schema["$defs"]["Level4"]["properties"]["level5"]["$ref"]
== "#/$defs/Level5"
)
def test_circular_references_handled(self):
"""Circular references (A→B→A) must be handled without infinite loops."""
route = HTTPRoute(
path="/circular",
method="POST",
operation_id="circular_test",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {"$ref": "#/components/schemas/Node"}
},
),
request_schemas={
"Node": {
"type": "object",
"properties": {
"value": {"type": "string"},
"children": {
"type": "array",
"items": {"$ref": "#/components/schemas/Node"},
},
},
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# Node should be preserved
assert "Node" in combined_schema["$defs"]
# Self-reference should be converted
node_def = combined_schema["$defs"]["Node"]
assert node_def["properties"]["children"]["items"]["$ref"] == "#/$defs/Node"
def test_multiple_reference_paths_to_same_schema(self):
"""Multiple paths to the same schema (diamond pattern) must preserve the schema."""
route = HTTPRoute(
path="/diamond",
method="POST",
operation_id="diamond_test",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {
"type": "object",
"properties": {
"left": {"$ref": "#/components/schemas/Left"},
"right": {"$ref": "#/components/schemas/Right"},
},
}
},
),
request_schemas={
"Left": {
"type": "object",
"properties": {"shared": {"$ref": "#/components/schemas/Shared"}},
},
"Right": {
"type": "object",
"properties": {"shared": {"$ref": "#/components/schemas/Shared"}},
},
"Shared": {
"type": "object",
"properties": {"value": {"type": "string"}},
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# All schemas should be preserved
assert "Left" in combined_schema["$defs"]
assert "Right" in combined_schema["$defs"]
assert "Shared" in combined_schema["$defs"]
# All refs should be converted
assert combined_schema["properties"]["left"]["$ref"] == "#/$defs/Left"
assert combined_schema["properties"]["right"]["$ref"] == "#/$defs/Right"
assert (
combined_schema["$defs"]["Left"]["properties"]["shared"]["$ref"]
== "#/$defs/Shared"
)
assert (
combined_schema["$defs"]["Right"]["properties"]["shared"]["$ref"]
== "#/$defs/Shared"
)
def test_refs_in_nested_content_schemas(self):
"""$refs in nested content schemas (the original bug location) must be converted."""
route = HTTPRoute(
path="/content",
method="POST",
operation_id="content_test",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {"$ref": "#/components/schemas/Content"}
},
),
request_schemas={
"Content": {
"type": "object",
"properties": {
"media": {
"type": "object",
"properties": {
"application/json": {
"$ref": "#/components/schemas/JsonContent"
}
},
}
},
},
"JsonContent": {
"type": "object",
"properties": {"data": {"type": "string"}},
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# Both schemas should be preserved
assert "Content" in combined_schema["$defs"]
assert "JsonContent" in combined_schema["$defs"]
# Nested ref should be converted
content_def = combined_schema["$defs"]["Content"]
nested_ref = content_def["properties"]["media"]["properties"][
"application/json"
]
assert nested_ref["$ref"] == "#/$defs/JsonContent"
def test_unnecessary_defs_preserved_when_referenced(self):
"""Even seemingly unnecessary $defs must be preserved if they're referenced."""
route = HTTPRoute(
path="/test",
method="POST",
operation_id="test_unnecessary",
request_body=RequestBodyInfo(
required=True,
content_schema={
"application/json": {
"type": "object",
"properties": {
# Reference to a simple type schema
"simple": {"$ref": "#/components/schemas/SimpleString"},
# Reference to an empty object schema
"empty": {"$ref": "#/components/schemas/EmptyObject"},
},
}
},
),
request_schemas={
"SimpleString": {"type": "string"},
"EmptyObject": {"type": "object"},
"UnreferencedSchema": {"type": "number"},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# Referenced schemas should be preserved even if simple
assert "SimpleString" in combined_schema["$defs"]
assert "EmptyObject" in combined_schema["$defs"]
# Unreferenced should be removed
assert "UnreferencedSchema" not in combined_schema["$defs"]
# Refs should be converted
assert combined_schema["properties"]["simple"]["$ref"] == "#/$defs/SimpleString"
assert combined_schema["properties"]["empty"]["$ref"] == "#/$defs/EmptyObject"
def test_ref_only_request_body_handled(self):
"""Request bodies that are just a $ref (not an object with properties) must work."""
route = HTTPRoute(
path="/direct-ref",
method="POST",
operation_id="direct_ref_test",
request_body=RequestBodyInfo(
required=True,
content_schema={
# Direct $ref, not wrapped in an object
"application/json": {"$ref": "#/components/schemas/DirectBody"}
},
),
request_schemas={
"DirectBody": {
"type": "object",
"properties": {
"field1": {"type": "string"},
"nested": {"$ref": "#/components/schemas/NestedBody"},
},
},
"NestedBody": {
"type": "object",
"properties": {"field2": {"type": "number"}},
},
},
)
combined_schema, _ = _combine_schemas_and_map_params(route)
# Should handle the direct ref properly
assert "body" in combined_schema["properties"]
assert combined_schema["properties"]["body"]["$ref"] == "#/$defs/DirectBody"
# Both schemas should be preserved
assert "DirectBody" in combined_schema["$defs"]
assert "NestedBody" in combined_schema["$defs"]
# Nested ref should be converted
assert (
combined_schema["$defs"]["DirectBody"]["properties"]["nested"]["$ref"]
== "#/$defs/NestedBody"
)
def test_separate_input_output_schemas(self):
"""Test that input and output schemas contain different schema
definitions and don't overlap in the ultimate schema definitions."""
# OpenAPI spec with transitive dependencies to force schema inclusion
openapi_spec = {
"openapi": "3.0.1",
"info": {"title": "Test API", "version": "1.0.0"},
"paths": {
"/test": {
"post": {
"summary": "Test endpoint",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InputContainer"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/OutputContainer"
}
}
},
}
},
}
}
},
"components": {
"schemas": {
"InputContainer": {
"type": "object",
"properties": {
"data": {"$ref": "#/components/schemas/InputData"}
},
},
"InputData": {
"type": "object",
"properties": {"input_field": {"type": "string"}},
},
"OutputContainer": {
"type": "object",
"properties": {
"result": {"$ref": "#/components/schemas/OutputData"}
},
},
"OutputData": {
"type": "object",
"properties": {"output_field": {"type": "string"}},
},
"UnusedSchema": {
"type": "object",
"properties": {"unused_field": {"type": "string"}},
},
}
},
}
routes = parse_openapi_to_http_routes(openapi_spec)
assert len(routes) == 1
route = routes[0]
# Check that schemas are properly separated
input_schema_names = set(route.request_schemas.keys())
output_schema_names = set(route.response_schemas.keys())
# Input should contain transitive dependencies from InputContainer
assert "InputData" in input_schema_names, (
f"Expected InputData in request schemas: {input_schema_names}"
)
assert "OutputContainer" not in input_schema_names, (
"OutputContainer should not be in request schemas"
)
assert "OutputData" not in input_schema_names, (
"OutputData should not be in request schemas"
)
# Output should contain transitive dependencies from OutputContainer
assert "OutputData" in output_schema_names, (
f"Expected OutputData in response schemas: {output_schema_names}"
)
assert "InputContainer" not in output_schema_names, (
"InputContainer should not be in response schemas"
)
assert "InputData" not in output_schema_names, (
"InputData should not be in response schemas"
)
# Neither should contain unused schema
assert "UnusedSchema" not in input_schema_names, (
"UnusedSchema should not be in request schemas"
)
assert "UnusedSchema" not in output_schema_names, (
"UnusedSchema should not be in response schemas"
)
# Verify no overlap
overlap = input_schema_names & output_schema_names
assert len(overlap) == 0, (
f"Found overlapping schemas between input and output: {overlap}"
)
|