Harbor format: 871 coding_baseline tasks (part 41)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/LICENSE.sourceAdded+19
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/adapter.jsonAdded+127
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/dependency-setup.shAdded+8
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/environment/DockerfileAdded+3
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/instruction.mdAdded+38
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/metadata.jsonAdded+736
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provenance.jsonAdded+88
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provided-gold.diffAdded+41
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/solution/solve.shAdded+47
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/task.tomlAdded+24
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/check_pytest.pyAdded+91
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/expected-panels.jsonAdded+565
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/grade.pyAdded+128
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/panel-config.jsonAdded+23
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/test.shAdded+6
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted-inventory.jsonAdded+72
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/pyproject.tomlAdded+97
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/__init__.pyAdded
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/conftest.pyAdded+35
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/schemas.pyAdded+85
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_core.pyAdded+1269
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow.pyAdded+1342
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_common.pyAdded+90
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_field.pyAdded+664
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_openapi.pyAdded+685
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_utils.pyAdded+24
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_yaml_utils.pyAdded+47
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/utils.pyAdded+65
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tox.iniAdded+34
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/first-hunk-only.shAdded+29
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/original-bug.shAdded+3
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/openenv.jsonAdded+27
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/LICENSE.sourceAdded+19
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/adapter.jsonAdded+127
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/dependency-setup.shAdded+8
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/environment/DockerfileAdded+3
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/instruction.mdAdded+32
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/metadata.jsonAdded+746
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provenance.jsonAdded+88
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provided-gold.diffAdded+50
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/solution/solve.shAdded+56
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/task.tomlAdded+24
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/check_pytest.pyAdded+91
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/expected-panels.jsonAdded+575
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/grade.pyAdded+128
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/panel-config.jsonAdded+23
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/test.shAdded+6
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted-inventory.jsonAdded+72
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/pyproject.tomlAdded+97
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/tests/__init__.pyAdded
12345678910111213141516171819Copyright Steven Loria, Jérôme Lafréchoux, and contributors
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127{ "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", "dependency_installation_pinned": false, "dependency_setup_sha256": "213839c53a312d83a5569a18303cecdb03befd5a43f54c1af2e7afcf93ea1ac5", "gold_patch_sha256": "de2a4ba1cd39cdd977548d94da03112df3c316b9e2ebce0115e104f82eeff17d", "hostile_code_isolation_established": false, "known_wrong_semantic_implementations": 0, "native_inventory_sha256": "492be585a058a3631e0b331afad30aff9c7199b8690d001a259334c9c024016a", "new_files_deletions_and_executable_modes_supported": true, "official_profile": { "eval_sets": [], "profile_class": "Apispec8b421526", "profile_lines": [ 127, 131 ], "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", "profile_source_path": "swesmith/profiles/python.py", "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", "upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "upstream_repo": "marshmallow-code/apispec" }, "original_bug_canary_nop_equivalent": true, "original_bug_runtime_wrongness_established": false, "partial_repair_canary": true, "partial_repair_sha256": "d646e697c79226f71af6c3237b051bc1752870f3a39cc7116e4641926039be08", "partial_repair_wrongness_established": false, "provided_original_bug_control": true, "repo_url": "https://github.com/swesmith/marshmallow-code__apispec.8b421526.git", "runtime_image": null, "runtime_ready": false, "runtime_recipe": { "dependency_installation_pinned": false, "official_install_cmds": [ "pip install -e .[dev]" ], "official_pytest_argv": [ "pytest", "--disable-warnings", "--color=no", "--tb=no", "--verbose" ], "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", "python_version": "3.10", "source_bound_test_dependency_cmds": [ "python -m pip install 'marshmallow>=3.10.0,<4.0.0'" ], "test_dependency_source_sha256": { "pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4", "tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7" } }, "runtime_resource_review_required": false, "schema": "python-git-patch-jobs-v1", "source_base_commit": "fba1562227e51ef44176e0af5866b30084e89e34", "source_completion_sha256": "c4f70a6d59c4b6677e4f99f817db164d5e9ba3812b205ded396d485c95fa756a", "source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876", "source_pr_url": null, "source_record": { "anti_training_canary": false, "anti_training_reviewed": true, "candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "cloud_launch_ready": false, "eligibility": { "reasons": [], "semantic_nonoverlap_established": false, "status": "eligible_for_controls", "training_admissible": false, "warnings": [] }, "healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "instruction_sha256": "b99d93e7d1ff633d09d46c2987f628b9957c2d97ac0aaf0f29923c7c795bf73a", "is_fork": true, "learner_path": "tasks/8c897387852803297e721ad7/learner", "license_evidence": { "source_code": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE" }, "task_bundle": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" } }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "patch_sha256": "9dccf3389c791cc31b743bcef019e52d81149a6224ee9201699f6ea2855e64da", "provenance_path": "tasks/8c897387852803297e721ad7/source-proof.json", "repository_lineage": [ "swesmith/marshmallow-code__apispec.8b421526", "marshmallow-code/apispec" ], "rfc008_complete": false, "runtime_qualified": false, "semantic_nonoverlap_established": false, "source_commit": "fba1562227e51ef44176e0af5866b30084e89e34", "source_dataset": "SWE-bench/SWE-smith-py", "source_head_commit": "2e76199a4675c36551a60af74281a718099c0598", "source_kind": "mutation", "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", "source_split": "train", "target_model_calibrated": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "task_sha256": "0f66703367994d529603408f2239290015020c9799d54c597935b6458c5e4a38", "training_admissible": false, "upstream_identity_reviewed": true, "upstream_repo": "marshmallow-code/apispec", "usage": "quarantine_only" }, "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "symlink_submodule_changes_supported": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "transfer": "index-independent-worktree-to-Git-binary-patch", "transfer_path": "/testbed/submission.patch", "upstream_repo": "marshmallow-code/apispec"}12345678#!/bin/bashset -Eeuo pipefailsource /opt/miniconda3/bin/activateconda activate testbedcd /testbed/repopython -c 'import sys; assert sys.version_info[:2] == (3, 10)'pip install -e .[dev]python -m pip install 'marshmallow>=3.10.0,<4.0.0'123# Runtime is selected only by an independently qualified immutable amd64 receipt.FROM ubuntu:22.04RUN false1234567891011121314151617181920212223242526272829303132333435363738Schema key generation produces inconsistent results with unhashable attributes
#### Description
When generating schema keys for Marshmallow schemas that contain unhashable attributes (like lists or sets), the key generation function produces inconsistent results due to changes in how these attributes are processed and ordered.
#### Steps/Code to Reproduce
```pythonfrom apispec.ext.marshmallow.common import make_schema_keyimport marshmallow
class TestSchema(marshmallow.Schema): pass
# Create schema instances with unhashable attributesschema1 = TestSchema()schema1.some_list = [1, 2, 3]
schema2 = TestSchema() schema2.some_list = [1, 2, 3]
# These should produce the same key but don'tkey1 = make_schema_key(schema1)key2 = make_schema_key(schema2)
print(f"Key 1: {key1}")print(f"Key 2: {key2}")print(f"Keys equal: {key1 == key2}")```
The schema key generation is not producing consistent results for schemas with the same unhashable attributes, which can lead to duplicate schema definitions or incorrect schema resolution in the OpenAPI spec generation.
This affects schema caching and component registration, potentially causing schemas that should be considered identical to be treated as different schemas.
## Environment
The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest <tests>`. Don't install packages: the tests need nothing else, and the sandbox may have no network access.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736{ "all_runtime_and_training_flags": false, "official_profile": { "eval_sets": [], "profile_class": "Apispec8b421526", "profile_lines": [ 127, 131 ], "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", "profile_source_path": "swesmith/profiles/python.py", "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", "upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "upstream_repo": "marshmallow-code/apispec" }, "source_healthy_reference_proof": { "FAIL_TO_PASS": [ "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]" ], "PASS_TO_PASS": [ "tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version", "tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]", "tests/test_core.py::TestTags::test_tag[2.0]", "tests/test_core.py::TestTags::test_tag[3.0.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[2.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema[2.0]", "tests/test_core.py::TestComponents::test_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema_description[2.0]", "tests/test_core.py::TestComponents::test_schema_description[3.0.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[2.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_response[2.0]", "tests/test_core.py::TestComponents::test_response[3.0.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_parameter[2.0]", "tests/test_core.py::TestComponents::test_parameter[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_header[3.0.0]", "tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_example[3.0.0]", "tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme[2.0]", "tests/test_core.py::TestComponents::test_security_scheme[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_to_yaml[2.0]", "tests/test_core.py::TestComponents::test_to_yaml[3.0.0]", "tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_lazy[2.0]", "tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_response_lazy[2.0]", "tests/test_core.py::TestComponents::test_response_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[2.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_header_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_example_lazy[3.0.0]", "tests/test_core.py::TestPath::test_path[2.0]", "tests/test_core.py::TestPath::test_path[3.0.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[2.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_is_chainable[2.0]", "tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_merges_paths[2.0]", "tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]", "tests/test_core.py::TestPath::test_path_summary_description[2.0]", "tests/test_core.py::TestPath::test_path_summary_description[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]", "tests/test_core.py::TestPath::test_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_global_parameters[2.0]", "tests/test_core.py::TestPath::test_global_parameters[3.0.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_response[2.0]", "tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]", "tests/test_core.py::TestPluginsOrder::test_plugins_order", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types", "tests/test_utils.py::test_build_reference", "tests/test_yaml_utils.py::test_load_yaml_from_docstring", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_dict_to_yaml_unicode", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs" ], "all_git_blobs_modes_verified": true, "cloud_launch_ready": false, "commits": { "bug": "2e76199a4675c36551a60af74281a718099c0598", "healthy": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "learner": "fba1562227e51ef44176e0af5866b30084e89e34" }, "existing_squirrel_snapshot_reused": false, "full_transfer_allowlist": [ "/testbed/.github/FUNDING.yml", "/testbed/.github/dependabot.yml", "/testbed/.gitignore", "/testbed/.pre-commit-config.yaml", "/testbed/AUTHORS.rst", "/testbed/CHANGELOG.rst", "/testbed/CONTRIBUTING.rst", "/testbed/LICENSE", "/testbed/README.rst", "/testbed/RELEASING.md", "/testbed/SECURITY.md", "/testbed/docs/Makefile", "/testbed/docs/api_core.rst", "/testbed/docs/api_ext.rst", "/testbed/docs/authors.rst", "/testbed/docs/changelog.rst", "/testbed/docs/conf.py", "/testbed/docs/contributing.rst", "/testbed/docs/ecosystem.rst", "/testbed/docs/index.rst", "/testbed/docs/install.rst", "/testbed/docs/license.rst", "/testbed/docs/make.bat", "/testbed/docs/quickstart.rst", "/testbed/docs/special_topics.rst", "/testbed/docs/upgrading.rst", "/testbed/docs/using_plugins.rst", "/testbed/docs/writing_plugins.rst", "/testbed/pyproject.toml", "/testbed/readthedocs.yml", "/testbed/src/apispec/__init__.py", "/testbed/src/apispec/core.py", "/testbed/src/apispec/exceptions.py", "/testbed/src/apispec/ext/__init__.py", "/testbed/src/apispec/ext/marshmallow/__init__.py", "/testbed/src/apispec/ext/marshmallow/common.py", "/testbed/src/apispec/ext/marshmallow/field_converter.py", "/testbed/src/apispec/ext/marshmallow/openapi.py", "/testbed/src/apispec/ext/marshmallow/schema_resolver.py", "/testbed/src/apispec/plugin.py", "/testbed/src/apispec/py.typed", "/testbed/src/apispec/utils.py", "/testbed/src/apispec/yaml_utils.py", "/testbed/tests/__init__.py", "/testbed/tests/conftest.py", "/testbed/tests/schemas.py", "/testbed/tests/test_core.py", "/testbed/tests/test_utils.py", "/testbed/tests/test_yaml_utils.py", "/testbed/tests/utils.py", "/testbed/tox.ini" ], "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", "mutation_matches_dataset_and_git_blobs": true, "official_profile": { "eval_sets": [], "profile_class": "Apispec8b421526", "profile_lines": [ 127, 131 ], "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", "profile_source_path": "swesmith/profiles/python.py", "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", "upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "upstream_repo": "marshmallow-code/apispec" }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "private_test_paths": [ "tests/test_ext_marshmallow.py", "tests/test_ext_marshmallow_common.py", "tests/test_ext_marshmallow_field.py", "tests/test_ext_marshmallow_openapi.py" ], "private_tests_unchanged": true, "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", "qwen_calibrated": false, "runtime_qualified": false, "source_paths": [ "src/apispec/ext/marshmallow/common.py" ], "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_stages_bytes": 1020883, "task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", "upstream_repo": "marshmallow-code/apispec" }, "source_record": { "anti_training_canary": false, "anti_training_reviewed": true, "candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "cloud_launch_ready": false, "eligibility": { "reasons": [], "semantic_nonoverlap_established": false, "status": "eligible_for_controls", "training_admissible": false, "warnings": [] }, "healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "instruction_sha256": "b99d93e7d1ff633d09d46c2987f628b9957c2d97ac0aaf0f29923c7c795bf73a", "is_fork": true, "learner_path": "tasks/8c897387852803297e721ad7/learner", "license_evidence": { "source_code": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE" }, "task_bundle": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" } }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "patch_sha256": "9dccf3389c791cc31b743bcef019e52d81149a6224ee9201699f6ea2855e64da", "provenance_path": "tasks/8c897387852803297e721ad7/source-proof.json", "repository_lineage": [ "swesmith/marshmallow-code__apispec.8b421526", "marshmallow-code/apispec" ], "rfc008_complete": false, "runtime_qualified": false, "semantic_nonoverlap_established": false, "source_commit": "fba1562227e51ef44176e0af5866b30084e89e34", "source_dataset": "SWE-bench/SWE-smith-py", "source_head_commit": "2e76199a4675c36551a60af74281a718099c0598", "source_kind": "mutation", "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", "source_split": "train", "target_model_calibrated": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "task_sha256": "0f66703367994d529603408f2239290015020c9799d54c597935b6458c5e4a38", "training_admissible": false, "upstream_identity_reviewed": true, "upstream_repo": "marshmallow-code/apispec", "usage": "quarantine_only" }, "task_kind": "original-source-mutation"}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788{ "generated_reference": false, "healthy_reference_delta_sha256": "de2a4ba1cd39cdd977548d94da03112df3c316b9e2ebce0115e104f82eeff17d", "native_pytest_ids_preserved": true, "original_source_code_license": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE" }, "provided_reference": true, "qwen_calibrated": false, "runtime_qualified": false, "source_completion_sha256": "c4f70a6d59c4b6677e4f99f817db164d5e9ba3812b205ded396d485c95fa756a", "source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876", "source_proof_sha256": "b61faa8c3c2eb9eeb38d0e19ed494a3a219fb65ca5052bb75fd4495ccc303baf", "source_record": { "anti_training_canary": false, "anti_training_reviewed": true, "candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "cloud_launch_ready": false, "eligibility": { "reasons": [], "semantic_nonoverlap_established": false, "status": "eligible_for_controls", "training_admissible": false, "warnings": [] }, "healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "instruction_sha256": "b99d93e7d1ff633d09d46c2987f628b9957c2d97ac0aaf0f29923c7c795bf73a", "is_fork": true, "learner_path": "tasks/8c897387852803297e721ad7/learner", "license_evidence": { "source_code": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE" }, "task_bundle": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" } }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "patch_sha256": "9dccf3389c791cc31b743bcef019e52d81149a6224ee9201699f6ea2855e64da", "provenance_path": "tasks/8c897387852803297e721ad7/source-proof.json", "repository_lineage": [ "swesmith/marshmallow-code__apispec.8b421526", "marshmallow-code/apispec" ], "rfc008_complete": false, "runtime_qualified": false, "semantic_nonoverlap_established": false, "source_commit": "fba1562227e51ef44176e0af5866b30084e89e34", "source_dataset": "SWE-bench/SWE-smith-py", "source_head_commit": "2e76199a4675c36551a60af74281a718099c0598", "source_kind": "mutation", "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", "source_split": "train", "target_model_calibrated": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye", "task_sha256": "0f66703367994d529603408f2239290015020c9799d54c597935b6458c5e4a38", "training_admissible": false, "upstream_identity_reviewed": true, "upstream_repo": "marshmallow-code/apispec", "usage": "quarantine_only" }, "task_bundle_license": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" }, "training_admissible": false, "trusted_tests_sha256": "800ba7da08ca9ff402906f2c3f0f85c4f500c385020e3e6b6d0a029e65c0654e"}1234567891011121314151617181920212223242526272829303132333435363738394041diff --git a/src/apispec/ext/marshmallow/common.py b/src/apispec/ext/marshmallow/common.pyindex 874cc4c4c63773177ad06bd0d75fdf851eaadec4..e5373771ab017e6b7dc138515139ab992c19cfe0 100644--- a/src/apispec/ext/marshmallow/common.py+++ b/src/apispec/ext/marshmallow/common.py@@ -119,14 +119,14 @@ hash(attribute) except TypeError: # Unhashable iterable (list, set)- attribute = list(attribute) # Change from frozenset to list- modifiers.insert(0, attribute) # Change from append to insert at position 0- return tuple([schema.__class__, *reversed(modifiers)]) # Reverse the modifiers to their original order+ attribute = frozenset(attribute)+ modifiers.append(attribute)+ return tuple([schema.__class__, *modifiers]) def get_unique_schema_name(components: Components, name: str, counter: int = 0) -> str: """Function to generate a unique name based on the provided name and names- already in the spec. Will append a number to the name to make it unique if+ already in the spec. Will append a number to the name to make it unique if the name is already in the spec. :param Components components: instance of the components of the spec@@ -134,7 +134,7 @@ :param int counter: the counter of the number of recursions :return: the unique name """- if name not in components.schemas and counter > 0:+ if name not in components.schemas: return name if not counter: # first time through recursion warnings.warn(@@ -145,6 +145,6 @@ stacklevel=2, ) else: # subsequent recursions- name = name[:-len(str(counter)) - 1]- counter -= 1+ name = name[: -len(str(counter))]+ counter += 1 return get_unique_schema_name(components, name + str(counter), counter)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647#!/bin/bashset -Eeuo pipefailcd /testbed/repocat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE'diff --git a/src/apispec/ext/marshmallow/common.py b/src/apispec/ext/marshmallow/common.pyindex 874cc4c4c63773177ad06bd0d75fdf851eaadec4..e5373771ab017e6b7dc138515139ab992c19cfe0 100644--- a/src/apispec/ext/marshmallow/common.py+++ b/src/apispec/ext/marshmallow/common.py@@ -119,14 +119,14 @@ hash(attribute) except TypeError: # Unhashable iterable (list, set)- attribute = list(attribute) # Change from frozenset to list- modifiers.insert(0, attribute) # Change from append to insert at position 0- return tuple([schema.__class__, *reversed(modifiers)]) # Reverse the modifiers to their original order+ attribute = frozenset(attribute)+ modifiers.append(attribute)+ return tuple([schema.__class__, *modifiers]) def get_unique_schema_name(components: Components, name: str, counter: int = 0) -> str: """Function to generate a unique name based on the provided name and names- already in the spec. Will append a number to the name to make it unique if+ already in the spec. Will append a number to the name to make it unique if the name is already in the spec. :param Components components: instance of the components of the spec@@ -134,7 +134,7 @@ :param int counter: the counter of the number of recursions :return: the unique name """- if name not in components.schemas and counter > 0:+ if name not in components.schemas: return name if not counter: # first time through recursion warnings.warn(@@ -145,6 +145,6 @@ stacklevel=2, ) else: # subsequent recursions- name = name[:-len(str(counter)) - 1]- counter -= 1+ name = name[: -len(str(counter))]+ counter += 1 return get_unique_schema_name(components, name + str(counter), counter)OPENENV_REFERENCE/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff123456789101112131415161718192021222324version = "1.0"
[agent]timeout_sec = 1800.0
[verifier]timeout_sec = 900.0
[environment]docker_image = "ghcr.io/younesbelkada/scale800@sha256:7964148413e9a3b3d4d831e52001cc91e4b4f88bec8f2c37affee6ee0a70d039"build_timeout_sec = 600.0cpus = 2memory_mb = 8192storage_mb = 16384
[metadata]author_name = "SWE-smith source adapter"category = "bugfix"tags = ["swe", "python", "mutation-repair"]
[environment.env]# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's# non-interactive shells never run `conda activate`PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091"""Distinguish real pytest failures from missing/setup/verifier evidence."""
import argparseimport jsonimport reimport xml.etree.ElementTree as ETfrom pathlib import Path
def matches(case, target): parts = target.split("::") module = parts[0].removesuffix(".py").replace("/", ".") classname = case.get("classname", "") name = case.get("name", "") if not (classname == module or classname.startswith(module + ".")): return False selector = parts[-1] if len(parts) > 1 else "" classes = parts[1:-1] if classes and classname != module + "." + ".".join(classes): return False return ( not selector or name == selector or ("[" not in selector and name.startswith(selector + "[")) )
def assess(root, expected, native_exit): all_cases = [] actual_failure = False for group in ("pass-to-pass", "fail-to-pass"): path = Path(root) / (group + ".xml") if not path.exists(): if actual_failure: continue raise ValueError("Missing preceding pytest panel") if actual_failure: raise ValueError( "Pytest evidence continued after the native stop-on-failure" ) raw = path.read_bytes() if not 0 < len(raw) <= 4 * 1024**2 or re.search( rb"<!\s*(?:DOCTYPE|ENTITY)", raw, re.I ): raise ValueError("Unbounded or unsafe pytest XML") tree = ET.fromstring(raw) cases = list(tree.iter("testcase")) if len(cases) > 20000: raise ValueError("Too many pytest cases") identities = [(c.get("classname"), c.get("name")) for c in cases] if len(identities) != len(set(identities)): raise ValueError("Duplicate pytest case evidence") targets = expected[group] if any(not any(matches(case, t) for t in targets) for case in cases): raise ValueError("Unexpected pytest case") all_cases.extend(cases) failures = [c for c in cases if c.find("failure") is not None] if any( c.find("error") is not None or c.find("skipped") is not None for c in cases ): raise ValueError("Pytest collection/error/skip is not a completed panel") actual_failure = actual_failure or bool(failures) if not failures and any( not any(matches(case, t) for case in cases) for t in targets ): raise ValueError("Declared pytest target never ran") if actual_failure: if native_exit == 0: raise ValueError("Native verifier exit disagrees with pytest failure") return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} if native_exit != 0: raise ValueError("Setup or native verifier failed without a real test failure") for group in ("pass-to-pass", "fail-to-pass"): if not (Path(root) / (group + ".xml")).is_file(): raise ValueError("Missing completed pytest panel") return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)}
if __name__ == "__main__": p = argparse.ArgumentParser() p.add_argument("--root", required=True) p.add_argument("--expected", required=True) p.add_argument("--native-exit", type=int, required=True) a = p.parse_args() result = assess(a.root, json.loads(Path(a.expected).read_text()), a.native_exit) reward = Path(a.root) / "reward.txt" if reward.read_text().strip() != str(result["reward"]): raise ValueError("Native raw reward disagrees with pytest evidence") (Path(a.root) / "pytest-evidence.json").write_text( json.dumps(result, sort_keys=True) + "\n" )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565{ "fail-to-pass": [ "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]" ], "pass-to-pass": [ "tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version", "tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]", "tests/test_core.py::TestTags::test_tag[2.0]", "tests/test_core.py::TestTags::test_tag[3.0.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[2.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema[2.0]", "tests/test_core.py::TestComponents::test_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema_description[2.0]", "tests/test_core.py::TestComponents::test_schema_description[3.0.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[2.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_response[2.0]", "tests/test_core.py::TestComponents::test_response[3.0.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_parameter[2.0]", "tests/test_core.py::TestComponents::test_parameter[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_header[3.0.0]", "tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_example[3.0.0]", "tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme[2.0]", "tests/test_core.py::TestComponents::test_security_scheme[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_to_yaml[2.0]", "tests/test_core.py::TestComponents::test_to_yaml[3.0.0]", "tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_lazy[2.0]", "tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_response_lazy[2.0]", "tests/test_core.py::TestComponents::test_response_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[2.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_header_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_example_lazy[3.0.0]", "tests/test_core.py::TestPath::test_path[2.0]", "tests/test_core.py::TestPath::test_path[3.0.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[2.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_is_chainable[2.0]", "tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_merges_paths[2.0]", "tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]", "tests/test_core.py::TestPath::test_path_summary_description[2.0]", "tests/test_core.py::TestPath::test_path_summary_description[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]", "tests/test_core.py::TestPath::test_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_global_parameters[2.0]", "tests/test_core.py::TestPath::test_global_parameters[3.0.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_response[2.0]", "tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]", "tests/test_core.py::TestPluginsOrder::test_plugins_order", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types", "tests/test_utils.py::test_build_reference", "tests/test_yaml_utils.py::test_load_yaml_from_docstring", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_dict_to_yaml_unicode", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs" ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128"""Trusted private pytest panel runner. Installed only in a fresh grader Job."""
import hashlibimport importlib.utilimport jsonimport osimport shutilimport statimport subprocessfrom pathlib import Path, PurePosixPath
def sha(raw): return hashlib.sha256(raw).hexdigest()
def safe(value): path = PurePosixPath(value) if ( path.is_absolute() or path.as_posix() != value or not path.parts or any(part in {".", "..", ".git"} for part in path.parts) ): raise ValueError("Unsafe trusted test path") return path
def restore(worktree, private, manifest): worktree, private = Path(worktree), Path(private) captured = {} for name, expected in manifest["files"].items(): path = private / safe(name) info = path.lstat() raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" if ( not stat.S_ISREG(info.st_mode) or len(raw) != expected["bytes"] or sha(raw) != expected["sha256"] or stat.S_IMODE(info.st_mode) != expected["mode"] ): raise ValueError("Trusted private test bytes or modes drifted") captured[name] = (raw, expected["mode"]) # Capture and verify every private byte before changing the submitted tree. for name in manifest["directory_roots"]: destination = worktree / safe(name) if destination.is_symlink(): raise ValueError("Submitted test directory is a symlink") for parent in destination.parents: if parent == worktree: break if parent.is_symlink(): raise ValueError("Submitted test parent is a symlink") if destination.exists(): if not destination.is_dir(): raise ValueError("Submitted test directory is not a directory") shutil.rmtree(destination) for name, (raw, mode) in captured.items(): destination = worktree / safe(name) for parent in destination.parents: if parent == worktree: break if parent.is_symlink(): raise ValueError("Submitted test parent is a symlink") if destination.is_symlink(): raise ValueError("Submitted trusted file is a symlink") destination.parent.mkdir(parents=True, exist_ok=True) destination.write_bytes(raw) destination.chmod(mode)
def run(worktree, private_root, output, invoke=None): private_root, output, worktree = Path(private_root), Path(output), Path(worktree) expected = json.loads((private_root / "expected-panels.json").read_bytes()) config = json.loads((private_root / "panel-config.json").read_bytes()) manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) restore(worktree, private_root / "trusted", manifest) output.mkdir(parents=True, exist_ok=True) for name in ( "reward.txt", "pass-to-pass.xml", "fail-to-pass.xml", "pytest-evidence.json", ): (output / name).unlink(missing_ok=True) environment = dict(os.environ) for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): environment.pop(key, None) commands, native_exit = [], 0 invoke = invoke or subprocess.run for group in ("pass-to-pass", "fail-to-pass"): if ( not isinstance(expected[group], list) or not expected[group] or any( not isinstance(target, str) or not target for target in expected[group] ) ): raise ValueError("Frozen native pytest selectors are incomplete") command = [ *config["official_pytest_argv"], "--override-ini=addopts=", "--junitxml=" + str(output / (group + ".xml")), *expected[group], ] result = invoke(command, cwd=worktree, env=environment, check=False) native_exit = result.returncode commands.append({"group": group, "argv": command, "exit_code": native_exit}) if native_exit != 0: break (output / "pytest-commands.json").write_text( json.dumps(commands, sort_keys=True) + "\n" ) spec = importlib.util.spec_from_file_location( "trusted_pytest_result", private_root / "check_pytest.py" ) checker = importlib.util.module_from_spec(spec) spec.loader.exec_module(checker) result = checker.assess(output, expected, native_exit) (output / "reward.txt").write_text(str(result["reward"]) + "\n") (output / "pytest-evidence.json").write_text( json.dumps(result, sort_keys=True) + "\n" ) return result
if __name__ == "__main__": run("/testbed/repo", "/tests", "/logs/verifier")1234567891011121314151617181920212223{ "dependency_installation_pinned": false, "official_install_cmds": [ "pip install -e .[dev]" ], "official_pytest_argv": [ "pytest", "--disable-warnings", "--color=no", "--tb=no", "--verbose" ], "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", "python_version": "3.10", "source_bound_test_dependency_cmds": [ "python -m pip install 'marshmallow>=3.10.0,<4.0.0'" ], "test_dependency_source_sha256": { "pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4", "tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7" }}123456#!/bin/bashset -Eeuo pipefailsource /opt/miniconda3/bin/activateconda activate testbedcd /testbed/repoexec python -I /tests/grade.py123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172{ "directory_roots": [ "tests" ], "files": { "pyproject.toml": { "bytes": 2488, "mode": 420, "sha256": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4" }, "tests/__init__.py": { "bytes": 0, "mode": 420, "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, "tests/conftest.py": { "bytes": 810, "mode": 420, "sha256": "0009b46d9e729e75bd002d1e0864afaca1f96a6953ce60f8389410bebd0787e2" }, "tests/schemas.py": { "bytes": 2130, "mode": 420, "sha256": "64084646e19c70bf1170dd6639bdd6800dd92a3983074ed2841fae60fbaaec61" }, "tests/test_core.py": { "bytes": 51766, "mode": 420, "sha256": "18ca6c50d1894f5b4fc3d981412341ceed3cc1401bca7ab5ec0c8688b2c67ff3" }, "tests/test_ext_marshmallow.py": { "bytes": 52950, "mode": 420, "sha256": "12f40adf8f18db5073d9f0b692562c528eebc008307e982149da48c7fb600cf5" }, "tests/test_ext_marshmallow_common.py": { "bytes": 3236, "mode": 420, "sha256": "e17249f21422b2fa79f74f51898f242cb1e9786d0ba6df58bc3086d928d51d79" }, "tests/test_ext_marshmallow_field.py": { "bytes": 22438, "mode": 420, "sha256": "39223a47f90ca40e515a7e34ac8806087b3e0ba2968f6832b0a4a77c8c7226b1" }, "tests/test_ext_marshmallow_openapi.py": { "bytes": 24310, "mode": 420, "sha256": "d4edc2675840f8cc7ba0dda6169e2ab3e5c59907e20ae26576d4860828cb9e6b" }, "tests/test_utils.py": { "bytes": 918, "mode": 420, "sha256": "54f00d286b489440bc17cbbb162fcd53c7aedd8f96dea8d5064f44f70c026810" }, "tests/test_yaml_utils.py": { "bytes": 1285, "mode": 420, "sha256": "4a4af4dc1f013207b65093d25ac67809409c1ec7f63f03122a27bf9e1c873003" }, "tests/utils.py": { "bytes": 1806, "mode": 420, "sha256": "a0de7ce4c28047b674ffe7d5ff4cf2b9d97a07378b529c1f058a7099838ea000" }, "tox.ini": { "bytes": 778, "mode": 420, "sha256": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7" } }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697[project]name = "apispec"version = "6.8.1"description = "A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)."readme = "README.rst"license = { file = "LICENSE" }authors = [{ name = "Steven Loria", email = "sloria1@gmail.com" }]maintainers = [ { name = "Steven Loria", email = "sloria1@gmail.com" }, { name = "Jérôme Lafréchoux", email = "jerome@jolimont.fr" },]classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13",]keywords = [ "apispec", "swagger", "openapi", "specification", "oas", "documentation", "spec", "rest", "api",]requires-python = ">=3.9"dependencies = ["packaging>=21.3"]
[project.urls]Changelog = "https://apispec.readthedocs.io/en/latest/changelog.html"Funding = "https://opencollective.com/marshmallow"Issues = "https://github.com/marshmallow-code/apispec/issues"Source = "https://github.com/marshmallow-code/apispec"Tidelift = "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi"
[project.optional-dependencies]yaml = ["PyYAML>=3.10"]marshmallow = ["marshmallow>=3.18.0"]docs = [ "apispec[marshmallow]", "pyyaml==6.0.2", "sphinx==8.1.3", "sphinx-issues==5.0.0", "sphinx-rtd-theme==3.0.2",]tests = ["apispec[yaml,marshmallow]", "openapi-spec-validator==0.7.1", "pytest"]dev = ["apispec[tests]", "tox", "pre-commit>=3.5,<5.0"]
[build-system]requires = ["flit_core<4"]build-backend = "flit_core.buildapi"
[tool.flit.sdist]include = [ "docs/", "tests/", "CHANGELOG.rst", "CONTRIBUTING.rst", "SECURITY.md", "tox.ini",]exclude = ["docs/_build/"]
[tool.ruff]src = ["src"]fix = trueshow-fixes = trueoutput-format = "full"
[tool.ruff.format]docstring-code-format = true
[tool.ruff.lint]ignore = ["E203", "E266", "E501", "E731"]select = [ "B", # flake8-bugbear "E", # pycodestyle error "F", # pyflakes "I", # isort "UP", # pyupgrade "W", # pycodestyle warning]
[tool.mypy]ignore_missing_imports = truewarn_unreachable = truewarn_unused_ignores = truewarn_redundant_casts = trueno_implicit_optional = true1234567891011121314151617181920212223242526272829303132333435from collections import namedtuple
import pytest
from apispec import APISpecfrom apispec.ext.marshmallow import MarshmallowPlugin
def make_spec(openapi_version): ma_plugin = MarshmallowPlugin() spec = APISpec( title="Validation", version="0.1", openapi_version=openapi_version, plugins=(ma_plugin,), ) return namedtuple("Spec", ("spec", "marshmallow_plugin", "openapi"))( spec, ma_plugin, ma_plugin.converter )
@pytest.fixture(params=("2.0", "3.0.0"))def spec_fixture(request): return make_spec(request.param)
@pytest.fixture(params=("2.0", "3.0.0"))def spec(request): return make_spec(request.param).spec
@pytest.fixture(params=("2.0", "3.0.0"))def openapi(request): spec = make_spec(request.param) return spec.openapi12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485from marshmallow import Schema, fields
class PetSchema(Schema): description = dict(id="Pet id", name="Pet name", password="Password") id = fields.Int(dump_only=True, metadata={"description": description["id"]}) name = fields.Str( required=True, metadata={ "description": description["name"], "deprecated": False, "allowEmptyValue": False, }, ) password = fields.Str( load_only=True, metadata={"description": description["password"]} )
class SampleSchema(Schema): runs = fields.Nested("RunSchema", many=True)
count = fields.Int()
class RunSchema(Schema): sample = fields.Nested(SampleSchema)
class AnalysisSchema(Schema): sample = fields.Nested(SampleSchema)
class AnalysisWithListSchema(Schema): samples = fields.List(fields.Nested(SampleSchema))
class PatternedObjectSchema(Schema): count = fields.Int(dump_only=True, metadata={"x-count": 1}) count2 = fields.Int(dump_only=True, metadata={"x_count2": 2})
class SelfReferencingSchema(Schema): id = fields.Int() single = fields.Nested(lambda: SelfReferencingSchema()) multiple = fields.Nested(lambda: SelfReferencingSchema(many=True))
class OrderedSchema(Schema): field1 = fields.Int() field2 = fields.Int() field3 = fields.Int() field4 = fields.Int() field5 = fields.Int()
class Meta: ordered = True
class DefaultValuesSchema(Schema): number_auto_default = fields.Int(load_default=12) number_manual_default = fields.Int(load_default=12, metadata={"default": 42}) string_callable_default = fields.Str(load_default=lambda: "Callable") string_manual_default = fields.Str( load_default=lambda: "Callable", metadata={"default": "Manual"} ) numbers = fields.List(fields.Int, load_default=list)
class CategorySchema(Schema): id = fields.Int() name = fields.Str(required=True) breed = fields.Str(dump_only=True)
class CustomList(fields.List): pass
class CustomStringField(fields.String): pass
class CustomIntegerField(fields.Integer): pass123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269import copyfrom http import HTTPStatus
import pytestimport yaml
from apispec import APISpec, BasePluginfrom apispec.exceptions import ( APISpecError, DuplicateComponentNameError, DuplicateParameterError, InvalidParameterError,)
from .utils import ( build_ref, get_examples, get_headers, get_parameters, get_paths, get_responses, get_schemas, get_security_schemes,)
description = "This is a sample Petstore server. You can find out more "'about Swagger at <a href="http://swagger.wordnik.com">http://swagger.wordnik.com</a> '"or on irc.freenode.net, #swagger. For this sample, you can use the api "'key "special-key" to test the authorization filters'
class RefsSchemaTestMixin: REFS_SCHEMA = { "properties": { "nested": "NestedSchema", "deep_nested": {"properties": {"nested": "NestedSchema"}}, "nested_list": {"items": "DeepNestedSchema"}, "deep_nested_list": { "items": {"properties": {"nested": "DeepNestedSchema"}} }, "allof": { "allOf": [ "AllOfSchema", {"properties": {"nested": "AllOfSchema"}}, ] }, "oneof": { "oneOf": [ "OneOfSchema", {"properties": {"nested": "OneOfSchema"}}, ] }, "anyof": { "anyOf": [ "AnyOfSchema", {"properties": {"nested": "AnyOfSchema"}}, ] }, "not": "NotSchema", "deep_not": {"properties": {"nested": "DeepNotSchema"}}, } }
@staticmethod def assert_schema_refs(spec, schema): props = schema["properties"] assert props["nested"] == build_ref(spec, "schema", "NestedSchema") assert props["deep_nested"]["properties"]["nested"] == build_ref( spec, "schema", "NestedSchema" ) assert props["nested_list"]["items"] == build_ref( spec, "schema", "DeepNestedSchema" ) assert props["deep_nested_list"]["items"]["properties"]["nested"] == build_ref( spec, "schema", "DeepNestedSchema" ) assert props["allof"]["allOf"][0] == build_ref(spec, "schema", "AllOfSchema") assert props["allof"]["allOf"][1]["properties"]["nested"] == build_ref( spec, "schema", "AllOfSchema" ) assert props["oneof"]["oneOf"][0] == build_ref(spec, "schema", "OneOfSchema") assert props["oneof"]["oneOf"][1]["properties"]["nested"] == build_ref( spec, "schema", "OneOfSchema" ) assert props["anyof"]["anyOf"][0] == build_ref(spec, "schema", "AnyOfSchema") assert props["anyof"]["anyOf"][1]["properties"]["nested"] == build_ref( spec, "schema", "AnyOfSchema" ) assert props["not"] == build_ref(spec, "schema", "NotSchema") assert props["deep_not"]["properties"]["nested"] == build_ref( spec, "schema", "DeepNotSchema" )
@pytest.fixture(params=("2.0", "3.0.0"))def spec(request): openapi_version = request.param if openapi_version == "2.0": security_kwargs = {"security": [{"apiKey": []}]} else: security_kwargs = { "components": { "securitySchemes": { "bearerAuth": dict(type="http", scheme="bearer", bearerFormat="JWT") }, "schemas": { "ErrorResponse": { "type": "object", "properties": { "ok": { "type": "boolean", "description": "status indicator", "example": False, } }, "required": ["ok"], } }, } } return APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, info={"description": description}, **security_kwargs, )
class TestAPISpecInit: def test_raises_wrong_apispec_version(self): message = "Not a valid OpenAPI version number:" with pytest.raises(APISpecError, match=message): APISpec( "Swagger Petstore", version="1.0.0", openapi_version="4.0", # 4.0 is not supported info={"description": description}, security=[{"apiKey": []}], )
class TestMetadata: def test_openapi_metadata(self, spec): metadata = spec.to_dict() assert metadata["info"]["title"] == "Swagger Petstore" assert metadata["info"]["version"] == "1.0.0" assert metadata["info"]["description"] == description if spec.openapi_version.major < 3: assert metadata["swagger"] == str(spec.openapi_version) assert metadata["security"] == [{"apiKey": []}] else: assert metadata["openapi"] == str(spec.openapi_version) security_schemes = { "bearerAuth": dict(type="http", scheme="bearer", bearerFormat="JWT") } assert metadata["components"]["securitySchemes"] == security_schemes assert metadata["components"]["schemas"].get("ErrorResponse", False) assert metadata["info"]["title"] == "Swagger Petstore" assert metadata["info"]["version"] == "1.0.0" assert metadata["info"]["description"] == description
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_openapi_metadata_merge_v3(self, spec): properties = { "ok": { "type": "boolean", "description": "property description", "example": True, } } spec.components.schema( "definition", {"properties": properties, "description": "description"} ) metadata = spec.to_dict() assert metadata["components"]["schemas"].get("ErrorResponse", False) assert metadata["components"]["schemas"].get("definition", False)
class TestTags: tag = { "name": "MyTag", "description": "This tag gathers all API endpoints which are mine.", }
def test_tag(self, spec): spec.tag(self.tag) tags_json = spec.to_dict()["tags"] assert self.tag in tags_json
def test_tag_is_chainable(self, spec): spec.tag({"name": "tag1"}).tag({"name": "tag2"}) assert spec.to_dict()["tags"] == [{"name": "tag1"}, {"name": "tag2"}]
class TestComponents(RefsSchemaTestMixin): properties = { "id": {"type": "integer", "format": "int64"}, "name": {"type": "string", "example": "doggie"}, }
def test_schema(self, spec): spec.components.schema("Pet", {"properties": self.properties}) schemas = get_schemas(spec) assert "Pet" in schemas assert schemas["Pet"]["properties"] == self.properties
def test_schema_is_chainable(self, spec): spec.components.schema("Pet", {"properties": {}}).schema( "Plant", {"properties": {}} ) schemas = get_schemas(spec) assert "Pet" in schemas assert "Plant" in schemas
def test_schema_description(self, spec): model_description = "An animal which lives with humans." spec.components.schema( "Pet", {"properties": self.properties, "description": model_description} ) schemas = get_schemas(spec) assert schemas["Pet"]["description"] == model_description
def test_schema_stores_enum(self, spec): enum = ["name", "photoUrls"] spec.components.schema("Pet", {"properties": self.properties, "enum": enum}) schemas = get_schemas(spec) assert schemas["Pet"]["enum"] == enum
def test_schema_discriminator(self, spec): spec.components.schema( "Pet", {"properties": self.properties, "discriminator": "name"} ) schemas = get_schemas(spec) assert schemas["Pet"]["discriminator"] == "name"
def test_schema_duplicate_name(self, spec): spec.components.schema("Pet", {"properties": self.properties}) with pytest.raises( DuplicateComponentNameError, match='Another schema with name "Pet" is already registered.', ): spec.components.schema("Pet", properties=self.properties)
def test_response(self, spec): response = {"description": "Pet not found"} spec.components.response("NotFound", response) responses = get_responses(spec) assert responses["NotFound"] == response
def test_response_is_chainable(self, spec): spec.components.response("resp1").response("resp2") responses = get_responses(spec) assert "resp1" in responses assert "resp2" in responses
def test_response_duplicate_name(self, spec): spec.components.response("test_response") with pytest.raises( DuplicateComponentNameError, match='Another response with name "test_response" is already registered.', ): spec.components.response("test_response")
def test_parameter(self, spec): # Note: this is an OpenAPI v2 parameter header # but is does the job for the test even for OpenAPI v3 parameter = {"format": "int64", "type": "integer"} spec.components.parameter("PetId", "path", parameter) params = get_parameters(spec) assert params["PetId"] == { "format": "int64", "type": "integer", "in": "path", "name": "PetId", "required": True, }
def test_parameter_is_chainable(self, spec): spec.components.parameter("param1", "path").parameter("param2", "path") params = get_parameters(spec) assert "param1" in params assert "param2" in params
def test_parameter_duplicate_name(self, spec): spec.components.parameter("test_parameter", "path") with pytest.raises( DuplicateComponentNameError, match='Another parameter with name "test_parameter" is already registered.', ): spec.components.parameter("test_parameter", "path")
# Referenced headers are only supported in OAS 3.x @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_header(self, spec): header = {"schema": {"type": "string"}} spec.components.header("test_header", header.copy()) headers = get_headers(spec) assert headers["test_header"] == header
# Referenced headers are only supported in OAS 3.x @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_header_is_chainable(self, spec): header = {"schema": {"type": "string"}} spec.components.header("header1", header).header("header2", header) headers = get_headers(spec) assert "header1" in headers assert "header2" in headers
# Referenced headers are only supported in OAS 3.x @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_header_duplicate_name(self, spec): spec.components.header("test_header", {"schema": {"type": "string"}}) with pytest.raises( DuplicateComponentNameError, match='Another header with name "test_header" is already registered.', ): spec.components.header("test_header", {"schema": {"type": "integer"}})
# Referenced examples are only supported in OAS 3.x @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_example(self, spec): spec.components.example("test_example", {"value": {"a": "b"}}) examples = get_examples(spec) assert examples["test_example"]["value"] == {"a": "b"}
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_example_is_chainable(self, spec): spec.components.example("test_example_1", {}).example("test_example_2", {}) examples = get_examples(spec) assert "test_example_1" in examples assert "test_example_2" in examples
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_example_duplicate_name(self, spec): spec.components.example("test_example", {}) with pytest.raises( DuplicateComponentNameError, match='Another example with name "test_example" is already registered.', ): spec.components.example("test_example", {})
def test_security_scheme(self, spec): sec_scheme = {"type": "apiKey", "in": "header", "name": "X-API-Key"} spec.components.security_scheme("ApiKeyAuth", sec_scheme) assert get_security_schemes(spec)["ApiKeyAuth"] == sec_scheme
def test_security_scheme_is_chainable(self, spec): spec.components.security_scheme("sec_1", {}).security_scheme("sec_2", {}) security_schemes = get_security_schemes(spec) assert "sec_1" in security_schemes assert "sec_2" in security_schemes
def test_security_scheme_duplicate_name(self, spec): sec_scheme_1 = {"type": "apiKey", "in": "header", "name": "X-API-Key"} sec_scheme_2 = {"type": "apiKey", "in": "header", "name": "X-API-Key-2"} spec.components.security_scheme("ApiKeyAuth", sec_scheme_1) with pytest.raises( DuplicateComponentNameError, match='Another security scheme with name "ApiKeyAuth" is already registered.', ): spec.components.security_scheme("ApiKeyAuth", sec_scheme_2)
def test_to_yaml(self, spec): enum = ["name", "photoUrls"] spec.components.schema("Pet", properties=self.properties, enum=enum) assert spec.to_dict() == yaml.safe_load(spec.to_yaml())
def test_components_can_be_accessed_by_plugin_in_init_spec(self): class TestPlugin(BasePlugin): def init_spec(self, spec): spec.components.schema( "TestSchema", {"properties": {"key": {"type": "string"}}, "type": "object"}, )
spec = APISpec( "Test API", version="0.0.1", openapi_version="2.0", plugins=[TestPlugin()] ) assert get_schemas(spec) == { "TestSchema": {"properties": {"key": {"type": "string"}}, "type": "object"} }
def test_components_resolve_refs_in_schema(self, spec): spec.components.schema("refs_schema", copy.deepcopy(self.REFS_SCHEMA)) self.assert_schema_refs(spec, get_schemas(spec)["refs_schema"])
def test_components_resolve_response_schema(self, spec): schema = {"schema": "PetSchema"} if spec.openapi_version.major >= 3: schema = {"content": {"application/json": schema}} spec.components.response("Response", schema) resp = get_responses(spec)["Response"] if spec.openapi_version.major < 3: schema = resp["schema"] else: schema = resp["content"]["application/json"]["schema"] assert schema == build_ref(spec, "schema", "PetSchema")
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_response_header(self, spec): response = {"headers": {"header_1": "Header_1"}} spec.components.response("Response", response) resp = get_responses(spec)["Response"] header_1 = resp["headers"]["header_1"] assert header_1 == build_ref(spec, "header", "Header_1")
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_response_header_schema(self, spec): response = {"headers": {"header_1": {"name": "Pet", "schema": "PetSchema"}}} spec.components.response("Response", response) resp = get_responses(spec)["Response"] header_1 = resp["headers"]["header_1"] assert header_1["schema"] == build_ref(spec, "schema", "PetSchema")
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_response_header_examples(self, spec): response = { "headers": { "header_1": {"name": "Pet", "examples": {"example_1": "Example_1"}} } } spec.components.response("Response", response) resp = get_responses(spec)["Response"] header_1 = resp["headers"]["header_1"] assert header_1["examples"]["example_1"] == build_ref( spec, "example", "Example_1" )
# "examples" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_response_examples(self, spec): response = { "content": {"application/json": {"examples": {"example_1": "Example_1"}}} } spec.components.response("Response", response) resp = get_responses(spec)["Response"] example_1 = resp["content"]["application/json"]["examples"]["example_1"] assert example_1 == build_ref(spec, "example", "Example_1")
def test_components_resolve_refs_in_response_schema(self, spec): schema = copy.deepcopy(self.REFS_SCHEMA) if spec.openapi_version.major >= 3: response = {"content": {"application/json": {"schema": schema}}} else: response = {"schema": schema} spec.components.response("Response", response) resp = get_responses(spec)["Response"] if spec.openapi_version.major < 3: schema = resp["schema"] else: schema = resp["content"]["application/json"]["schema"] self.assert_schema_refs(spec, schema)
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_refs_in_response_header_schema(self, spec): header = {"schema": copy.deepcopy(self.REFS_SCHEMA)} response = {"headers": {"header": header}} spec.components.response("Response", response) resp = get_responses(spec)["Response"] self.assert_schema_refs(spec, resp["headers"]["header"]["schema"])
# "examples" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_parameter_examples(self, spec): parameter = { "examples": {"example_1": "Example_1"}, } spec.components.parameter("param", "path", parameter) param = get_parameters(spec)["param"] example_1 = param["examples"]["example_1"] assert example_1 == build_ref(spec, "example", "Example_1")
def test_components_resolve_parameter_schemas(self, spec): parameter = {"schema": "PetSchema"} spec.components.parameter("param", "path", parameter) param = get_parameters(spec)["param"] assert param["schema"] == build_ref(spec, "schema", "PetSchema")
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_parameter_schemas_v3(self, spec): parameter = {"content": {"application/json": {"schema": "PetSchema"}}} spec.components.parameter("param", "path", parameter) param = get_parameters(spec)["param"] schema = param["content"]["application/json"]["schema"] assert schema == build_ref(spec, "schema", "PetSchema")
def test_components_resolve_refs_in_parameter_schema(self, spec): parameter = {"schema": copy.deepcopy(self.REFS_SCHEMA)} spec.components.parameter("param", "path", parameter) self.assert_schema_refs(spec, get_parameters(spec)["param"]["schema"])
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_header_schema(self, spec): header = {"name": "Pet", "schema": "PetSchema"} spec.components.header("header", header) header = get_headers(spec)["header"] assert header["schema"] == build_ref(spec, "schema", "PetSchema")
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_header_examples(self, spec): header = {"name": "Pet", "examples": {"example_1": "Example_1"}} spec.components.header("header", header) header = get_headers(spec)["header"] assert header["examples"]["example_1"] == build_ref( spec, "example", "Example_1" )
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_components_resolve_refs_in_header_schema(self, spec): header = {"schema": copy.deepcopy(self.REFS_SCHEMA)} spec.components.header("header", header) self.assert_schema_refs(spec, get_headers(spec)["header"]["schema"])
def test_schema_lazy(self, spec): spec.components.schema("Pet_1", {"properties": self.properties}, lazy=False) spec.components.schema("Pet_2", {"properties": self.properties}, lazy=True) schemas = get_schemas(spec) assert "Pet_1" in schemas assert "Pet_2" not in schemas spec.components.schema("PetFriend", {"oneOf": ["Pet_1", "Pet_2"]}) schemas = get_schemas(spec) assert "Pet_2" in schemas assert schemas["Pet_2"]["properties"] == self.properties
def test_response_lazy(self, spec): response_1 = {"description": "Response 1"} response_2 = {"description": "Response 2"} spec.components.response("Response_1", response_1, lazy=False) spec.components.response("Response_2", response_2, lazy=True) responses = get_responses(spec) assert "Response_1" in responses assert "Response_2" not in responses spec.path("/path", operations={"get": {"responses": {"200": "Response_2"}}}) responses = get_responses(spec) assert "Response_2" in responses
def test_parameter_lazy(self, spec): parameter = {"format": "int64", "type": "integer"} spec.components.parameter("Param_1", "path", parameter, lazy=False) spec.components.parameter("Param_2", "path", parameter, lazy=True) params = get_parameters(spec) assert "Param_1" in params assert "Param_2" not in params spec.path("/path", operations={"get": {"parameters": ["Param_1", "Param_2"]}}) assert "Param_2" in params
# Referenced headers are only supported in OAS 3.x @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_header_lazy(self, spec): header = {"schema": {"type": "string"}} spec.components.header("Header_1", header, lazy=False) spec.components.header("Header_2", header, lazy=True) headers = get_headers(spec) assert "Header_1" in headers assert "Header_2" not in headers spec.path( "/path", operations={ "get": {"responses": {"200": {"headers": {"header_2": "Header_2"}}}} }, ) assert "Header_2" in headers
# Referenced examples are only supported in OAS 3.x @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_example_lazy(self, spec): spec.components.example("Example_1", {"value": {"a": "b"}}, lazy=False) spec.components.example("Example_2", {"value": {"a": "b"}}, lazy=True) examples = get_examples(spec) assert "Example_1" in examples assert "Example_2" not in examples spec.path( "/path", operations={ "get": { "responses": { "200": { "content": { "application/json": { "examples": {"example_2": "Example_2"} } } } } } }, ) assert "Example_2" in examples
class TestPath(RefsSchemaTestMixin): paths = { "/pet/{petId}": { "get": { "parameters": [ { "required": True, "format": "int64", "name": "petId", "in": "path", "type": "integer", "description": "ID of pet that needs to be fetched", } ], "responses": { "200": {"description": "successful operation"}, "400": {"description": "Invalid ID supplied"}, "404": {"description": "Pet not found"}, }, "produces": ["application/json", "application/xml"], "operationId": "getPetById", "summary": "Find pet by ID", "description": ( "Returns a pet when ID < 10. " "ID > 10 or nonintegers will simulate API error conditions" ), "tags": ["pet"], } } }
def test_path(self, spec): route_spec = self.paths["/pet/{petId}"]["get"] spec.path( path="/pet/{petId}", operations=dict( get=dict( parameters=route_spec["parameters"], responses=route_spec["responses"], produces=route_spec["produces"], operationId=route_spec["operationId"], summary=route_spec["summary"], description=route_spec["description"], tags=route_spec["tags"], ) ), )
p = get_paths(spec)["/pet/{petId}"]["get"] assert p["parameters"] == route_spec["parameters"] assert p["responses"] == route_spec["responses"] assert p["operationId"] == route_spec["operationId"] assert p["summary"] == route_spec["summary"] assert p["description"] == route_spec["description"] assert p["tags"] == route_spec["tags"]
def test_paths_maintain_order(self, spec): spec.path(path="/path1") spec.path(path="/path2") spec.path(path="/path3") spec.path(path="/path4") assert list(spec.to_dict()["paths"].keys()) == [ "/path1", "/path2", "/path3", "/path4", ]
def test_path_is_chainable(self, spec): spec.path(path="/path1").path("/path2") assert list(spec.to_dict()["paths"].keys()) == ["/path1", "/path2"]
def test_path_methods_maintain_order(self, spec): methods = ["get", "post", "put", "patch", "delete", "head", "options"] for method in methods: spec.path(path="/path", operations={method: {}}) assert list(spec.to_dict()["paths"]["/path"]) == methods
def test_path_merges_paths(self, spec): """Test that adding a second HTTP method to an existing path performs a merge operation instead of an overwrite""" path = "/pet/{petId}" route_spec = self.paths[path]["get"] spec.path(path=path, operations=dict(get=route_spec)) spec.path( path=path, operations=dict( put=dict( parameters=route_spec["parameters"], responses=route_spec["responses"], produces=route_spec["produces"], operationId="updatePet", summary="Updates an existing Pet", description="Use this method to make changes to Pet `petId`", tags=route_spec["tags"], ) ), )
p = get_paths(spec)[path] assert "get" in p assert "put" in p
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0")) def test_path_called_twice_with_same_operations_parameters(self, openapi_version): """Test calling path twice with same operations or parameters
operations and parameters being mutated by clean_operations and plugin helpers should not make path fail on second call """
class TestPlugin(BasePlugin): def path_helper(self, path, operations, parameters, **kwargs): """Mutate operations and parameters""" operations.update({"post": {"responses": {"201": "201ResponseRef"}}}) parameters.append("ParamRef_3") return path
spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, plugins=[TestPlugin()], )
path = "/pet/{petId}" parameters = ["ParamRef_1"] operation = { "parameters": ["ParamRef_2"], "responses": {"200": "200ResponseRef"}, }
spec.path(path=path, operations={"get": operation}, parameters=parameters) spec.path(path=path, operations={"put": operation}, parameters=parameters) operations = (get_paths(spec))[path] assert ( operations["get"] == operations["put"] == { "parameters": [build_ref(spec, "parameter", "ParamRef_2")], "responses": {"200": build_ref(spec, "response", "200ResponseRef")}, } ) assert operations["parameters"] == [ build_ref(spec, "parameter", "ParamRef_1"), build_ref(spec, "parameter", "ParamRef_3"), ]
def test_path_ensures_path_parameters_required(self, spec): path = "/pet/{petId}" spec.path( path=path, operations=dict(put=dict(parameters=[{"name": "petId", "in": "path"}])), ) assert get_paths(spec)[path]["put"]["parameters"][0]["required"] is True
def test_path_with_no_path_raises_error(self, spec): message = "Path template is not specified" with pytest.raises(APISpecError, match=message): spec.path()
def test_path_summary_description(self, spec): summary = "Operations on a Pet" description = "Operations on a Pet identified by its ID" spec.path(path="/pet/{petId}", summary=summary, description=description)
p = get_paths(spec)["/pet/{petId}"] assert p["summary"] == summary assert p["description"] == description
def test_path_resolves_parameter(self, spec): route_spec = self.paths["/pet/{petId}"]["get"] spec.components.parameter("test_parameter", "path", route_spec["parameters"][0]) spec.path( path="/pet/{petId}", operations={"get": {"parameters": ["test_parameter"]}} ) p = get_paths(spec)["/pet/{petId}"]["get"] assert p["parameters"][0] == build_ref(spec, "parameter", "test_parameter")
@pytest.mark.parametrize( "parameters", ([{"name": "petId"}], [{"in": "path"}]), # missing "in" # missing "name" ) def test_path_invalid_parameter(self, spec, parameters): path = "/pet/{petId}"
with pytest.raises(InvalidParameterError): spec.path(path=path, operations=dict(put={}, get={}), parameters=parameters)
def test_parameter_duplicate(self, spec): spec.path( path="/pet/{petId}", operations={ "get": { "parameters": [ {"name": "petId", "in": "path"}, {"name": "petId", "in": "query"}, ] } }, )
with pytest.raises(DuplicateParameterError): spec.path( path="/pet/{petId}", operations={ "get": { "parameters": [ {"name": "petId", "in": "path"}, {"name": "petId", "in": "path"}, ] } }, )
def test_global_parameters(self, spec): path = "/pet/{petId}" route_spec = self.paths["/pet/{petId}"]["get"]
spec.components.parameter("test_parameter", "path", route_spec["parameters"][0]) spec.path( path=path, operations=dict(put={}, get={}), parameters=[{"name": "petId", "in": "path"}, "test_parameter"], )
assert get_paths(spec)[path]["parameters"] == [ {"name": "petId", "in": "path", "required": True}, build_ref(spec, "parameter", "test_parameter"), ]
def test_global_parameter_duplicate(self, spec): path = "/pet/{petId}" spec.path( path=path, operations=dict(put={}, get={}), parameters=[ {"name": "petId", "in": "path"}, {"name": "petId", "in": "query"}, ], )
assert get_paths(spec)[path]["parameters"] == [ {"name": "petId", "in": "path", "required": True}, {"name": "petId", "in": "query"}, ]
with pytest.raises(DuplicateParameterError): spec.path( path=path, operations=dict(put={}, get={}), parameters=[ {"name": "petId", "in": "path"}, {"name": "petId", "in": "path"}, "test_parameter", ], )
def test_path_resolves_response(self, spec): route_spec = self.paths["/pet/{petId}"]["get"] spec.components.response("test_response", route_spec["responses"]["200"]) spec.path( path="/pet/{petId}", operations={"get": {"responses": {"200": "test_response"}}}, ) p = get_paths(spec)["/pet/{petId}"]["get"] assert p["responses"]["200"] == build_ref(spec, "response", "test_response")
def test_path_response_with_HTTPStatus_code(self, spec): code = HTTPStatus(200) spec.path( path="/pet/{petId}", operations={"get": {"responses": {code: "test_response"}}}, )
assert "200" in get_paths(spec)["/pet/{petId}"]["get"]["responses"]
def test_path_response_with_status_code_range(self, spec, recwarn): status_code = "2XX"
spec.path( path="/pet/{petId}", operations={"get": {"responses": {status_code: "test_response"}}}, )
if spec.openapi_version.major < 3: assert len(recwarn) == 1 assert recwarn.pop(UserWarning)
assert status_code in get_paths(spec)["/pet/{petId}"]["get"]["responses"]
def test_path_check_invalid_http_method(self, spec): spec.path("/pet/{petId}", operations={"get": {}}) spec.path("/pet/{petId}", operations={"x-dummy": {}}) message = "One or more HTTP methods are invalid" with pytest.raises(APISpecError, match=message): spec.path("/pet/{petId}", operations={"dummy": {}})
def test_path_resolve_response_schema(self, spec): schema = {"schema": "PetSchema"} if spec.openapi_version.major >= 3: schema = {"content": {"application/json": schema}} spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] if spec.openapi_version.major < 3: schema = resp["schema"] else: schema = resp["content"]["application/json"]["schema"] assert schema == build_ref(spec, "schema", "PetSchema")
# callbacks only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_callbacks(self, spec): parameter = {"name": "petId", "in": "query", "schema": "PetSchema"} spec.path( "/pet/{petId}", operations={ "get": { "callbacks": { "onEvent": { "/callback/{petId}": { "post": { "parameters": [parameter], "requestBody": { "content": { "application/json": {"schema": "PetSchema"} } }, "responses": { "200": { "content": { "application/json": { "schema": "PetSchema" } } } }, } } } }, } }, ) path = get_paths(spec)["/pet/{petId}"] schema_ref = build_ref(spec, "schema", "PetSchema") callback_op = path["get"]["callbacks"]["onEvent"]["/callback/{petId}"]["post"] assert callback_op["parameters"][0]["schema"] == schema_ref assert ( callback_op["requestBody"]["content"]["application/json"]["schema"] == schema_ref ) assert ( callback_op["responses"]["200"]["content"]["application/json"]["schema"] == schema_ref )
# requestBody only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_request_body(self, spec): spec.path( "/pet/{petId}", operations={ "get": { "requestBody": { "content": {"application/json": {"schema": "PetSchema"}} } } }, ) assert get_paths(spec)["/pet/{petId}"]["get"]["requestBody"]["content"][ "application/json" ]["schema"] == build_ref(spec, "schema", "PetSchema")
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_response_header(self, spec): response = {"headers": {"header_1": "Header_1"}} spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] header_1 = resp["headers"]["header_1"] assert header_1 == build_ref(spec, "header", "Header_1")
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_response_header_schema(self, spec): response = {"headers": {"header_1": {"name": "Pet", "schema": "PetSchema"}}} spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] header_1 = resp["headers"]["header_1"] assert header_1["schema"] == build_ref(spec, "schema", "PetSchema")
# "headers" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_response_header_examples(self, spec): response = { "headers": { "header_1": {"name": "Pet", "examples": {"example_1": "Example_1"}} } } spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] header_1 = resp["headers"]["header_1"] assert header_1["examples"]["example_1"] == build_ref( spec, "example", "Example_1" )
# "examples" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_response_examples(self, spec): response = { "content": {"application/json": {"examples": {"example_1": "Example_1"}}} } spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] example_1 = resp["content"]["application/json"]["examples"]["example_1"] assert example_1 == build_ref(spec, "example", "Example_1")
# "examples" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_request_body_examples(self, spec): request_body = { "content": {"application/json": {"examples": {"example_1": "Example_1"}}} } spec.path("/pet/{petId}", operations={"get": {"requestBody": request_body}}) reqbdy = get_paths(spec)["/pet/{petId}"]["get"]["requestBody"] example_1 = reqbdy["content"]["application/json"]["examples"]["example_1"] assert example_1 == build_ref(spec, "example", "Example_1")
# "examples" components section only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_parameter_examples(self, spec): parameter = { "name": "test", "in": "query", "examples": {"example_1": "Example_1"}, } spec.path("/pet/{petId}", operations={"get": {"parameters": [parameter]}}) param = get_paths(spec)["/pet/{petId}"]["get"]["parameters"][0] example_1 = param["examples"]["example_1"] assert example_1 == build_ref(spec, "example", "Example_1")
def test_path_resolve_parameter_schemas(self, spec): parameter = {"name": "test", "in": "query", "schema": "PetSchema"} spec.path("/pet/{petId}", operations={"get": {"parameters": [parameter]}}) param = get_paths(spec)["/pet/{petId}"]["get"]["parameters"][0] assert param["schema"] == build_ref(spec, "schema", "PetSchema")
def test_path_resolve_refs_in_response_schema(self, spec): if spec.openapi_version.major >= 3: schema = {"content": {"application/json": {"schema": self.REFS_SCHEMA}}} else: schema = {"schema": self.REFS_SCHEMA} spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] if spec.openapi_version.major < 3: schema = resp["schema"] else: schema = resp["content"]["application/json"]["schema"] self.assert_schema_refs(spec, schema)
def test_path_resolve_refs_in_parameter_schema(self, spec): schema = copy.copy({"schema": self.REFS_SCHEMA}) schema["in"] = "query" schema["name"] = "test" spec.path("/pet/{petId}", operations={"get": {"parameters": [schema]}}) schema = get_paths(spec)["/pet/{petId}"]["get"]["parameters"][0]["schema"] self.assert_schema_refs(spec, schema)
# requestBody only exists in OAS 3 @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_path_resolve_refs_in_request_body_schema(self, spec): schema = {"content": {"application/json": {"schema": self.REFS_SCHEMA}}} spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] schema = resp["content"]["application/json"]["schema"] self.assert_schema_refs(spec, schema)
class TestPlugins: @staticmethod def make_test_plugin(return_none=False): class TestPlugin(BasePlugin): """Test Plugin
return_none allows to check plugin helpers returning ``None`` Inputs are mutated to allow testing only a copy is passed. """
def schema_helper(self, name, definition, **kwargs): definition.pop("dummy", None) if not return_none: return {"properties": {"name": {"type": "string"}}}
def parameter_helper(self, parameter, **kwargs): parameter.pop("dummy", None) if not return_none: return {"description": "some parameter"}
def response_helper(self, response, **kwargs): response.pop("dummy", None) if not return_none: return {"description": "42"}
def header_helper(self, header, **kwargs): header.pop("dummy", None) if not return_none: return {"description": "some header"}
def path_helper(self, path, operations, parameters, **kwargs): if not return_none: if path == "/path_1": operations.update({"get": {"responses": {"200": {}}}}) parameters.append({"name": "page", "in": "query"}) return "/path_1_modified"
def operation_helper(self, path, operations, **kwargs): if path == "/path_2": operations["post"] = {"responses": {"201": {}}}
return TestPlugin()
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0")) @pytest.mark.parametrize("return_none", (True, False)) def test_plugin_schema_helper_is_used(self, openapi_version, return_none): spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, plugins=(self.make_test_plugin(return_none),), ) schema = {"dummy": "dummy"} spec.components.schema("Pet", schema) definitions = get_schemas(spec) if return_none: assert definitions["Pet"] == {} else: assert definitions["Pet"] == {"properties": {"name": {"type": "string"}}} # Check original schema is not modified assert schema == {"dummy": "dummy"}
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0")) @pytest.mark.parametrize("return_none", (True, False)) def test_plugin_parameter_helper_is_used(self, openapi_version, return_none): spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, plugins=(self.make_test_plugin(return_none),), ) parameter = {"dummy": "dummy"} spec.components.parameter("Pet", "body", parameter) parameters = get_parameters(spec) if return_none: assert parameters["Pet"] == {"in": "body", "name": "Pet"} else: assert parameters["Pet"] == { "in": "body", "name": "Pet", "description": "some parameter", } # Check original parameter is not modified assert parameter == {"dummy": "dummy"}
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0")) @pytest.mark.parametrize("return_none", (True, False)) def test_plugin_response_helper_is_used(self, openapi_version, return_none): spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, plugins=(self.make_test_plugin(return_none),), ) response = {"dummy": "dummy"} spec.components.response("Pet", response) responses = get_responses(spec) if return_none: assert responses["Pet"] == {} else: assert responses["Pet"] == {"description": "42"} # Check original response is not modified assert response == {"dummy": "dummy"}
@pytest.mark.parametrize("openapi_version", ("3.0.0",)) @pytest.mark.parametrize("return_none", (True, False)) def test_plugin_header_helper_is_used(self, openapi_version, return_none): spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, plugins=(self.make_test_plugin(return_none),), ) header = {"dummy": "dummy"} spec.components.header("Pet", header) headers = get_headers(spec) if return_none: assert headers["Pet"] == {} else: assert headers["Pet"] == { "description": "some header", } # Check original header is not modified assert header == {"dummy": "dummy"}
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0")) @pytest.mark.parametrize("return_none", (True, False)) def test_plugin_path_helper_is_used(self, openapi_version, return_none): spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, plugins=(self.make_test_plugin(return_none),), ) spec.path("/path_1") paths = get_paths(spec) assert len(paths) == 1 if return_none: assert paths["/path_1"] == {} else: assert paths["/path_1_modified"] == { "get": {"responses": {"200": {}}}, "parameters": [{"in": "query", "name": "page"}], }
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0")) def test_plugin_operation_helper_is_used(self, openapi_version): spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version=openapi_version, plugins=(self.make_test_plugin(),), ) spec.path("/path_2", operations={"post": {"responses": {"200": {}}}}) paths = get_paths(spec) assert len(paths) == 1 assert paths["/path_2"] == {"post": {"responses": {"201": {}}}}
class TestPluginsOrder: class OrderedPlugin(BasePlugin): def __init__(self, index, output): super().__init__() self.index = index self.output = output
def path_helper(self, path, operations, **kwargs): self.output.append(f"plugin_{self.index}_path")
def operation_helper(self, path, operations, **kwargs): self.output.append(f"plugin_{self.index}_operations")
def test_plugins_order(self): """Test plugins execution order in APISpec.path
- All path helpers are called, then all operation helpers, then all response helpers. - At each step, helpers are executed in the order the plugins are passed to APISpec. """ output = [] spec = APISpec( title="Swagger Petstore", version="1.0.0", openapi_version="3.0.0", plugins=(self.OrderedPlugin(1, output), self.OrderedPlugin(2, output)), ) spec.path("/path", operations={"get": {"responses": {200: {}}}}) assert output == [ "plugin_1_path", "plugin_2_path", "plugin_1_operations", "plugin_2_operations", ]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342import json
import pytestfrom marshmallow import Schemafrom marshmallow.fields import DateTime, Dict, Field, List, Nested, String, TimeDelta
from apispec import APISpecfrom apispec.exceptions import APISpecErrorfrom apispec.ext.marshmallow import MarshmallowPlugin, common
from .schemas import ( AnalysisSchema, AnalysisWithListSchema, DefaultValuesSchema, OrderedSchema, PatternedObjectSchema, PetSchema, RunSchema, SampleSchema, SelfReferencingSchema,)from .utils import ( build_ref, get_headers, get_parameters, get_paths, get_responses, get_schemas,)
class TestDefinitionHelper: @pytest.mark.parametrize("schema", [PetSchema, PetSchema()]) def test_can_use_schema_as_definition(self, spec, schema): spec.components.schema("Pet", schema=schema) definitions = get_schemas(spec) props = definitions["Pet"]["properties"]
assert props["id"]["type"] == "integer" assert props["name"]["type"] == "string"
def test_schema_helper_without_schema(self, spec): spec.components.schema("Pet", {"properties": {"key": {"type": "integer"}}}) definitions = get_schemas(spec) assert definitions["Pet"]["properties"] == {"key": {"type": "integer"}}
@pytest.mark.parametrize("schema", [AnalysisSchema, AnalysisSchema()]) def test_resolve_schema_dict_auto_reference(self, schema): def resolver(schema): schema_cls = common.resolve_schema_cls(schema) return schema_cls.__name__
spec = APISpec( title="Test auto-reference", version="0.1", openapi_version="2.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) with pytest.raises(KeyError): get_schemas(spec)
spec.components.schema("analysis", schema=schema) spec.path( "/test", operations={ "get": { "responses": { "200": {"schema": build_ref(spec, "schema", "analysis")} } } }, ) definitions = get_schemas(spec) assert 3 == len(definitions)
assert "analysis" in definitions assert "SampleSchema" in definitions assert "RunSchema" in definitions
@pytest.mark.parametrize( "schema", [AnalysisWithListSchema, AnalysisWithListSchema()] ) def test_resolve_schema_dict_auto_reference_in_list(self, schema): def resolver(schema): schema_cls = common.resolve_schema_cls(schema) return schema_cls.__name__
spec = APISpec( title="Test auto-reference", version="0.1", openapi_version="2.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) with pytest.raises(KeyError): get_schemas(spec)
spec.components.schema("analysis", schema=schema) spec.path( "/test", operations={ "get": { "responses": { "200": {"schema": build_ref(spec, "schema", "analysis")} } } }, ) definitions = get_schemas(spec) assert 3 == len(definitions)
assert "analysis" in definitions assert "SampleSchema" in definitions assert "RunSchema" in definitions
@pytest.mark.parametrize("schema", [AnalysisSchema, AnalysisSchema()]) def test_resolve_schema_dict_auto_reference_return_none(self, schema): def resolver(schema): return None
spec = APISpec( title="Test auto-reference", version="0.1", openapi_version="2.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) with pytest.raises(KeyError): get_schemas(spec)
with pytest.raises( APISpecError, match="Name resolver returned None for schema" ): spec.components.schema("analysis", schema=schema)
@pytest.mark.parametrize("schema", [AnalysisSchema, AnalysisSchema()]) def test_warning_when_schema_added_twice(self, spec, schema): spec.components.schema("Analysis", schema=schema) with pytest.warns(UserWarning, match="has already been added to the spec"): spec.components.schema("DuplicateAnalysis", schema=schema)
def test_schema_instances_with_different_modifiers_added(self, spec): class MultiModifierSchema(Schema): pet_unmodified = Nested(PetSchema) pet_exclude = Nested(PetSchema, exclude=("name",))
spec.components.schema("Pet", schema=PetSchema()) spec.components.schema("Pet_Exclude", schema=PetSchema(exclude=("name",)))
spec.components.schema("MultiModifierSchema", schema=MultiModifierSchema)
definitions = get_schemas(spec) pet_unmodified_ref = definitions["MultiModifierSchema"]["properties"][ "pet_unmodified" ] assert pet_unmodified_ref == build_ref(spec, "schema", "Pet")
pet_exclude = definitions["MultiModifierSchema"]["properties"]["pet_exclude"] assert pet_exclude == build_ref(spec, "schema", "Pet_Exclude")
def test_schema_instance_with_different_modifers_custom_resolver(self, recwarn): class MultiModifierSchema(Schema): pet_unmodified = Nested(PetSchema) pet_exclude = Nested(PetSchema(partial=True))
def resolver(schema): schema_instance = common.resolve_schema_instance(schema) prefix = "Partial-" if schema_instance.partial else "" schema_cls = common.resolve_schema_cls(schema) name = prefix + schema_cls.__name__ if name.endswith("Schema"): return name[:-6] or name return name
spec = APISpec( title="Test Custom Resolver for Partial", version="0.1", openapi_version="2.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), )
spec.components.schema("NameClashSchema", schema=MultiModifierSchema) assert not recwarn
def test_schema_with_clashing_names(self, spec): class Pet(PetSchema): another_field = String()
class NameClashSchema(Schema): pet_1 = Nested(PetSchema) pet_2 = Nested(Pet)
with pytest.warns( UserWarning, match="Multiple schemas resolved to the name Pet" ): spec.components.schema("NameClashSchema", schema=NameClashSchema)
definitions = get_schemas(spec)
assert "Pet" in definitions assert "Pet1" in definitions
def test_resolve_nested_schema_many_true_resolver_return_none(self): def resolver(schema): return None
class PetFamilySchema(Schema): pets_1 = Nested(PetSchema, many=True) pets_2 = List(Nested(PetSchema))
spec = APISpec( title="Test auto-reference", version="0.1", openapi_version="2.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), )
spec.components.schema("PetFamily", schema=PetFamilySchema) props = get_schemas(spec)["PetFamily"]["properties"] pets_1 = props["pets_1"] pets_2 = props["pets_2"] assert pets_1["type"] == pets_2["type"] == "array"
class TestComponentParameterHelper: @pytest.mark.parametrize("schema", [PetSchema, PetSchema()]) def test_can_use_schema_in_parameter(self, spec, schema): param = {"schema": schema} spec.components.parameter("Pet", "body", param) parameter = get_parameters(spec)["Pet"] assert parameter["in"] == "body" reference = parameter["schema"] assert reference == build_ref(spec, "schema", "Pet")
resolved_schema = spec.components.schemas["Pet"] assert resolved_schema["properties"]["name"]["type"] == "string" assert resolved_schema["properties"]["password"]["type"] == "string" assert resolved_schema["properties"]["id"]["type"] == "integer"
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) @pytest.mark.parametrize("schema", [PetSchema, PetSchema()]) def test_can_use_schema_in_parameter_with_content(self, spec, schema): param = {"content": {"application/json": {"schema": schema}}} spec.components.parameter("Pet", "body", param) parameter = get_parameters(spec)["Pet"] assert parameter["in"] == "body" reference = parameter["content"]["application/json"]["schema"] assert reference == build_ref(spec, "schema", "Pet")
resolved_schema = spec.components.schemas["Pet"] assert resolved_schema["properties"]["name"]["type"] == "string" assert resolved_schema["properties"]["password"]["type"] == "string" assert resolved_schema["properties"]["id"]["type"] == "integer"
class TestComponentResponseHelper: @pytest.mark.parametrize("schema", [PetSchema, PetSchema()]) def test_can_use_schema_in_response(self, spec, schema): if spec.openapi_version.major < 3: resp = {"schema": schema} else: resp = {"content": {"application/json": {"schema": schema}}} spec.components.response("GetPetOk", resp) response = get_responses(spec)["GetPetOk"] if spec.openapi_version.major < 3: reference = response["schema"] else: reference = response["content"]["application/json"]["schema"] assert reference == build_ref(spec, "schema", "Pet")
resolved_schema = spec.components.schemas["Pet"] assert resolved_schema["properties"]["id"]["type"] == "integer" assert resolved_schema["properties"]["name"]["type"] == "string" assert resolved_schema["properties"]["password"]["type"] == "string"
@pytest.mark.parametrize("schema", [PetSchema, PetSchema()]) def test_can_use_schema_in_response_header(self, spec, schema): resp = {"headers": {"PetHeader": {"schema": schema}}} spec.components.response("GetPetOk", resp) response = get_responses(spec)["GetPetOk"] reference = response["headers"]["PetHeader"]["schema"] assert reference == build_ref(spec, "schema", "Pet")
resolved_schema = spec.components.schemas["Pet"] assert resolved_schema["properties"]["id"]["type"] == "integer" assert resolved_schema["properties"]["name"]["type"] == "string" assert resolved_schema["properties"]["password"]["type"] == "string"
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) def test_content_without_schema(self, spec): resp = {"content": {"application/json": {"example": {"name": "Example"}}}} spec.components.response("GetPetOk", resp) response = get_responses(spec)["GetPetOk"] assert response == resp
class TestComponentHeaderHelper: @pytest.mark.parametrize("spec", ("3.0.0",), indirect=True) @pytest.mark.parametrize("schema", [PetSchema, PetSchema()]) def test_can_use_schema_in_header(self, spec, schema): param = {"schema": schema} spec.components.header("Pet", param) header = get_headers(spec)["Pet"] reference = header["schema"] assert reference == build_ref(spec, "schema", "Pet")
resolved_schema = spec.components.schemas["Pet"] assert resolved_schema["properties"]["name"]["type"] == "string" assert resolved_schema["properties"]["password"]["type"] == "string" assert resolved_schema["properties"]["id"]["type"] == "integer"
class TestCustomField: def test_can_use_custom_field_decorator(self, spec_fixture): class CustomNameA(Field): pass
spec_fixture.marshmallow_plugin.map_to_openapi_type(CustomNameA, DateTime)
class CustomNameB(Field): pass
spec_fixture.marshmallow_plugin.map_to_openapi_type( CustomNameB, "integer", "int32" )
class BadCustomField(Field): pass
with pytest.raises(TypeError): spec_fixture.marshmallow_plugin.map_to_openapi_type( BadCustomField, "integer" )
class CustomPetASchema(PetSchema): name = CustomNameA()
class CustomPetBSchema(PetSchema): name = CustomNameB()
spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.components.schema("CustomPetA", schema=CustomPetASchema) spec_fixture.spec.components.schema("CustomPetB", schema=CustomPetBSchema)
props_0 = get_schemas(spec_fixture.spec)["Pet"]["properties"] props_a = get_schemas(spec_fixture.spec)["CustomPetA"]["properties"] props_b = get_schemas(spec_fixture.spec)["CustomPetB"]["properties"]
assert props_0["name"]["type"] == "string" assert "format" not in props_0["name"]
assert props_a["name"]["type"] == "string" assert props_a["name"]["format"] == "date-time"
assert props_b["name"]["type"] == "integer" assert props_b["name"]["format"] == "int32"
def get_nested_schema(schema, field_name): try: return schema._declared_fields[field_name]._schema except AttributeError: return schema._declared_fields[field_name]._Nested__schema
class TestOperationHelper: @pytest.fixture def make_pet_callback_spec(self, spec_fixture): def _make_pet_spec(operations): spec_fixture.spec.path( path="/pet", operations={ "post": {"callbacks": {"petEvent": {"petCallbackUrl": operations}}} }, ) return spec_fixture
return _make_pet_spec
@pytest.mark.parametrize( "pet_schema", (PetSchema, PetSchema(), PetSchema(many=True), "tests.schemas.PetSchema"), ) @pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_v2(self, spec_fixture, pet_schema): spec_fixture.spec.path( path="/pet", operations={ "get": { "responses": { 200: { "schema": pet_schema, "description": "successful operation", "headers": {"PetHeader": {"schema": pet_schema}}, } } } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] if isinstance(pet_schema, Schema) and pet_schema.many is True: assert get["responses"]["200"]["schema"]["type"] == "array" schema_reference = get["responses"]["200"]["schema"]["items"] assert ( get["responses"]["200"]["headers"]["PetHeader"]["schema"]["type"] == "array" ) header_reference = get["responses"]["200"]["headers"]["PetHeader"][ "schema" ]["items"] else: schema_reference = get["responses"]["200"]["schema"] header_reference = get["responses"]["200"]["headers"]["PetHeader"]["schema"] assert schema_reference == build_ref(spec_fixture.spec, "schema", "Pet") assert header_reference == build_ref(spec_fixture.spec, "schema", "Pet") assert len(spec_fixture.spec.components.schemas) == 1 resolved_schema = spec_fixture.spec.components.schemas["Pet"] assert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema) assert get["responses"]["200"]["description"] == "successful operation"
@pytest.mark.parametrize( "pet_schema", (PetSchema, PetSchema(), PetSchema(many=True), "tests.schemas.PetSchema"), ) @pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_schema_v3(self, spec_fixture, pet_schema): spec_fixture.spec.path( path="/pet", operations={ "get": { "responses": { 200: { "content": {"application/json": {"schema": pet_schema}}, "description": "successful operation", "headers": {"PetHeader": {"schema": pet_schema}}, } } } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] if isinstance(pet_schema, Schema) and pet_schema.many is True: assert ( get["responses"]["200"]["content"]["application/json"]["schema"]["type"] == "array" ) schema_reference = get["responses"]["200"]["content"]["application/json"][ "schema" ]["items"] assert ( get["responses"]["200"]["headers"]["PetHeader"]["schema"]["type"] == "array" ) header_reference = get["responses"]["200"]["headers"]["PetHeader"][ "schema" ]["items"] else: schema_reference = get["responses"]["200"]["content"]["application/json"][ "schema" ] header_reference = get["responses"]["200"]["headers"]["PetHeader"]["schema"]
assert schema_reference == build_ref(spec_fixture.spec, "schema", "Pet") assert header_reference == build_ref(spec_fixture.spec, "schema", "Pet") assert len(spec_fixture.spec.components.schemas) == 1 resolved_schema = spec_fixture.spec.components.schemas["Pet"] assert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema) assert get["responses"]["200"]["description"] == "successful operation"
@pytest.mark.parametrize( "pet_schema", (PetSchema, PetSchema(), PetSchema(many=True), "tests.schemas.PetSchema"), ) @pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_callback_schema_v3(self, make_pet_callback_spec, pet_schema): spec_fixture = make_pet_callback_spec( { "get": { "responses": { "200": { "content": {"application/json": {"schema": pet_schema}}, "description": "successful operation", "headers": {"PetHeader": {"schema": pet_schema}}, } } } } ) p = get_paths(spec_fixture.spec)["/pet"] c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"] get = c["get"] if isinstance(pet_schema, Schema) and pet_schema.many is True: assert ( get["responses"]["200"]["content"]["application/json"]["schema"]["type"] == "array" ) schema_reference = get["responses"]["200"]["content"]["application/json"][ "schema" ]["items"] assert ( get["responses"]["200"]["headers"]["PetHeader"]["schema"]["type"] == "array" ) header_reference = get["responses"]["200"]["headers"]["PetHeader"][ "schema" ]["items"] else: schema_reference = get["responses"]["200"]["content"]["application/json"][ "schema" ] header_reference = get["responses"]["200"]["headers"]["PetHeader"]["schema"]
assert schema_reference == build_ref(spec_fixture.spec, "schema", "Pet") assert header_reference == build_ref(spec_fixture.spec, "schema", "Pet") assert len(spec_fixture.spec.components.schemas) == 1 resolved_schema = spec_fixture.spec.components.schemas["Pet"] assert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema) assert get["responses"]["200"]["description"] == "successful operation"
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_expand_parameters_v2(self, spec_fixture): spec_fixture.spec.path( path="/pet", operations={ "get": {"parameters": [{"in": "query", "schema": PetSchema}]}, "post": { "parameters": [ { "in": "body", "description": "a pet schema", "required": True, "name": "pet", "schema": PetSchema, } ] }, }, ) p = get_paths(spec_fixture.spec)["/pet"] get = p["get"] assert get["parameters"] == spec_fixture.openapi.schema2parameters( PetSchema(), location="query" ) post = p["post"] assert post["parameters"] == spec_fixture.openapi.schema2parameters( PetSchema, location="body", required=True, name="pet", description="a pet schema", )
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_schema_expand_parameters_v3(self, spec_fixture): spec_fixture.spec.path( path="/pet", operations={ "get": {"parameters": [{"in": "query", "schema": PetSchema}]}, "post": { "requestBody": { "description": "a pet schema", "required": True, "content": {"application/json": {"schema": PetSchema}}, } }, }, ) p = get_paths(spec_fixture.spec)["/pet"] get = p["get"] assert get["parameters"] == spec_fixture.openapi.schema2parameters( PetSchema(), location="query" ) for parameter in get["parameters"]: description = parameter.get("description", False) assert description name = parameter["name"] assert description == PetSchema.description[name] post = p["post"] post_schema = spec_fixture.marshmallow_plugin.resolver.resolve_schema_dict( PetSchema ) assert ( post["requestBody"]["content"]["application/json"]["schema"] == post_schema ) assert post["requestBody"]["description"] == "a pet schema" assert post["requestBody"]["required"]
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_callback_schema_expand_parameters_v3(self, make_pet_callback_spec): spec_fixture = make_pet_callback_spec( { "get": {"parameters": [{"in": "query", "schema": PetSchema}]}, "post": { "requestBody": { "description": "a pet schema", "required": True, "content": {"application/json": {"schema": PetSchema}}, } }, } ) p = get_paths(spec_fixture.spec)["/pet"] c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"] get = c["get"] assert get["parameters"] == spec_fixture.openapi.schema2parameters( PetSchema(), location="query" ) for parameter in get["parameters"]: description = parameter.get("description", False) assert description name = parameter["name"] assert description == PetSchema.description[name] post = c["post"] post_schema = spec_fixture.marshmallow_plugin.resolver.resolve_schema_dict( PetSchema ) assert ( post["requestBody"]["content"]["application/json"]["schema"] == post_schema ) assert post["requestBody"]["description"] == "a pet schema" assert post["requestBody"]["required"]
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_uses_ref_if_available_v2(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={"get": {"responses": {200: {"schema": PetSchema}}}} ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert get["responses"]["200"]["schema"] == build_ref( spec_fixture.spec, "schema", "Pet" )
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_schema_uses_ref_if_available_v3(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={ "get": { "responses": { 200: {"content": {"application/json": {"schema": PetSchema}}} } } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert get["responses"]["200"]["content"]["application/json"][ "schema" ] == build_ref(spec_fixture.spec, "schema", "Pet")
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_callback_schema_uses_ref_if_available_v3(self, make_pet_callback_spec): spec_fixture = make_pet_callback_spec( { "get": { "responses": { "200": {"content": {"application/json": {"schema": PetSchema}}} } } } ) p = get_paths(spec_fixture.spec)["/pet"] c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"] get = c["get"] assert get["responses"]["200"]["content"]["application/json"][ "schema" ] == build_ref(spec_fixture.spec, "schema", "Pet")
def test_schema_uses_ref_if_available_name_resolver_returns_none_v2(self): def resolver(schema): return None
spec = APISpec( title="Test auto-reference", version="0.1", openapi_version="2.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) spec.components.schema("Pet", schema=PetSchema) spec.path( path="/pet", operations={"get": {"responses": {200: {"schema": PetSchema}}}} ) get = get_paths(spec)["/pet"]["get"] assert get["responses"]["200"]["schema"] == build_ref(spec, "schema", "Pet")
def test_schema_uses_ref_if_available_name_resolver_returns_none_v3(self): def resolver(schema): return None
spec = APISpec( title="Test auto-reference", version="0.1", openapi_version="3.0.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) spec.components.schema("Pet", schema=PetSchema) spec.path( path="/pet", operations={ "get": { "responses": { 200: {"content": {"application/json": {"schema": PetSchema}}} } } }, ) get = get_paths(spec)["/pet"]["get"] assert get["responses"]["200"]["content"]["application/json"][ "schema" ] == build_ref(spec, "schema", "Pet")
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_resolver_allof_v2(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.components.schema("Sample", schema=SampleSchema) spec_fixture.spec.path( path="/pet", operations={ "get": { "responses": {200: {"schema": {"allOf": [PetSchema, SampleSchema]}}} } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert get["responses"]["200"]["schema"] == { "allOf": [ build_ref(spec_fixture.spec, "schema", "Pet"), build_ref(spec_fixture.spec, "schema", "Sample"), ] }
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) @pytest.mark.parametrize("combinator", ["oneOf", "anyOf", "allOf"]) def test_schema_resolver_oneof_anyof_allof_v3(self, spec_fixture, combinator): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={ "get": { "responses": { 200: { "content": { "application/json": { "schema": {combinator: [PetSchema, SampleSchema]} } } } } } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert get["responses"]["200"]["content"]["application/json"]["schema"] == { combinator: [ build_ref(spec_fixture.spec, "schema", "Pet"), build_ref(spec_fixture.spec, "schema", "Sample"), ] }
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_resolver_not_v2(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={"get": {"responses": {200: {"schema": {"not": PetSchema}}}}}, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert get["responses"]["200"]["schema"] == { "not": build_ref(spec_fixture.spec, "schema", "Pet"), }
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_schema_resolver_not_v3(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={ "get": { "responses": { 200: { "content": { "application/json": {"schema": {"not": PetSchema}} } } } } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert get["responses"]["200"]["content"]["application/json"]["schema"] == { "not": build_ref(spec_fixture.spec, "schema", "Pet"), }
@pytest.mark.parametrize( "pet_schema", (PetSchema, PetSchema(), "tests.schemas.PetSchema"), ) def test_schema_name_resolver_returns_none_v2(self, pet_schema): def resolver(schema): return None
spec = APISpec( title="Test resolver returns None", version="0.1", openapi_version="2.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) spec.path( path="/pet", operations={"get": {"responses": {200: {"schema": pet_schema}}}}, ) get = get_paths(spec)["/pet"]["get"] assert "properties" in get["responses"]["200"]["schema"]
@pytest.mark.parametrize( "pet_schema", (PetSchema, PetSchema(), "tests.schemas.PetSchema"), ) def test_schema_name_resolver_returns_none_v3(self, pet_schema): def resolver(schema): return None
spec = APISpec( title="Test resolver returns None", version="0.1", openapi_version="3.0.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) spec.path( path="/pet", operations={ "get": { "responses": { 200: {"content": {"application/json": {"schema": pet_schema}}} } } }, ) get = get_paths(spec)["/pet"]["get"] assert ( "properties" in get["responses"]["200"]["content"]["application/json"]["schema"] )
def test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3(self): def resolver(schema): return None
spec = APISpec( title="Test auto-reference", version="0.1", openapi_version="3.0.0", plugins=(MarshmallowPlugin(schema_name_resolver=resolver),), ) spec.components.schema("Pet", schema=PetSchema) spec.path( path="/pet", operations={ "post": { "callbacks": { "petEvent": { "petCallbackUrl": { "get": { "responses": { "200": { "content": { "application/json": { "schema": PetSchema } } } } } } } } } }, ) p = get_paths(spec)["/pet"] c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"] get = c["get"] assert get["responses"]["200"]["content"]["application/json"][ "schema" ] == build_ref(spec, "schema", "Pet")
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_uses_ref_in_parameters_and_request_body_if_available_v2( self, spec_fixture ): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={ "get": {"parameters": [{"in": "query", "schema": PetSchema}]}, "post": {"parameters": [{"in": "body", "schema": PetSchema}]}, }, ) p = get_paths(spec_fixture.spec)["/pet"] assert "schema" not in p["get"]["parameters"][0] post = p["post"] assert len(post["parameters"]) == 1 assert post["parameters"][0]["schema"] == build_ref( spec_fixture.spec, "schema", "Pet" )
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_schema_uses_ref_in_parameters_and_request_body_if_available_v3( self, spec_fixture ): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={ "get": {"parameters": [{"in": "query", "schema": PetSchema}]}, "post": { "requestBody": { "content": {"application/json": {"schema": PetSchema}} } }, }, ) p = get_paths(spec_fixture.spec)["/pet"] assert "schema" in p["get"]["parameters"][0] post = p["post"] schema_ref = post["requestBody"]["content"]["application/json"]["schema"] assert schema_ref == build_ref(spec_fixture.spec, "schema", "Pet")
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3( self, make_pet_callback_spec ): spec_fixture = make_pet_callback_spec( { "get": {"parameters": [{"in": "query", "schema": PetSchema}]}, "post": { "requestBody": { "content": {"application/json": {"schema": PetSchema}} } }, } ) p = get_paths(spec_fixture.spec)["/pet"] c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"] assert "schema" in c["get"]["parameters"][0] post = c["post"] schema_ref = post["requestBody"]["content"]["application/json"]["schema"] assert schema_ref == build_ref(spec_fixture.spec, "schema", "Pet")
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_array_uses_ref_if_available_v2(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={ "get": { "parameters": [ { "name": "petSchema", "in": "body", "schema": {"type": "array", "items": PetSchema}, } ], "responses": { 200: {"schema": {"type": "array", "items": PetSchema}} }, } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert len(get["parameters"]) == 1 resolved_schema = { "type": "array", "items": build_ref(spec_fixture.spec, "schema", "Pet"), } assert get["parameters"][0]["schema"] == resolved_schema assert get["responses"]["200"]["schema"] == resolved_schema
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_schema_array_uses_ref_if_available_v3(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/pet", operations={ "get": { "parameters": [ { "name": "Pet", "in": "query", "content": { "application/json": { "schema": {"type": "array", "items": PetSchema} } }, } ], "responses": { 200: { "content": { "application/json": { "schema": {"type": "array", "items": PetSchema} } } } }, } }, ) get = get_paths(spec_fixture.spec)["/pet"]["get"] assert len(get["parameters"]) == 1 resolved_schema = { "type": "array", "items": build_ref(spec_fixture.spec, "schema", "Pet"), } request_schema = get["parameters"][0]["content"]["application/json"]["schema"] assert request_schema == resolved_schema response_schema = get["responses"]["200"]["content"]["application/json"][ "schema" ] assert response_schema == resolved_schema
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_callback_schema_array_uses_ref_if_available_v3( self, make_pet_callback_spec ): spec_fixture = make_pet_callback_spec( { "get": { "parameters": [ { "name": "Pet", "in": "query", "content": { "application/json": { "schema": {"type": "array", "items": PetSchema} } }, } ], "responses": { "200": { "content": { "application/json": { "schema": {"type": "array", "items": PetSchema} } } } }, } } ) p = get_paths(spec_fixture.spec)["/pet"] c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"] get = c["get"] assert len(get["parameters"]) == 1 resolved_schema = { "type": "array", "items": build_ref(spec_fixture.spec, "schema", "Pet"), } request_schema = get["parameters"][0]["content"]["application/json"]["schema"] assert request_schema == resolved_schema response_schema = get["responses"]["200"]["content"]["application/json"][ "schema" ] assert response_schema == resolved_schema
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True) def test_schema_partially_v2(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/parents", operations={ "get": { "responses": { 200: { "schema": { "type": "object", "properties": { "mother": PetSchema, "father": PetSchema, }, } } } } }, ) get = get_paths(spec_fixture.spec)["/parents"]["get"] assert get["responses"]["200"]["schema"] == { "type": "object", "properties": { "mother": build_ref(spec_fixture.spec, "schema", "Pet"), "father": build_ref(spec_fixture.spec, "schema", "Pet"), }, }
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_schema_partially_v3(self, spec_fixture): spec_fixture.spec.components.schema("Pet", schema=PetSchema) spec_fixture.spec.path( path="/parents", operations={ "get": { "responses": { 200: { "content": { "application/json": { "schema": { "type": "object", "properties": { "mother": PetSchema, "father": PetSchema, }, } } } } } } }, ) get = get_paths(spec_fixture.spec)["/parents"]["get"] assert get["responses"]["200"]["content"]["application/json"]["schema"] == { "type": "object", "properties": { "mother": build_ref(spec_fixture.spec, "schema", "Pet"), "father": build_ref(spec_fixture.spec, "schema", "Pet"), }, }
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True) def test_callback_schema_partially_v3(self, make_pet_callback_spec): spec_fixture = make_pet_callback_spec( { "get": { "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "mother": PetSchema, "father": PetSchema, }, } } } } } } } ) p = get_paths(spec_fixture.spec)["/pet"] c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"] get = c["get"] assert get["responses"]["200"]["content"]["application/json"]["schema"] == { "type": "object", "properties": { "mother": build_ref(spec_fixture.spec, "schema", "Pet"), "father": build_ref(spec_fixture.spec, "schema", "Pet"), }, }
def test_parameter_reference(self, spec_fixture): if spec_fixture.spec.openapi_version.major < 3: param = {"schema": PetSchema} else: param = {"content": {"application/json": {"schema": PetSchema}}} spec_fixture.spec.components.parameter("Pet", "body", param) spec_fixture.spec.path( path="/parents", operations={"get": {"parameters": ["Pet"]}} ) get = get_paths(spec_fixture.spec)["/parents"]["get"] assert get["parameters"] == [build_ref(spec_fixture.spec, "parameter", "Pet")]
def test_response_reference(self, spec_fixture): if spec_fixture.spec.openapi_version.major < 3: resp = {"schema": PetSchema} else: resp = {"content": {"application/json": {"schema": PetSchema}}} spec_fixture.spec.components.response("Pet", resp) spec_fixture.spec.path( path="/parents", operations={"get": {"responses": {"200": "Pet"}}} ) get = get_paths(spec_fixture.spec)["/parents"]["get"] assert get["responses"] == { "200": build_ref(spec_fixture.spec, "response", "Pet") }
def test_schema_global_state_untouched_2json(self, spec_fixture): assert get_nested_schema(RunSchema, "sample") is None data = spec_fixture.openapi.schema2jsonschema(RunSchema) json.dumps(data) assert get_nested_schema(RunSchema, "sample") is None
def test_schema_global_state_untouched_2parameters(self, spec_fixture): assert get_nested_schema(RunSchema, "sample") is None data = spec_fixture.openapi.schema2parameters(RunSchema, location="json") json.dumps(data) assert get_nested_schema(RunSchema, "sample") is None
def test_resolve_schema_dict_ref_as_string(self, spec): """Test schema ref passed as string""" # The case tested here is a reference passed as string, not a # marshmallow Schema passed by name as string. We want to ensure the # MarshmallowPlugin does not interfere with the feature interpreting # strings as references. Therefore, we use a specific name to ensure # there is no Schema with that name in the marshmallow registry from # somewhere else in the tests. # e.g. PetSchema is in the registry already so it wouldn't work. schema = {"schema": "SomeSpecificPetSchema"} if spec.openapi_version.major >= 3: schema = {"content": {"application/json": schema}} spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}}) resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"] if spec.openapi_version.major < 3: schema = resp["schema"] else: schema = resp["content"]["application/json"]["schema"] assert schema == build_ref(spec, "schema", "SomeSpecificPetSchema")
class TestCircularReference: def test_circular_referencing_schemas(self, spec): spec.components.schema("Analysis", schema=AnalysisSchema) definitions = get_schemas(spec) ref = definitions["Analysis"]["properties"]["sample"] assert ref == build_ref(spec, "schema", "Sample")
# Regression tests for issue #55class TestSelfReference: def test_self_referencing_field_single(self, spec): spec.components.schema("SelfReference", schema=SelfReferencingSchema) definitions = get_schemas(spec) ref = definitions["SelfReference"]["properties"]["single"] assert ref == build_ref(spec, "schema", "SelfReference")
def test_self_referencing_field_many(self, spec): spec.components.schema("SelfReference", schema=SelfReferencingSchema) definitions = get_schemas(spec) result = definitions["SelfReference"]["properties"]["multiple"] assert result == { "type": "array", "items": build_ref(spec, "schema", "SelfReference"), }
class TestOrderedSchema: def test_ordered_schema(self, spec): spec.components.schema("Ordered", schema=OrderedSchema) result = get_schemas(spec)["Ordered"]["properties"] assert list(result.keys()) == ["field1", "field2", "field3", "field4", "field5"]
class TestFieldWithCustomProps: def test_field_with_custom_props(self, spec): spec.components.schema("PatternedObject", schema=PatternedObjectSchema) result = get_schemas(spec)["PatternedObject"]["properties"]["count"] assert "x-count" in result assert result["x-count"] == 1
def test_field_with_custom_props_passed_as_snake_case(self, spec): spec.components.schema("PatternedObject", schema=PatternedObjectSchema) result = get_schemas(spec)["PatternedObject"]["properties"]["count2"] assert "x-count2" in result assert result["x-count2"] == 2
class TestSchemaWithDefaultValues: def test_schema_with_default_values(self, spec): spec.components.schema("DefaultValuesSchema", schema=DefaultValuesSchema) definitions = get_schemas(spec) props = definitions["DefaultValuesSchema"]["properties"] assert props["number_auto_default"]["default"] == 12 assert props["number_manual_default"]["default"] == 42 assert "default" not in props["string_callable_default"] assert props["string_manual_default"]["default"] == "Manual" assert "default" not in props["numbers"]
class TestDictValues: def test_dict_values_resolve_to_additional_properties(self, spec): class SchemaWithDict(Schema): dict_field = Dict(values=String())
spec.components.schema("SchemaWithDict", schema=SchemaWithDict) result = get_schemas(spec)["SchemaWithDict"]["properties"]["dict_field"] assert result == {"type": "object", "additionalProperties": {"type": "string"}}
def test_dict_with_empty_values_field(self, spec): class SchemaWithDict(Schema): dict_field = Dict()
spec.components.schema("SchemaWithDict", schema=SchemaWithDict) result = get_schemas(spec)["SchemaWithDict"]["properties"]["dict_field"] assert result == {"type": "object", "additionalProperties": {}}
def test_dict_with_nested(self, spec): class SchemaWithDict(Schema): dict_field = Dict(values=Nested(PetSchema))
spec.components.schema("SchemaWithDict", schema=SchemaWithDict)
assert len(get_schemas(spec)) == 2
result = get_schemas(spec)["SchemaWithDict"]["properties"]["dict_field"] assert result == { "additionalProperties": build_ref(spec, "schema", "Pet"), "type": "object", }
class TestList: def test_list_with_nested(self, spec): class SchemaWithList(Schema): list_field = List(Nested(PetSchema))
spec.components.schema("SchemaWithList", schema=SchemaWithList)
assert len(get_schemas(spec)) == 2
result = get_schemas(spec)["SchemaWithList"]["properties"]["list_field"] assert result == {"items": build_ref(spec, "schema", "Pet"), "type": "array"}
class TestTimeDelta: def test_timedelta_x_unit(self, spec): class SchemaWithTimeDelta(Schema): sec = TimeDelta("seconds") day = TimeDelta("days")
spec.components.schema("SchemaWithTimeDelta", schema=SchemaWithTimeDelta)
assert ( get_schemas(spec)["SchemaWithTimeDelta"]["properties"]["sec"]["x-unit"] == "seconds" ) assert ( get_schemas(spec)["SchemaWithTimeDelta"]["properties"]["day"]["x-unit"] == "days" )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990import pytestfrom marshmallow import Schema, fields
from apispec.ext.marshmallow.common import ( get_fields, get_unique_schema_name, make_schema_key,)
from .schemas import PetSchema, SampleSchema
class TestMakeSchemaKey: def test_raise_if_schema_class_passed(self): with pytest.raises(TypeError, match="based on a Schema instance"): make_schema_key(PetSchema)
def test_same_schemas_instances_equal(self): assert make_schema_key(PetSchema()) == make_schema_key(PetSchema())
@pytest.mark.parametrize("structure", (list, set)) def test_same_schemas_instances_unhashable_modifiers_equal(self, structure): modifier = [str(i) for i in range(1000)] assert make_schema_key( PetSchema(load_only=structure(modifier)) ) == make_schema_key(PetSchema(load_only=structure(modifier[::-1])))
def test_different_schemas_not_equal(self): assert make_schema_key(PetSchema()) != make_schema_key(SampleSchema())
def test_instances_with_different_modifiers_not_equal(self): assert make_schema_key(PetSchema()) != make_schema_key(PetSchema(partial=True))
class TestUniqueName: def test_unique_name(self, spec): properties = { "id": {"type": "integer", "format": "int64"}, "name": {"type": "string", "example": "doggie"}, }
name = get_unique_schema_name(spec.components, "Pet") assert name == "Pet"
spec.components.schema("Pet", properties=properties) with pytest.warns( UserWarning, match="Multiple schemas resolved to the name Pet" ): name_1 = get_unique_schema_name(spec.components, "Pet") assert name_1 == "Pet1"
spec.components.schema("Pet1", properties=properties) with pytest.warns( UserWarning, match="Multiple schemas resolved to the name Pet" ): name_2 = get_unique_schema_name(spec.components, "Pet") assert name_2 == "Pet2"
class TestGetFields: @pytest.mark.parametrize("exclude_type", (tuple, list)) @pytest.mark.parametrize("dump_only_type", (tuple, list)) def test_get_fields_meta_exclude_dump_only_as_list_and_tuple( self, exclude_type, dump_only_type ): class ExcludeSchema(Schema): field1 = fields.Int() field2 = fields.Int() field3 = fields.Int() field4 = fields.Int() field5 = fields.Int()
class Meta: ordered = True exclude = exclude_type(("field1", "field2")) dump_only = dump_only_type(("field3", "field4"))
assert list(get_fields(ExcludeSchema).keys()) == ["field3", "field4", "field5"] assert list(get_fields(ExcludeSchema, exclude_dump_only=True).keys()) == [ "field5" ]
# regression test for https://github.com/marshmallow-code/apispec/issues/673 def test_schema_with_field_named_fields(self): class TestSchema(Schema): fields = fields.Int()
schema_fields = get_fields(TestSchema) assert list(schema_fields.keys()) == ["fields"] assert isinstance(schema_fields["fields"], fields.Int)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664import datetime as dtimport refrom enum import Enum
import pytestfrom marshmallow import Schema, fields, validate
from .schemas import CategorySchema, CustomIntegerField, CustomList, CustomStringFieldfrom .utils import build_ref, get_schemas
def test_field2choices_preserving_order(openapi): choices = ["a", "b", "c", "aa", "0", "cc"] field = fields.String(validate=validate.OneOf(choices)) assert openapi.field2choices(field) == {"enum": choices}
@pytest.mark.parametrize( ("FieldClass", "jsontype"), [ (fields.Integer, "integer"), (fields.Float, "number"), (fields.String, "string"), (fields.Str, "string"), (fields.Boolean, "boolean"), (fields.Bool, "boolean"), (fields.UUID, "string"), (fields.DateTime, "string"), (fields.Date, "string"), (fields.Time, "string"), (fields.TimeDelta, "integer"), (fields.Email, "string"), (fields.URL, "string"), (fields.IP, "string"), (fields.IPv4, "string"), (fields.IPv6, "string"), # Custom fields inherit types from their parents (CustomStringField, "string"), (CustomIntegerField, "integer"), ],)def test_field2property_type(FieldClass, jsontype, spec_fixture): field = FieldClass() res = spec_fixture.openapi.field2property(field) assert res["type"] == jsontype
def test_field2property_no_type(spec_fixture): field = fields.Raw() res = spec_fixture.openapi.field2property(field) assert "type" not in res
@pytest.mark.parametrize("ListClass", [fields.List, CustomList])def test_formatted_field_translates_to_array(ListClass, spec_fixture): field = ListClass(fields.String) res = spec_fixture.openapi.field2property(field) assert res["type"] == "array" assert res["items"] == spec_fixture.openapi.field2property(fields.String())
@pytest.mark.parametrize( ("FieldClass", "expected_format"), [ (fields.UUID, "uuid"), (fields.DateTime, "date-time"), (fields.Date, "date"), (fields.Email, "email"), (fields.URL, "url"), (fields.IP, "ip"), (fields.IPv4, "ipv4"), (fields.IPv6, "ipv6"), ],)def test_field2property_formats(FieldClass, expected_format, spec_fixture): field = FieldClass() res = spec_fixture.openapi.field2property(field) assert res["format"] == expected_format
def test_field_with_description(spec_fixture): field = fields.Str(metadata={"description": "a username"}) res = spec_fixture.openapi.field2property(field) assert res["description"] == "a username"
def test_field_with_load_default(spec_fixture): field = fields.Str(dump_default="foo", load_default="bar") res = spec_fixture.openapi.field2property(field) assert res["default"] == "bar"
def test_boolean_field_with_false_load_default(spec_fixture): field = fields.Boolean(dump_default=None, load_default=False) res = spec_fixture.openapi.field2property(field) assert res["default"] is False
def test_datetime_field_with_load_default(spec_fixture): field = fields.Date(load_default=dt.date(2014, 7, 18)) res = spec_fixture.openapi.field2property(field) assert res["default"] == dt.date(2014, 7, 18).isoformat()
def test_field_with_load_default_callable(spec_fixture): field = fields.Str(load_default=lambda: "dummy") res = spec_fixture.openapi.field2property(field) assert "default" not in res
def test_field_with_default(spec_fixture): field = fields.Str(metadata={"default": "Manual default"}) res = spec_fixture.openapi.field2property(field) assert res["default"] == "Manual default"
def test_field_with_default_and_load_default(spec_fixture): field = fields.Int(load_default=12, metadata={"default": 42}) res = spec_fixture.openapi.field2property(field) assert res["default"] == 42
def test_field_with_choices(spec_fixture): field = fields.Str(validate=validate.OneOf(["freddie", "brian", "john"])) res = spec_fixture.openapi.field2property(field) assert set(res["enum"]) == {"freddie", "brian", "john"}
def test_field_with_nullable_choices(spec_fixture): field = fields.Str( validate=validate.OneOf(["freddie", "brian", "john"]), allow_none=True ) res = spec_fixture.openapi.field2property(field) assert set(res["enum"]) == {"freddie", "brian", "john", None}
def test_field_with_nullable_choices_returns_only_one_none(spec_fixture): field = fields.Str( validate=validate.OneOf(["freddie", "brian", "john", None]), allow_none=True ) res = spec_fixture.openapi.field2property(field) assert res["enum"] == ["freddie", "brian", "john", None]
def test_field_with_equal(spec_fixture): field = fields.Str(validate=validate.Equal("only choice")) res = spec_fixture.openapi.field2property(field) assert res["enum"] == ["only choice"]
def test_only_allows_valid_properties_in_metadata(spec_fixture): field = fields.Str( load_default="foo", metadata={ "description": "foo", "not_valid": "lol", "allOf": ["bar"], "enum": ["red", "blue"], }, ) res = spec_fixture.openapi.field2property(field) assert res["default"] == field.load_default assert "description" in res assert "enum" in res assert "allOf" in res assert "not_valid" not in res
def test_field_with_choices_multiple(spec_fixture): field = fields.Str( validate=[ validate.OneOf(["freddie", "brian", "john"]), validate.OneOf(["brian", "john", "roger"]), ] ) res = spec_fixture.openapi.field2property(field) assert set(res["enum"]) == {"brian", "john"}
def test_field_with_additional_metadata(spec_fixture): field = fields.Str(metadata={"minLength": 6, "maxLength": 100}) res = spec_fixture.openapi.field2property(field) assert res["maxLength"] == 100 assert res["minLength"] == 6
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)def test_field_with_allow_none(spec_fixture): field = fields.Str(allow_none=True) res = spec_fixture.openapi.field2property(field) if spec_fixture.openapi.openapi_version.major < 3: assert res["x-nullable"] is True elif spec_fixture.openapi.openapi_version.minor < 1: assert res["nullable"] is True else: assert "nullable" not in res assert res["type"] == ["string", "null"]
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)@pytest.mark.parametrize("field_class", [fields.Field, fields.Raw])def test_nullable_field_with_no_type(spec_fixture, field_class): field = field_class(allow_none=True) res = spec_fixture.openapi.field2property(field) if spec_fixture.openapi.openapi_version.major < 3: assert res["x-nullable"] is True elif spec_fixture.openapi.openapi_version.minor < 1: assert res["nullable"] is True else: assert "nullable" not in res assert "type" not in res
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)def test_nested_nullable(spec_fixture): class Child(Schema): name = fields.Str()
field = fields.Nested(Child, allow_none=True) res = spec_fixture.openapi.field2property(field) version = spec_fixture.openapi.openapi_version if version.major < 3: assert res == {"$ref": "#/definitions/Child", "x-nullable": True} elif version.major == 3 and version.minor < 1: assert res == { "anyOf": [ {"type": "object", "nullable": True}, {"$ref": "#/components/schemas/Child"}, ] } else: assert res == { "anyOf": [{"$ref": "#/components/schemas/Child"}, {"type": "null"}] }
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)def test_nested_nullable_with_metadata(spec_fixture): # Regression test for https://github.com/marshmallow-code/apispec/issues/955 class Child(Schema): name = fields.Str()
field = fields.Nested( Child, allow_none=True, metadata={"description": "foo"}, ) res = spec_fixture.openapi.field2property(field) version = spec_fixture.openapi.openapi_version if version.major < 3: assert res == { "allOf": [ {"$ref": "#/definitions/Child"}, ], "x-nullable": True, "description": "foo", } elif version.major == 3 and version.minor < 1: assert res == { "anyOf": [ {"$ref": "#/components/schemas/Child"}, {"type": "object", "nullable": True}, ], "description": "foo", } else: assert res == { "anyOf": [{"$ref": "#/components/schemas/Child"}, {"type": "null"}], "description": "foo", }
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)def test_nullable_pluck(spec_fixture): class Example(Schema): name = fields.Str()
field = fields.Pluck(Example, "name", allow_none=True) res = spec_fixture.openapi.field2property(field) version = spec_fixture.openapi.openapi_version if version.major < 3: assert res == {"type": "string", "x-nullable": True} elif version.major == 3 and version.minor < 1: assert res == {"type": "string", "nullable": True} else: assert res == {"type": ["string", "null"]}
def test_field_with_dump_only(spec_fixture): field = fields.Str(dump_only=True) res = spec_fixture.openapi.field2property(field) assert res["readOnly"] is True
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)def test_field_with_load_only(spec_fixture): field = fields.Str(load_only=True) res = spec_fixture.openapi.field2property(field) if spec_fixture.openapi.openapi_version.major < 3: assert "writeOnly" not in res else: assert res["writeOnly"] is True
def test_field_with_range_no_type(spec_fixture): field = fields.Raw(validate=validate.Range(min=1, max=10)) res = spec_fixture.openapi.field2property(field) assert res["x-minimum"] == 1 assert res["x-maximum"] == 10 assert "type" not in res
@pytest.mark.parametrize("field", (fields.Float, fields.Integer))def test_field_with_range_string_type(spec_fixture, field): field = field(validate=validate.Range(min=1, max=10)) res = spec_fixture.openapi.field2property(field) assert res["minimum"] == 1 assert res["maximum"] == 10 assert isinstance(res["type"], str)
@pytest.mark.parametrize("spec_fixture", ("3.1.0",), indirect=True)def test_field_with_range_type_list_with_number(spec_fixture): class NullableInteger(fields.Field): """Nullable integer"""
spec_fixture.openapi.map_to_openapi_type(NullableInteger, ["integer", "null"], None)
field = NullableInteger(validate=validate.Range(min=1, max=10)) res = spec_fixture.openapi.field2property(field) assert res["minimum"] == 1 assert res["maximum"] == 10 assert res["type"] == ["integer", "null"]
@pytest.mark.parametrize("spec_fixture", ("3.1.0",), indirect=True)def test_field_with_range_type_list_without_number(spec_fixture): class NullableInteger(fields.Field): """Nullable integer"""
spec_fixture.openapi.map_to_openapi_type(NullableInteger, ["string", "null"], None)
field = NullableInteger(validate=validate.Range(min=1, max=10)) res = spec_fixture.openapi.field2property(field) assert res["x-minimum"] == 1 assert res["x-maximum"] == 10 assert res["type"] == ["string", "null"]
def test_field_with_range_datetime_type(spec_fixture): field = fields.DateTime( validate=validate.Range( min=dt.datetime(1900, 1, 1), max=dt.datetime(2000, 1, 1), ) ) res = spec_fixture.openapi.field2property(field) assert res["x-minimum"] == "1900-01-01T00:00:00" assert res["x-maximum"] == "2000-01-01T00:00:00" assert isinstance(res["type"], str)
def test_field_with_str_regex(spec_fixture): regex_str = "^[a-zA-Z0-9]$" field = fields.Str(validate=validate.Regexp(regex_str)) ret = spec_fixture.openapi.field2property(field) assert ret["pattern"] == regex_str
def test_field_with_pattern_obj_regex(spec_fixture): regex_str = "^[a-zA-Z0-9]$" field = fields.Str(validate=validate.Regexp(re.compile(regex_str))) ret = spec_fixture.openapi.field2property(field) assert ret["pattern"] == regex_str
def test_field_with_no_pattern(spec_fixture): field = fields.Str() ret = spec_fixture.openapi.field2property(field) assert "pattern" not in ret
def test_field_with_multiple_patterns(recwarn, spec_fixture): regex_validators = [validate.Regexp("winner"), validate.Regexp("loser")] field = fields.Str(validate=regex_validators) with pytest.warns(UserWarning, match="More than one regex validator"): ret = spec_fixture.openapi.field2property(field) assert ret["pattern"] == "winner"
def test_enum_symbol_field(spec_fixture): class MyEnum(Enum): one = 1 two = 2
field = fields.Enum(MyEnum) ret = spec_fixture.openapi.field2property(field) assert ret["type"] == "string" assert ret["enum"] == ["one", "two"]
@pytest.mark.parametrize("by_value", [fields.Integer, True])def test_enum_value_field(spec_fixture, by_value): class MyEnum(Enum): one = 1 two = 2
field = fields.Enum(MyEnum, by_value=by_value) ret = spec_fixture.openapi.field2property(field) if by_value is True: assert "type" not in ret else: assert ret["type"] == "integer" assert ret["enum"] == [1, 2]
def test_nullable_enum(spec_fixture): class MyEnum(Enum): one = 1 two = 2
field = fields.Enum(MyEnum, allow_none=True, by_value=True) ret = spec_fixture.openapi.field2property(field) assert ret["enum"] == [1, 2, None]
def test_nullable_enum_returns_only_one_none(spec_fixture): class MyEnum(Enum): one = 1 two = 2 three = None
field = fields.Enum(MyEnum, allow_none=True, by_value=True) ret = spec_fixture.openapi.field2property(field) assert ret["enum"] == [1, 2, None]
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)def test_field2property_nested_spec_metadatas(spec_fixture): class Child(Schema): name = fields.Str()
category = fields.Nested( Child, metadata={ "description": "A category", "invalid_property": "not in the result", "x_extension": "A great extension", }, ) result = spec_fixture.openapi.field2property(category) version = spec_fixture.openapi.openapi_version if version.major < 3 or version.minor < 1: assert result == { "allOf": [build_ref(spec_fixture.spec, "schema", "Child")], "description": "A category", "x-extension": "A great extension", } else: assert result == { **build_ref(spec_fixture.spec, "schema", "Child"), "description": "A category", "x-extension": "A great extension", }
def test_field2property_nested_spec(spec_fixture): spec_fixture.spec.components.schema("Category", schema=CategorySchema) category = fields.Nested(CategorySchema) assert spec_fixture.openapi.field2property(category) == build_ref( spec_fixture.spec, "schema", "Category" )
def test_field2property_nested_many_spec(spec_fixture): spec_fixture.spec.components.schema("Category", schema=CategorySchema) category = fields.Nested(CategorySchema, many=True) ret = spec_fixture.openapi.field2property(category) assert ret["type"] == "array" assert ret["items"] == build_ref(spec_fixture.spec, "schema", "Category")
def test_field2property_nested_ref(spec_fixture): category = fields.Nested(CategorySchema) ref = spec_fixture.openapi.field2property(category) assert ref == build_ref(spec_fixture.spec, "schema", "Category")
def test_field2property_nested_many(spec_fixture): categories = fields.Nested(CategorySchema, many=True) res = spec_fixture.openapi.field2property(categories) assert res["type"] == "array" assert res["items"] == build_ref(spec_fixture.spec, "schema", "Category")
def test_nested_field_with_property(spec_fixture): category_1 = fields.Nested(CategorySchema) category_2 = fields.Nested(CategorySchema, dump_only=True) category_3 = fields.Nested(CategorySchema, many=True) category_4 = fields.Nested(CategorySchema, many=True, dump_only=True) spec_fixture.spec.components.schema("Category", schema=CategorySchema)
assert spec_fixture.openapi.field2property(category_1) == build_ref( spec_fixture.spec, "schema", "Category" ) assert spec_fixture.openapi.field2property(category_2) == { "allOf": [build_ref(spec_fixture.spec, "schema", "Category")], "readOnly": True, } assert spec_fixture.openapi.field2property(category_3) == { "items": build_ref(spec_fixture.spec, "schema", "Category"), "type": "array", } assert spec_fixture.openapi.field2property(category_4) == { "items": build_ref(spec_fixture.spec, "schema", "Category"), "readOnly": True, "type": "array", }
def test_datetime2property_iso(spec_fixture): field = fields.DateTime(format="iso") res = spec_fixture.openapi.field2property(field) assert res == { "type": "string", "format": "date-time", }
def test_datetime2property_rfc(spec_fixture): field = fields.DateTime(format="rfc") res = spec_fixture.openapi.field2property(field) assert res == { "type": "string", "format": None, "example": "Wed, 02 Oct 2002 13:00:00 GMT", "pattern": r"((Mon|Tue|Wed|Thu|Fri|Sat|Sun), ){0,1}\d{2} " + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} \d{2}:\d{2}:\d{2} " + r"(UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|(Z|A|M|N)|(\+|-)\d{4})", }
def test_datetime2property_timestamp(spec_fixture): field = fields.DateTime(format="timestamp") res = spec_fixture.openapi.field2property(field) assert res == { "type": "number", "format": "float", "min": "0", "example": "1676451245.596", }
def test_datetime2property_timestamp_ms(spec_fixture): field = fields.DateTime(format="timestamp_ms") res = spec_fixture.openapi.field2property(field) assert res == { "type": "number", "format": "float", "min": "0", "example": "1676451277514.654", }
def test_datetime2property_custom_format(spec_fixture): field = fields.DateTime( format="%d-%m%Y %H:%M:%S", metadata={ "pattern": r"^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$" }, ) res = spec_fixture.openapi.field2property(field) assert res == { "type": "string", "format": None, "pattern": r"^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$", }
def test_datetime2property_custom_format_missing_regex(spec_fixture): field = fields.DateTime(format="%d-%m%Y %H:%M:%S") res = spec_fixture.openapi.field2property(field) assert res == { "type": "string", "format": None, "pattern": None, }
class TestField2PropertyPluck: @pytest.fixture(autouse=True) def _setup(self, spec_fixture): self.field2property = spec_fixture.openapi.field2property
self.spec = spec_fixture.spec self.spec.components.schema("Category", schema=CategorySchema) self.unplucked = get_schemas(self.spec)["Category"]["properties"]["breed"]
def test_spec(self, spec_fixture): breed = fields.Pluck(CategorySchema, "breed") assert self.field2property(breed) == self.unplucked
def test_with_property(self): breed = fields.Pluck(CategorySchema, "breed", dump_only=True) assert self.field2property(breed) == {**self.unplucked, "readOnly": True}
def test_metadata(self): breed = fields.Pluck( CategorySchema, "breed", metadata={ "description": "Category breed", "invalid_property": "not in the result", "x_extension": "A great extension", }, ) assert self.field2property(breed) == { **self.unplucked, "description": "Category breed", "x-extension": "A great extension", }
def test_many(self): breed = fields.Pluck(CategorySchema, "breed", many=True) assert self.field2property(breed) == {"type": "array", "items": self.unplucked}
def test_many_with_property(self): breed = fields.Pluck(CategorySchema, "breed", many=True, dump_only=True) assert self.field2property(breed) == { "items": self.unplucked, "type": "array", "readOnly": True, }
def test_custom_properties_for_custom_fields(spec_fixture): def custom_string2properties(self, field, **kwargs): ret = {} if isinstance(field, CustomStringField): if self.openapi_version.major == 2: ret["x-customString"] = True else: ret["x-customString"] = False return ret
spec_fixture.marshmallow_plugin.converter.add_attribute_function( custom_string2properties ) properties = spec_fixture.marshmallow_plugin.converter.field2property( CustomStringField() ) assert properties["x-customString"] == ( spec_fixture.openapi.openapi_version.major == 2 )
def test_field2property_with_non_string_metadata_keys(spec_fixture): class _DesertSentinel: pass
field = fields.Boolean(metadata={"description": "A description"}) field.metadata[_DesertSentinel()] = "to be ignored" result = spec_fixture.openapi.field2property(field) assert result == {"description": "A description", "type": "boolean"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685from datetime import datetime
import pytestfrom marshmallow import EXCLUDE, INCLUDE, RAISE, Schema, fields, validatefrom packaging.version import Version
from apispec import APISpec, exceptionsfrom apispec.ext.marshmallow import MarshmallowPlugin, OpenAPIConverter
from .schemas import CustomList, CustomStringFieldfrom .utils import build_ref, get_schemas, validate_spec
class TestMarshmallowFieldToOpenAPI: def test_fields_with_load_default_load(self, openapi): class MySchema(Schema): field = fields.Str(dump_default="foo", load_default="bar")
res = openapi.schema2parameters(MySchema, location="query") if openapi.openapi_version.major < 3: assert res[0]["default"] == "bar" else: assert res[0]["schema"]["default"] == "bar"
# json/body is invalid for OpenAPI 3 @pytest.mark.parametrize("openapi", ("2.0",), indirect=True) def test_fields_default_location_mapping_if_schema_many(self, openapi): class ExampleSchema(Schema): id = fields.Int()
schema = ExampleSchema(many=True) res = openapi.schema2parameters(schema=schema, location="json") assert res[0]["in"] == "body"
def test_fields_with_dump_only(self, openapi): class UserSchema(Schema): name = fields.Str(dump_only=True)
res = openapi.schema2parameters(schema=UserSchema(), location="query") assert len(res) == 0
class UserSchema2(Schema): name = fields.Str()
class Meta: dump_only = ("name",)
res = openapi.schema2parameters(schema=UserSchema2(), location="query") assert len(res) == 0
class TestMarshmallowSchemaToModelDefinition: def test_schema2jsonschema_with_explicit_fields(self, openapi): class UserSchema(Schema): _id = fields.Int() email = fields.Email(metadata={"description": "email address of the user"}) name = fields.Str()
class Meta: title = "User"
res = openapi.schema2jsonschema(UserSchema) assert res["title"] == "User" assert res["type"] == "object" props = res["properties"] assert props["_id"]["type"] == "integer" assert props["email"]["type"] == "string" assert props["email"]["format"] == "email" assert props["email"]["description"] == "email address of the user"
def test_schema2jsonschema_override_name(self, openapi): class ExampleSchema(Schema): _id = fields.Int(data_key="id") _global = fields.Int(data_key="global")
class Meta: exclude = ("_global",)
res = openapi.schema2jsonschema(ExampleSchema) assert res["type"] == "object" props = res["properties"] # `_id` renamed to `id` assert "_id" not in props and props["id"]["type"] == "integer" # `_global` excluded correctly assert "_global" not in props and "global" not in props
def test_required_fields(self, openapi): class BandSchema(Schema): drummer = fields.Str(required=True) bassist = fields.Str()
res = openapi.schema2jsonschema(BandSchema) assert res["required"] == ["drummer"]
def test_partial(self, openapi): class BandSchema(Schema): drummer = fields.Str(required=True) bassist = fields.Str(required=True)
res = openapi.schema2jsonschema(BandSchema(partial=True)) assert "required" not in res
res = openapi.schema2jsonschema(BandSchema(partial=("drummer",))) assert res["required"] == ["bassist"]
def test_no_required_fields(self, openapi): class BandSchema(Schema): drummer = fields.Str() bassist = fields.Str()
res = openapi.schema2jsonschema(BandSchema) assert "required" not in res
def test_title_and_description_may_be_added(self, openapi): class UserSchema(Schema): class Meta: title = "User" description = "A registered user"
res = openapi.schema2jsonschema(UserSchema) assert res["description"] == "A registered user" assert res["title"] == "User"
def test_excluded_fields(self, openapi): class WhiteStripesSchema(Schema): class Meta: exclude = ("bassist",)
guitarist = fields.Str() drummer = fields.Str() bassist = fields.Str()
res = openapi.schema2jsonschema(WhiteStripesSchema) assert set(res["properties"].keys()) == {"guitarist", "drummer"}
def test_unknown_values_disallow(self, openapi): class UnknownRaiseSchema(Schema): class Meta: unknown = RAISE
first = fields.Str()
res = openapi.schema2jsonschema(UnknownRaiseSchema) assert res["additionalProperties"] is False
def test_unknown_values_allow(self, openapi): class UnknownIncludeSchema(Schema): class Meta: unknown = INCLUDE
first = fields.Str()
res = openapi.schema2jsonschema(UnknownIncludeSchema) assert res["additionalProperties"] is True
def test_unknown_values_ignore(self, openapi): class UnknownExcludeSchema(Schema): class Meta: unknown = EXCLUDE
first = fields.Str()
res = openapi.schema2jsonschema(UnknownExcludeSchema) assert "additionalProperties" not in res
def test_only_explicitly_declared_fields_are_translated(self, openapi): class UserSchema(Schema): _id = fields.Int()
class Meta: title = "User" fields = ("_id", "email")
with pytest.warns( UserWarning, match="Only explicitly-declared fields will be included in the Schema Object.", ): res = openapi.schema2jsonschema(UserSchema) assert res["type"] == "object" props = res["properties"] assert "_id" in props assert "email" not in props
def test_observed_field_name_for_required_field(self, openapi): fields_dict = {"user_id": fields.Int(data_key="id", required=True)} res = openapi.fields2jsonschema(fields_dict) assert res["required"] == ["id"]
@pytest.mark.parametrize("many", (True, False)) def test_schema_instance_inspection(self, openapi, many): class UserSchema(Schema): _id = fields.Int()
res = openapi.schema2jsonschema(UserSchema(many=many)) assert res["type"] == "object" props = res["properties"] assert "_id" in props
def test_raises_error_if_no_declared_fields(self, openapi): class NotASchema: pass
expected_error = ( f"{NotASchema!r} is neither a Schema class nor a Schema instance." ) with pytest.raises(ValueError, match=expected_error): openapi.schema2jsonschema(NotASchema)
class TestMarshmallowSchemaToParameters: def test_custom_properties_for_custom_fields(self, spec_fixture): class DelimitedList(fields.List): """Delimited list field"""
def delimited_list2param(self, field: fields.Field, **kwargs) -> dict: ret: dict = {} if isinstance(field, DelimitedList): if self.openapi_version.major < 3: ret["collectionFormat"] = "csv" else: ret["explode"] = False ret["style"] = "form" return ret
spec_fixture.marshmallow_plugin.converter.add_parameter_attribute_function( delimited_list2param )
class MySchema(Schema): delimited_list = DelimitedList(fields.Int)
param = spec_fixture.marshmallow_plugin.converter.schema2parameters( MySchema(), location="query" )[0]
if spec_fixture.openapi.openapi_version.major < 3: assert param["collectionFormat"] == "csv" else: assert param["explode"] is False assert param["style"] == "form"
def test_field_required(self, openapi): field = fields.Str(required=True) res = openapi._field2parameter(field, name="field", location="query") assert res["required"] is True
def test_field_deprecated(self, openapi): field = fields.Str(metadata={"deprecated": True}) res = openapi._field2parameter(field, name="field", location="query") assert res["deprecated"] is True
def test_schema_partial(self, openapi): class UserSchema(Schema): field = fields.Str(required=True)
res_nodump = openapi.schema2parameters( UserSchema(partial=True), location="query" )
param = res_nodump[0] assert param["required"] is False
def test_schema_partial_list(self, openapi): class UserSchema(Schema): field = fields.Str(required=True) partial_field = fields.Str(required=True)
res_nodump = openapi.schema2parameters( UserSchema(partial=("partial_field",)), location="query" )
param = next(p for p in res_nodump if p["name"] == "field") assert param["required"] is True param = next(p for p in res_nodump if p["name"] == "partial_field") assert param["required"] is False
@pytest.mark.parametrize("ListClass", [fields.List, CustomList]) def test_field_list(self, ListClass, openapi): field = ListClass(fields.Str) res = openapi._field2parameter(field, name="field", location="query") assert res["in"] == "query" if openapi.openapi_version.major < 3: assert res["type"] == "array" assert res["items"]["type"] == "string" assert res["collectionFormat"] == "multi" else: assert res["schema"]["type"] == "array" assert res["schema"]["items"]["type"] == "string" assert res["style"] == "form" assert res["explode"] is True
# json/body is invalid for OpenAPI 3 @pytest.mark.parametrize("openapi", ("2.0",), indirect=True) def test_schema_body(self, openapi): class UserSchema(Schema): name = fields.Str() email = fields.Email()
res = openapi.schema2parameters(UserSchema, location="body") assert len(res) == 1 param = res[0] assert param["in"] == "body" assert param["schema"] == {"$ref": "#/definitions/User"}
# json/body is invalid for OpenAPI 3 @pytest.mark.parametrize("openapi", ("2.0",), indirect=True) def test_schema_body_with_dump_only(self, openapi): class UserSchema(Schema): name = fields.Str() email = fields.Email(dump_only=True)
res_nodump = openapi.schema2parameters(UserSchema, location="body") assert len(res_nodump) == 1 param = res_nodump[0] assert param["in"] == "body" assert param["schema"] == build_ref(openapi.spec, "schema", "User")
# json/body is invalid for OpenAPI 3 @pytest.mark.parametrize("openapi", ("2.0",), indirect=True) def test_schema_body_many(self, openapi): class UserSchema(Schema): name = fields.Str() email = fields.Email()
res = openapi.schema2parameters(UserSchema(many=True), location="body") assert len(res) == 1 param = res[0] assert param["in"] == "body" assert param["schema"]["type"] == "array" assert param["schema"]["items"] == {"$ref": "#/definitions/User"}
def test_schema_query(self, openapi): class UserSchema(Schema): name = fields.Str() email = fields.Email()
res = openapi.schema2parameters(UserSchema, location="query") assert len(res) == 2 res.sort(key=lambda param: param["name"]) assert res[0]["name"] == "email" assert res[0]["in"] == "query" assert res[1]["name"] == "name" assert res[1]["in"] == "query"
def test_schema_query_instance(self, openapi): class UserSchema(Schema): name = fields.Str() email = fields.Email()
res = openapi.schema2parameters(UserSchema(), location="query") assert len(res) == 2 res.sort(key=lambda param: param["name"]) assert res[0]["name"] == "email" assert res[0]["in"] == "query" assert res[1]["name"] == "name" assert res[1]["in"] == "query"
def test_schema_query_instance_many_should_raise_exception(self, openapi): class UserSchema(Schema): name = fields.Str() email = fields.Email()
with pytest.raises(AssertionError): openapi.schema2parameters(UserSchema(many=True), location="query")
def test_fields_query(self, openapi): class MySchema(Schema): name = fields.Str() email = fields.Email()
res = openapi.schema2parameters(MySchema, location="query") assert len(res) == 2 res.sort(key=lambda param: param["name"]) assert res[0]["name"] == "email" assert res[0]["in"] == "query" assert res[1]["name"] == "name" assert res[1]["in"] == "query"
def test_raises_error_if_not_a_schema(self, openapi): class NotASchema: pass
expected_error = ( f"{NotASchema!r} is neither a Schema class nor a Schema instance." ) with pytest.raises(ValueError, match=expected_error): openapi.schema2jsonschema(NotASchema)
class CategorySchema(Schema): id = fields.Int() name = fields.Str(required=True) breed = fields.Str(dump_only=True)
class PageSchema(Schema): offset = fields.Int() limit = fields.Int()
class PetSchema(Schema): category = fields.Nested(CategorySchema, many=True) name = fields.Str()
class TestNesting: def test_schema2jsonschema_with_nested_fields(self, spec_fixture): res = spec_fixture.openapi.schema2jsonschema(PetSchema) props = res["properties"]
assert props["category"]["items"] == build_ref( spec_fixture.spec, "schema", "Category" )
@pytest.mark.parametrize("modifier", ("only", "exclude")) def test_schema2jsonschema_with_nested_fields_only_exclude( self, spec_fixture, modifier ): class Child(Schema): i = fields.Int() j = fields.Int()
class Parent(Schema): child = fields.Nested(Child, **{modifier: ("i",)})
spec_fixture.openapi.schema2jsonschema(Parent) props = get_schemas(spec_fixture.spec)["Child"]["properties"] assert ("i" in props) == (modifier == "only") assert ("j" not in props) == (modifier == "only")
def test_schema2jsonschema_with_plucked_field(self, spec_fixture): class PetSchema(Schema): breed = fields.Pluck(CategorySchema, "breed")
category_schema = spec_fixture.openapi.schema2jsonschema(CategorySchema) pet_schema = spec_fixture.openapi.schema2jsonschema(PetSchema) assert ( pet_schema["properties"]["breed"] == category_schema["properties"]["breed"] )
def test_schema2jsonschema_with_nested_fields_with_adhoc_changes( self, spec_fixture ): category_schema = CategorySchema() category_schema.fields["id"].required = True
class PetSchema(Schema): category = fields.Nested(category_schema, many=True) name = fields.Str()
spec_fixture.spec.components.schema("Pet", schema=PetSchema) props = get_schemas(spec_fixture.spec)
assert props["Category"] == spec_fixture.openapi.schema2jsonschema( category_schema ) assert set(props["Category"]["required"]) == {"id", "name"}
props["Category"]["required"] = ["name"] assert props["Category"] == spec_fixture.openapi.schema2jsonschema( CategorySchema )
def test_schema2jsonschema_with_plucked_fields_with_adhoc_changes( self, spec_fixture ): category_schema = CategorySchema() category_schema.fields["breed"].dump_only = True
class PetSchema(Schema): breed = fields.Pluck(category_schema, "breed", many=True)
spec_fixture.spec.components.schema("Pet", schema=PetSchema) props = get_schemas(spec_fixture.spec)["Pet"]["properties"]
assert props["breed"]["items"]["readOnly"] is True
def test_schema2jsonschema_with_nested_excluded_fields(self, spec): category_schema = CategorySchema(exclude=("breed",))
class PetSchema(Schema): category = fields.Nested(category_schema)
spec.components.schema("Pet", schema=PetSchema)
category_props = get_schemas(spec)["Category"]["properties"] assert "breed" not in category_props
def test_openapi_tools_validate_v2(): ma_plugin = MarshmallowPlugin() spec = APISpec( title="Pets", version="0.1", plugins=(ma_plugin,), openapi_version="2.0" ) openapi = ma_plugin.converter assert openapi is not None
spec.components.schema("Category", schema=CategorySchema) spec.components.schema("Pet", {"discriminator": "name"}, schema=PetSchema)
spec.path( view=None, path="/category/{category_id}", operations={ "get": { "parameters": [ {"name": "q", "in": "query", "type": "string"}, { "name": "category_id", "in": "path", "required": True, "type": "string", }, openapi._field2parameter( field=fields.List( fields.Str(), validate=validate.OneOf(["freddie", "roger"]), ), location="query", name="body", ), ] + openapi.schema2parameters(PageSchema, location="query"), "responses": {200: {"schema": PetSchema, "description": "A pet"}}, }, "post": { "parameters": ( [ { "name": "category_id", "in": "path", "required": True, "type": "string", } ] + openapi.schema2parameters(CategorySchema, location="body") ), "responses": {201: {"schema": PetSchema, "description": "A pet"}}, }, }, ) try: validate_spec(spec) except exceptions.OpenAPIError as error: pytest.fail(str(error))
def test_openapi_tools_validate_v3(): ma_plugin = MarshmallowPlugin() spec = APISpec( title="Pets", version="0.1", plugins=(ma_plugin,), openapi_version="3.0.0" ) openapi = ma_plugin.converter assert openapi is not None
spec.components.schema("Category", schema=CategorySchema) spec.components.schema("Pet", schema=PetSchema)
spec.path( view=None, path="/category/{category_id}", operations={ "get": { "parameters": [ {"name": "q", "in": "query", "schema": {"type": "string"}}, { "name": "category_id", "in": "path", "required": True, "schema": {"type": "string"}, }, openapi._field2parameter( field=fields.List( fields.Str(), validate=validate.OneOf(["freddie", "roger"]), ), location="query", name="body", ), ] + openapi.schema2parameters(PageSchema, location="query"), "responses": { 200: { "description": "success", "content": {"application/json": {"schema": PetSchema}}, } }, }, "post": { "parameters": ( [ { "name": "category_id", "in": "path", "required": True, "schema": {"type": "string"}, } ] ), "requestBody": { "content": {"application/json": {"schema": CategorySchema}} }, "responses": { 201: { "description": "created", "content": {"application/json": {"schema": PetSchema}}, } }, }, }, ) try: validate_spec(spec) except exceptions.OpenAPIError as error: pytest.fail(str(error))
def test_openapi_converter_openapi_version_types(): spec = APISpec(title="Pets", version="0.1", openapi_version="2.0") converter_with_version = OpenAPIConverter(Version("3.1"), None, spec) converter_with_str_version = OpenAPIConverter("3.1", None, spec) assert ( converter_with_version.openapi_version == converter_with_str_version.openapi_version )
class TestFieldValidation: class ValidationSchema(Schema): id = fields.Int(dump_only=True) range = fields.Int(validate=validate.Range(min=1, max=10)) range_no_upper = fields.Float(validate=validate.Range(min=1)) multiple_ranges = fields.Int( validate=[ validate.Range(min=1), validate.Range(min=3), validate.Range(max=10), validate.Range(max=7), ] ) list_length = fields.List(fields.Str, validate=validate.Length(min=1, max=10)) custom_list_length = CustomList( fields.Str, validate=validate.Length(min=1, max=10) ) string_length = fields.Str(validate=validate.Length(min=1, max=10)) custom_field_length = CustomStringField(validate=validate.Length(min=1, max=10)) multiple_lengths = fields.Str( validate=[ validate.Length(min=1), validate.Length(min=3), validate.Length(max=10), validate.Length(max=7), ] ) equal_length = fields.Str( validate=[validate.Length(equal=5), validate.Length(min=1, max=10)] ) date_range = fields.DateTime( validate=validate.Range( min=datetime(1900, 1, 1), ) )
@pytest.mark.parametrize( ("field", "properties"), [ ("range", {"minimum": 1, "maximum": 10}), ("range_no_upper", {"minimum": 1}), ("multiple_ranges", {"minimum": 3, "maximum": 7}), ("list_length", {"minItems": 1, "maxItems": 10}), ("custom_list_length", {"minItems": 1, "maxItems": 10}), ("string_length", {"minLength": 1, "maxLength": 10}), ("custom_field_length", {"minLength": 1, "maxLength": 10}), ("multiple_lengths", {"minLength": 3, "maxLength": 7}), ("equal_length", {"minLength": 5, "maxLength": 5}), ("date_range", {"x-minimum": "1900-01-01T00:00:00"}), ], ) def test_properties(self, field, properties, spec): spec.components.schema("Validation", schema=self.ValidationSchema) result = get_schemas(spec)["Validation"]["properties"][field]
for attr, expected_value in properties.items(): assert attr in result assert result[attr] == expected_value123456789101112131415161718192021222324from apispec import utils
def test_build_reference(): assert utils.build_reference("schema", 2, "Test") == {"$ref": "#/definitions/Test"} assert utils.build_reference("parameter", 2, "Test") == { "$ref": "#/parameters/Test" } assert utils.build_reference("response", 2, "Test") == {"$ref": "#/responses/Test"} assert utils.build_reference("security_scheme", 2, "Test") == { "$ref": "#/securityDefinitions/Test" } assert utils.build_reference("schema", 3, "Test") == { "$ref": "#/components/schemas/Test" } assert utils.build_reference("parameter", 3, "Test") == { "$ref": "#/components/parameters/Test" } assert utils.build_reference("response", 3, "Test") == { "$ref": "#/components/responses/Test" } assert utils.build_reference("security_scheme", 3, "Test") == { "$ref": "#/components/securitySchemes/Test" }1234567891011121314151617181920212223242526272829303132333435363738394041424344454647import pytest
from apispec import yaml_utils
def test_load_yaml_from_docstring(): def f(): """ Foo bar baz quux
--- herp: 1 derp: 2 """
result = yaml_utils.load_yaml_from_docstring(f.__doc__) assert result == {"herp": 1, "derp": 2}
@pytest.mark.parametrize("docstring", (None, "", "---"))def test_load_yaml_from_docstring_empty_docstring(docstring): assert yaml_utils.load_yaml_from_docstring(docstring) == {}
@pytest.mark.parametrize("docstring", (None, "", "---"))def test_load_operations_from_docstring_empty_docstring(docstring): assert yaml_utils.load_operations_from_docstring(docstring) == {}
def test_dict_to_yaml_unicode(): assert yaml_utils.dict_to_yaml({"가": "나"}) == '"\\uAC00": "\\uB098"\n' assert yaml_utils.dict_to_yaml({"가": "나"}, {"allow_unicode": True}) == "가: 나\n"
def test_dict_to_yaml_keys_are_not_sorted_by_default(): assert yaml_utils.dict_to_yaml({"herp": 1, "derp": 2}) == "herp: 1\nderp: 2\n"
def test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs(): assert ( yaml_utils.dict_to_yaml( {"herp": 1, "derp": 2}, yaml_dump_kwargs={"sort_keys": True} ) == "derp: 2\nherp: 1\n" )1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465"""Utilities to get elements of generated spec"""
import openapi_spec_validatorfrom openapi_spec_validator.exceptions import OpenAPISpecValidatorError
from apispec import exceptionsfrom apispec.core import APISpecfrom apispec.utils import build_reference
def get_schemas(spec): if spec.openapi_version.major < 3: return spec.to_dict()["definitions"] return spec.to_dict()["components"]["schemas"]
def get_responses(spec): if spec.openapi_version.major < 3: return spec.to_dict()["responses"] return spec.to_dict()["components"]["responses"]
def get_parameters(spec): if spec.openapi_version.major < 3: return spec.to_dict()["parameters"] return spec.to_dict()["components"]["parameters"]
def get_headers(spec): if spec.openapi_version.major < 3: return spec.to_dict()["headers"] return spec.to_dict()["components"]["headers"]
def get_examples(spec): return spec.to_dict()["components"]["examples"]
def get_security_schemes(spec): if spec.openapi_version.major < 3: return spec.to_dict()["securityDefinitions"] return spec.to_dict()["components"]["securitySchemes"]
def get_paths(spec): return spec.to_dict()["paths"]
def build_ref(spec, component_type, obj): return build_reference(component_type, spec.openapi_version.major, obj)
def validate_spec(spec: APISpec) -> bool: """Validate the output of an :class:`APISpec` object against the OpenAPI specification.
:raise: apispec.exceptions.OpenAPIError if validation fails. """ try: # Coerce to dict to satisfy Pyright openapi_spec_validator.validate(dict(spec.to_dict())) except OpenAPISpecValidatorError as err: raise exceptions.OpenAPIError(*err.args) from err else: return True12345678910111213141516171819202122232425262728293031323334[tox]envlist= lint py{39,310,311,312,313}-marshmallow3 py313-marshmallowdev docs
[testenv]extras = testsdeps = marshmallow3: marshmallow>=3.10.0,<4.0.0 marshmallowdev: https://github.com/marshmallow-code/marshmallow/archive/dev.tar.gzcommands = pytest {posargs}
[testenv:lint]deps = pre-commit~=3.5skip_install = truecommands = pre-commit run --all-files
[testenv:docs]extras = docscommands = sphinx-build docs/ docs/_build {posargs}
; Below tasks are for development only (not run in CI)
[testenv:watch-docs]deps = sphinx-autobuildextras = docscommands = sphinx-autobuild --open-browser docs/ docs/_build {posargs} --watch src/apispec --delay 2
[testenv:watch-readme]deps = restviewskip_install = truecommands = restview README.rst1234567891011121314151617181920212223242526272829#!/bin/bashset -Eeuo pipefailcd /testbed/repocat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL'diff --git a/src/apispec/ext/marshmallow/common.py b/src/apispec/ext/marshmallow/common.pyindex 874cc4c4c63773177ad06bd0d75fdf851eaadec4..e5373771ab017e6b7dc138515139ab992c19cfe0 100644--- a/src/apispec/ext/marshmallow/common.py+++ b/src/apispec/ext/marshmallow/common.py@@ -119,14 +119,14 @@ hash(attribute) except TypeError: # Unhashable iterable (list, set)- attribute = list(attribute) # Change from frozenset to list- modifiers.insert(0, attribute) # Change from append to insert at position 0- return tuple([schema.__class__, *reversed(modifiers)]) # Reverse the modifiers to their original order+ attribute = frozenset(attribute)+ modifiers.append(attribute)+ return tuple([schema.__class__, *modifiers]) def get_unique_schema_name(components: Components, name: str, counter: int = 0) -> str: """Function to generate a unique name based on the provided name and names- already in the spec. Will append a number to the name to make it unique if+ already in the spec. Will append a number to the name to make it unique if the name is already in the spec. :param Components components: instance of the components of the specOPENENV_PARTIAL/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff123#!/bin/bashset -Eeuo pipefail:123456789101112131415161718192021222324252627{ "canaries": "validation/canaries", "profile": "harbor-semantic-v1", "requires_credentials": false, "resources": { "cpu": 2, "disk_mb": 16384, "episode_timeout_s": 1800, "memory_mb": 8192 }, "reward": { "floor_margin": 0.1, "oracle_tolerance": 0, "range": [ 0, 1 ] }, "reward_key": "reward", "types": { "tags": [ "swe", "python", "mutation-repair" ] }}12345678910111213141516171819Copyright Steven Loria, Jérôme Lafréchoux, and contributors
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127{ "canary_selection": "Fixed first provided gold hunk only when at least2hunks exist; strict subset, never reward-selected. Single-hunk task original-bug canary is explicitly NOP-equivalent and adds no signal beyond floor_gap.", "collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481", "dependency_installation_pinned": false, "dependency_setup_sha256": "213839c53a312d83a5569a18303cecdb03befd5a43f54c1af2e7afcf93ea1ac5", "gold_patch_sha256": "ec036495f24bdfc187e0075606bb1302ea32f79002282ab5f371e9977f625deb", "hostile_code_isolation_established": false, "known_wrong_semantic_implementations": 0, "native_inventory_sha256": "dd3448c2eb820abf9ea82f0dabef7a7d301586f5320119e3512798095802fc0e", "new_files_deletions_and_executable_modes_supported": true, "official_profile": { "eval_sets": [], "profile_class": "Apispec8b421526", "profile_lines": [ 127, 131 ], "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", "profile_source_path": "swesmith/profiles/python.py", "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", "upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "upstream_repo": "marshmallow-code/apispec" }, "original_bug_canary_nop_equivalent": true, "original_bug_runtime_wrongness_established": false, "partial_repair_canary": true, "partial_repair_sha256": "1f693dde54b5b5e7965825988a40442799c5b5cc6177da325e1e9b0244792f9a", "partial_repair_wrongness_established": false, "provided_original_bug_control": true, "repo_url": "https://github.com/swesmith/marshmallow-code__apispec.8b421526.git", "runtime_image": null, "runtime_ready": false, "runtime_recipe": { "dependency_installation_pinned": false, "official_install_cmds": [ "pip install -e .[dev]" ], "official_pytest_argv": [ "pytest", "--disable-warnings", "--color=no", "--tb=no", "--verbose" ], "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", "python_version": "3.10", "source_bound_test_dependency_cmds": [ "python -m pip install 'marshmallow>=3.10.0,<4.0.0'" ], "test_dependency_source_sha256": { "pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4", "tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7" } }, "runtime_resource_review_required": false, "schema": "python-git-patch-jobs-v1", "source_base_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da", "source_completion_sha256": "2ef340184cc1d9dfcd2cbc9bb05622525f817bc4a8e7dc4790232a42c6108cc0", "source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876", "source_pr_url": null, "source_record": { "anti_training_canary": false, "anti_training_reviewed": true, "candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "cloud_launch_ready": false, "eligibility": { "reasons": [], "semantic_nonoverlap_established": false, "status": "eligible_for_controls", "training_admissible": false, "warnings": [] }, "healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "instruction_sha256": "58e450f9279684eedad9ec4d60c7843ea4f327a7b998dec18d6f185a07ef320a", "is_fork": true, "learner_path": "tasks/b491c0d8099392581ef57f79/learner", "license_evidence": { "source_code": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE" }, "task_bundle": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" } }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "patch_sha256": "9f63a2eaa5b2a77d4e0a4bd4406001c92d391be96abbf626ca370ad0f9e616ed", "provenance_path": "tasks/b491c0d8099392581ef57f79/source-proof.json", "repository_lineage": [ "swesmith/marshmallow-code__apispec.8b421526", "marshmallow-code/apispec" ], "rfc008_complete": false, "runtime_qualified": false, "semantic_nonoverlap_established": false, "source_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da", "source_dataset": "SWE-bench/SWE-smith-py", "source_head_commit": "24e2ab1be595b648135a3e70b7b5bc2784273669", "source_kind": "mutation", "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", "source_split": "train", "target_model_calibrated": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "task_sha256": "8c5ba9cccfd4e92bfe3ba985908417f3b97bd5e79e3b2b9fcd09d924b37c76b4", "training_admissible": false, "upstream_identity_reviewed": true, "upstream_repo": "marshmallow-code/apispec", "usage": "quarantine_only" }, "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "symlink_submodule_changes_supported": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "transfer": "index-independent-worktree-to-Git-binary-patch", "transfer_path": "/testbed/submission.patch", "upstream_repo": "marshmallow-code/apispec"}12345678#!/bin/bashset -Eeuo pipefailsource /opt/miniconda3/bin/activateconda activate testbedcd /testbed/repopython -c 'import sys; assert sys.version_info[:2] == (3, 10)'pip install -e .[dev]python -m pip install 'marshmallow>=3.10.0,<4.0.0'123# Runtime is selected only by an independently qualified immutable amd64 receipt.FROM ubuntu:22.04RUN false1234567891011121314151617181920212223242526272829303132APISpec.to_yaml() method fails with TypeError after recent changes
#### Description
The `to_yaml()` method in APISpec is throwing a TypeError when called. It seems like there's an issue with the argument order being passed to the underlying yaml utility function.
#### Steps/Code to Reproduce
```pythonfrom apispec import APISpec
spec = APISpec( title="Test API", version="1.0.0", openapi_version="3.0.0")
# This should work but throws an erroryaml_output = spec.to_yaml()```
#### Error
```TypeError: dict_to_yaml() missing 1 required positional argument: 'data'```
The error suggests that the arguments to `dict_to_yaml()` are being passed in the wrong order or format. Previously this method worked fine for generating YAML output from the spec dictionary.
## Environment
The repository is at `/testbed/repo`. Its dependencies, including pytest, are installed in the `testbed` conda environment, which comes first on PATH. If `python -m pytest` reports that pytest is missing, use the full interpreter path: `/opt/miniconda3/envs/testbed/bin/python -m pytest <tests>`. Don't install packages: the tests need nothing else, and the sandbox may have no network access.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746{ "all_runtime_and_training_flags": false, "official_profile": { "eval_sets": [], "profile_class": "Apispec8b421526", "profile_lines": [ 127, 131 ], "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", "profile_source_path": "swesmith/profiles/python.py", "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", "upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "upstream_repo": "marshmallow-code/apispec" }, "source_healthy_reference_proof": { "FAIL_TO_PASS": [ "tests/test_core.py::TestComponents::test_to_yaml[2.0]", "tests/test_core.py::TestComponents::test_to_yaml[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_lazy[2.0]", "tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_response_lazy[2.0]", "tests/test_core.py::TestComponents::test_response_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_header_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_example_lazy[3.0.0]", "tests/test_core.py::TestPath::test_path[2.0]", "tests/test_core.py::TestPath::test_path[3.0.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_response[2.0]", "tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3" ], "PASS_TO_PASS": [ "tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version", "tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]", "tests/test_core.py::TestTags::test_tag[2.0]", "tests/test_core.py::TestTags::test_tag[3.0.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[2.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema[2.0]", "tests/test_core.py::TestComponents::test_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema_description[2.0]", "tests/test_core.py::TestComponents::test_schema_description[3.0.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[2.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_response[2.0]", "tests/test_core.py::TestComponents::test_response[3.0.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_parameter[2.0]", "tests/test_core.py::TestComponents::test_parameter[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_header[3.0.0]", "tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_example[3.0.0]", "tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme[2.0]", "tests/test_core.py::TestComponents::test_security_scheme[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[2.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[2.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_is_chainable[2.0]", "tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_merges_paths[2.0]", "tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]", "tests/test_core.py::TestPath::test_path_summary_description[2.0]", "tests/test_core.py::TestPath::test_path_summary_description[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]", "tests/test_core.py::TestPath::test_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_global_parameters[2.0]", "tests/test_core.py::TestPath::test_global_parameters[3.0.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPluginsOrder::test_plugins_order", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[3.0.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]", "tests/test_utils.py::test_build_reference", "tests/test_yaml_utils.py::test_load_yaml_from_docstring", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_dict_to_yaml_unicode", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs" ], "all_git_blobs_modes_verified": true, "cloud_launch_ready": false, "commits": { "bug": "24e2ab1be595b648135a3e70b7b5bc2784273669", "healthy": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "learner": "04112d2ca1b131c061608fbb5c54b8e6189c39da" }, "existing_squirrel_snapshot_reused": false, "full_transfer_allowlist": [ "/testbed/.github/FUNDING.yml", "/testbed/.github/dependabot.yml", "/testbed/.gitignore", "/testbed/.pre-commit-config.yaml", "/testbed/AUTHORS.rst", "/testbed/CHANGELOG.rst", "/testbed/CONTRIBUTING.rst", "/testbed/LICENSE", "/testbed/README.rst", "/testbed/RELEASING.md", "/testbed/SECURITY.md", "/testbed/docs/Makefile", "/testbed/docs/api_core.rst", "/testbed/docs/api_ext.rst", "/testbed/docs/authors.rst", "/testbed/docs/changelog.rst", "/testbed/docs/conf.py", "/testbed/docs/contributing.rst", "/testbed/docs/ecosystem.rst", "/testbed/docs/index.rst", "/testbed/docs/install.rst", "/testbed/docs/license.rst", "/testbed/docs/make.bat", "/testbed/docs/quickstart.rst", "/testbed/docs/special_topics.rst", "/testbed/docs/upgrading.rst", "/testbed/docs/using_plugins.rst", "/testbed/docs/writing_plugins.rst", "/testbed/pyproject.toml", "/testbed/readthedocs.yml", "/testbed/src/apispec/__init__.py", "/testbed/src/apispec/core.py", "/testbed/src/apispec/exceptions.py", "/testbed/src/apispec/ext/__init__.py", "/testbed/src/apispec/ext/marshmallow/__init__.py", "/testbed/src/apispec/ext/marshmallow/common.py", "/testbed/src/apispec/ext/marshmallow/field_converter.py", "/testbed/src/apispec/ext/marshmallow/openapi.py", "/testbed/src/apispec/ext/marshmallow/schema_resolver.py", "/testbed/src/apispec/plugin.py", "/testbed/src/apispec/py.typed", "/testbed/src/apispec/utils.py", "/testbed/src/apispec/yaml_utils.py", "/testbed/tests/__init__.py", "/testbed/tests/conftest.py", "/testbed/tests/schemas.py", "/testbed/tests/test_ext_marshmallow_common.py", "/testbed/tests/test_ext_marshmallow_field.py", "/testbed/tests/test_utils.py", "/testbed/tests/test_yaml_utils.py", "/testbed/tests/utils.py", "/testbed/tox.ini" ], "healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed", "mutation_matches_dataset_and_git_blobs": true, "official_profile": { "eval_sets": [], "profile_class": "Apispec8b421526", "profile_lines": [ 127, 131 ], "profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f", "profile_source_path": "swesmith/profiles/python.py", "profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286", "upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "upstream_repo": "marshmallow-code/apispec" }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "private_test_paths": [ "tests/test_core.py", "tests/test_ext_marshmallow.py", "tests/test_ext_marshmallow_openapi.py" ], "private_tests_unchanged": true, "profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference", "qwen_calibrated": false, "runtime_qualified": false, "source_paths": [ "src/apispec/core.py" ], "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_stages_bytes": 993593, "task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter", "upstream_repo": "marshmallow-code/apispec" }, "source_record": { "anti_training_canary": false, "anti_training_reviewed": true, "candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "cloud_launch_ready": false, "eligibility": { "reasons": [], "semantic_nonoverlap_established": false, "status": "eligible_for_controls", "training_admissible": false, "warnings": [] }, "healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "instruction_sha256": "58e450f9279684eedad9ec4d60c7843ea4f327a7b998dec18d6f185a07ef320a", "is_fork": true, "learner_path": "tasks/b491c0d8099392581ef57f79/learner", "license_evidence": { "source_code": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE" }, "task_bundle": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" } }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "patch_sha256": "9f63a2eaa5b2a77d4e0a4bd4406001c92d391be96abbf626ca370ad0f9e616ed", "provenance_path": "tasks/b491c0d8099392581ef57f79/source-proof.json", "repository_lineage": [ "swesmith/marshmallow-code__apispec.8b421526", "marshmallow-code/apispec" ], "rfc008_complete": false, "runtime_qualified": false, "semantic_nonoverlap_established": false, "source_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da", "source_dataset": "SWE-bench/SWE-smith-py", "source_head_commit": "24e2ab1be595b648135a3e70b7b5bc2784273669", "source_kind": "mutation", "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", "source_split": "train", "target_model_calibrated": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "task_sha256": "8c5ba9cccfd4e92bfe3ba985908417f3b97bd5e79e3b2b9fcd09d924b37c76b4", "training_admissible": false, "upstream_identity_reviewed": true, "upstream_repo": "marshmallow-code/apispec", "usage": "quarantine_only" }, "task_kind": "original-source-mutation"}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788{ "generated_reference": false, "healthy_reference_delta_sha256": "ec036495f24bdfc187e0075606bb1302ea32f79002282ab5f371e9977f625deb", "native_pytest_ids_preserved": true, "original_source_code_license": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE" }, "provided_reference": true, "qwen_calibrated": false, "runtime_qualified": false, "source_completion_sha256": "2ef340184cc1d9dfcd2cbc9bb05622525f817bc4a8e7dc4790232a42c6108cc0", "source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876", "source_proof_sha256": "2c968127a5889bc8a89a49adaacdeca97e704272c704ba9868f328aac0ea4bf5", "source_record": { "anti_training_canary": false, "anti_training_reviewed": true, "candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "cloud_launch_ready": false, "eligibility": { "reasons": [], "semantic_nonoverlap_established": false, "status": "eligible_for_controls", "training_admissible": false, "warnings": [] }, "healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e", "instruction_sha256": "58e450f9279684eedad9ec4d60c7843ea4f327a7b998dec18d6f185a07ef320a", "is_fork": true, "learner_path": "tasks/b491c0d8099392581ef57f79/learner", "license_evidence": { "source_code": { "actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE", "reviewed": true, "sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d", "spdx": "MIT", "training_allowed": true, "url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE" }, "task_bundle": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" } }, "original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44", "patch_sha256": "9f63a2eaa5b2a77d4e0a4bd4406001c92d391be96abbf626ca370ad0f9e616ed", "provenance_path": "tasks/b491c0d8099392581ef57f79/source-proof.json", "repository_lineage": [ "swesmith/marshmallow-code__apispec.8b421526", "marshmallow-code/apispec" ], "rfc008_complete": false, "runtime_qualified": false, "semantic_nonoverlap_established": false, "source_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da", "source_dataset": "SWE-bench/SWE-smith-py", "source_head_commit": "24e2ab1be595b648135a3e70b7b5bc2784273669", "source_kind": "mutation", "source_repo": "swesmith/marshmallow-code__apispec.8b421526", "source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e", "source_split": "train", "target_model_calibrated": false, "task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap", "task_sha256": "8c5ba9cccfd4e92bfe3ba985908417f3b97bd5e79e3b2b9fcd09d924b37c76b4", "training_admissible": false, "upstream_identity_reviewed": true, "upstream_repo": "marshmallow-code/apispec", "usage": "quarantine_only" }, "task_bundle_license": { "reviewed": true, "sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808", "spdx": "MIT", "training_allowed": true, "url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md" }, "training_admissible": false, "trusted_tests_sha256": "800ba7da08ca9ff402906f2c3f0f85c4f500c385020e3e6b6d0a029e65c0654e"}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950diff --git a/src/apispec/core.py b/src/apispec/core.pyindex c7bdf463986b005f8254bc85691b59c972a45f6c..e9ccb40635faff1ceb3d7234d7458cb6db4ae67d 100644--- a/src/apispec/core.py+++ b/src/apispec/core.py@@ -331,9 +331,15 @@ if "items" in schema: schema["items"] = self.get_ref("schema", schema["items"]) self._resolve_refs_in_schema(schema["items"])+ for key in ("allOf", "oneOf", "anyOf"):+ if key in schema:+ schema[key] = [self.get_ref("schema", s) for s in schema[key]]+ for sch in schema[key]:+ self._resolve_refs_in_schema(sch) if "not" in schema: schema["not"] = self.get_ref("schema", schema["not"]) self._resolve_refs_in_schema(schema["not"])+ def _resolve_refs_in_parameter_or_header(self, parameter_or_header) -> None: self._resolve_schema(parameter_or_header) self._resolve_examples(parameter_or_header)@@ -370,12 +376,18 @@ if "callbacks" in operation: for callback in operation["callbacks"].values(): if isinstance(callback, dict):- pass+ for path in callback.values():+ self.resolve_refs_in_path(path) if "requestBody" in operation: self._resolve_refs_in_request_body(operation["requestBody"]) if "responses" in operation: responses = {}+ for code, response in operation["responses"].items():+ response = self.get_ref("response", response)+ self._resolve_refs_in_response(response)+ responses[code] = response operation["responses"] = responses+ def resolve_refs_in_path(self, path) -> None: if "parameters" in path: parameters = []@@ -467,8 +479,7 @@ """ from .yaml_utils import dict_to_yaml - # Swapping the argument order and providing both as positional arguments instead of using a keyword argument.- return dict_to_yaml(yaml_dump_kwargs, self.to_dict())+ return dict_to_yaml(self.to_dict(), yaml_dump_kwargs) def tag(self, tag: dict) -> APISpec: """Store information about a tag.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#!/bin/bashset -Eeuo pipefailcd /testbed/repocat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE'diff --git a/src/apispec/core.py b/src/apispec/core.pyindex c7bdf463986b005f8254bc85691b59c972a45f6c..e9ccb40635faff1ceb3d7234d7458cb6db4ae67d 100644--- a/src/apispec/core.py+++ b/src/apispec/core.py@@ -331,9 +331,15 @@ if "items" in schema: schema["items"] = self.get_ref("schema", schema["items"]) self._resolve_refs_in_schema(schema["items"])+ for key in ("allOf", "oneOf", "anyOf"):+ if key in schema:+ schema[key] = [self.get_ref("schema", s) for s in schema[key]]+ for sch in schema[key]:+ self._resolve_refs_in_schema(sch) if "not" in schema: schema["not"] = self.get_ref("schema", schema["not"]) self._resolve_refs_in_schema(schema["not"])+ def _resolve_refs_in_parameter_or_header(self, parameter_or_header) -> None: self._resolve_schema(parameter_or_header) self._resolve_examples(parameter_or_header)@@ -370,12 +376,18 @@ if "callbacks" in operation: for callback in operation["callbacks"].values(): if isinstance(callback, dict):- pass+ for path in callback.values():+ self.resolve_refs_in_path(path) if "requestBody" in operation: self._resolve_refs_in_request_body(operation["requestBody"]) if "responses" in operation: responses = {}+ for code, response in operation["responses"].items():+ response = self.get_ref("response", response)+ self._resolve_refs_in_response(response)+ responses[code] = response operation["responses"] = responses+ def resolve_refs_in_path(self, path) -> None: if "parameters" in path: parameters = []@@ -467,8 +479,7 @@ """ from .yaml_utils import dict_to_yaml - # Swapping the argument order and providing both as positional arguments instead of using a keyword argument.- return dict_to_yaml(yaml_dump_kwargs, self.to_dict())+ return dict_to_yaml(self.to_dict(), yaml_dump_kwargs) def tag(self, tag: dict) -> APISpec: """Store information about a tag.OPENENV_REFERENCE/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff123456789101112131415161718192021222324version = "1.0"
[agent]timeout_sec = 1800.0
[verifier]timeout_sec = 900.0
[environment]docker_image = "ghcr.io/younesbelkada/scale800@sha256:764c60a55750844cbf153977b51a42456df522f4355353cafb526be09d5ae9f0"build_timeout_sec = 600.0cpus = 2memory_mb = 8192storage_mb = 16384
[metadata]author_name = "SWE-smith source adapter"category = "bugfix"tags = ["swe", "python", "mutation-repair"]
[environment.env]# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's# non-interactive shells never run `conda activate`PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091"""Distinguish real pytest failures from missing/setup/verifier evidence."""
import argparseimport jsonimport reimport xml.etree.ElementTree as ETfrom pathlib import Path
def matches(case, target): parts = target.split("::") module = parts[0].removesuffix(".py").replace("/", ".") classname = case.get("classname", "") name = case.get("name", "") if not (classname == module or classname.startswith(module + ".")): return False selector = parts[-1] if len(parts) > 1 else "" classes = parts[1:-1] if classes and classname != module + "." + ".".join(classes): return False return ( not selector or name == selector or ("[" not in selector and name.startswith(selector + "[")) )
def assess(root, expected, native_exit): all_cases = [] actual_failure = False for group in ("pass-to-pass", "fail-to-pass"): path = Path(root) / (group + ".xml") if not path.exists(): if actual_failure: continue raise ValueError("Missing preceding pytest panel") if actual_failure: raise ValueError( "Pytest evidence continued after the native stop-on-failure" ) raw = path.read_bytes() if not 0 < len(raw) <= 4 * 1024**2 or re.search( rb"<!\s*(?:DOCTYPE|ENTITY)", raw, re.I ): raise ValueError("Unbounded or unsafe pytest XML") tree = ET.fromstring(raw) cases = list(tree.iter("testcase")) if len(cases) > 20000: raise ValueError("Too many pytest cases") identities = [(c.get("classname"), c.get("name")) for c in cases] if len(identities) != len(set(identities)): raise ValueError("Duplicate pytest case evidence") targets = expected[group] if any(not any(matches(case, t) for t in targets) for case in cases): raise ValueError("Unexpected pytest case") all_cases.extend(cases) failures = [c for c in cases if c.find("failure") is not None] if any( c.find("error") is not None or c.find("skipped") is not None for c in cases ): raise ValueError("Pytest collection/error/skip is not a completed panel") actual_failure = actual_failure or bool(failures) if not failures and any( not any(matches(case, t) for case in cases) for t in targets ): raise ValueError("Declared pytest target never ran") if actual_failure: if native_exit == 0: raise ValueError("Native verifier exit disagrees with pytest failure") return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)} if native_exit != 0: raise ValueError("Setup or native verifier failed without a real test failure") for group in ("pass-to-pass", "fail-to-pass"): if not (Path(root) / (group + ".xml")).is_file(): raise ValueError("Missing completed pytest panel") return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)}
if __name__ == "__main__": p = argparse.ArgumentParser() p.add_argument("--root", required=True) p.add_argument("--expected", required=True) p.add_argument("--native-exit", type=int, required=True) a = p.parse_args() result = assess(a.root, json.loads(Path(a.expected).read_text()), a.native_exit) reward = Path(a.root) / "reward.txt" if reward.read_text().strip() != str(result["reward"]): raise ValueError("Native raw reward disagrees with pytest evidence") (Path(a.root) / "pytest-evidence.json").write_text( json.dumps(result, sort_keys=True) + "\n" )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575{ "fail-to-pass": [ "tests/test_core.py::TestComponents::test_to_yaml[2.0]", "tests/test_core.py::TestComponents::test_to_yaml[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_lazy[2.0]", "tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_response_lazy[2.0]", "tests/test_core.py::TestComponents::test_response_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_header_lazy[3.0.0]", "tests/test_core.py::TestComponents::test_example_lazy[3.0.0]", "tests/test_core.py::TestPath::test_path[2.0]", "tests/test_core.py::TestPath::test_path[3.0.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]", "tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_response[2.0]", "tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]", "tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]", "tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]", "tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2", "tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3" ], "pass-to-pass": [ "tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version", "tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]", "tests/test_core.py::TestTags::test_tag[2.0]", "tests/test_core.py::TestTags::test_tag[3.0.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[2.0]", "tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema[2.0]", "tests/test_core.py::TestComponents::test_schema[3.0.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_schema_description[2.0]", "tests/test_core.py::TestComponents::test_schema_description[3.0.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]", "tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[2.0]", "tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_response[2.0]", "tests/test_core.py::TestComponents::test_response[3.0.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_parameter[2.0]", "tests/test_core.py::TestComponents::test_parameter[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_header[3.0.0]", "tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_example[3.0.0]", "tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme[2.0]", "tests/test_core.py::TestComponents::test_security_scheme[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]", "tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]", "tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]", "tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[2.0]", "tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[2.0]", "tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_is_chainable[2.0]", "tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]", "tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]", "tests/test_core.py::TestPath::test_path_merges_paths[2.0]", "tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]", "tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]", "tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]", "tests/test_core.py::TestPath::test_path_summary_description[2.0]", "tests/test_core.py::TestPath::test_path_summary_description[3.0.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]", "tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]", "tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]", "tests/test_core.py::TestPath::test_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_global_parameters[2.0]", "tests/test_core.py::TestPath::test_global_parameters[3.0.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]", "tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]", "tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]", "tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]", "tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]", "tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]", "tests/test_core.py::TestPluginsOrder::test_plugins_order", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]", "tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]", "tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]", "tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]", "tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]", "tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]", "tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]", "tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]", "tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]", "tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]", "tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]", "tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal", "tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]", "tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]", "tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]", "tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]", "tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]", "tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]", "tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]", "tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]", "tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]", "tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]", "tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]", "tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]", "tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]", "tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]", "tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[3.0.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[2.0]", "tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[3.0.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]", "tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]", "tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]", "tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]", "tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]", "tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]", "tests/test_utils.py::test_build_reference", "tests/test_yaml_utils.py::test_load_yaml_from_docstring", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]", "tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]", "tests/test_yaml_utils.py::test_dict_to_yaml_unicode", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default", "tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs" ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128"""Trusted private pytest panel runner. Installed only in a fresh grader Job."""
import hashlibimport importlib.utilimport jsonimport osimport shutilimport statimport subprocessfrom pathlib import Path, PurePosixPath
def sha(raw): return hashlib.sha256(raw).hexdigest()
def safe(value): path = PurePosixPath(value) if ( path.is_absolute() or path.as_posix() != value or not path.parts or any(part in {".", "..", ".git"} for part in path.parts) ): raise ValueError("Unsafe trusted test path") return path
def restore(worktree, private, manifest): worktree, private = Path(worktree), Path(private) captured = {} for name, expected in manifest["files"].items(): path = private / safe(name) info = path.lstat() raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b"" if ( not stat.S_ISREG(info.st_mode) or len(raw) != expected["bytes"] or sha(raw) != expected["sha256"] or stat.S_IMODE(info.st_mode) != expected["mode"] ): raise ValueError("Trusted private test bytes or modes drifted") captured[name] = (raw, expected["mode"]) # Capture and verify every private byte before changing the submitted tree. for name in manifest["directory_roots"]: destination = worktree / safe(name) if destination.is_symlink(): raise ValueError("Submitted test directory is a symlink") for parent in destination.parents: if parent == worktree: break if parent.is_symlink(): raise ValueError("Submitted test parent is a symlink") if destination.exists(): if not destination.is_dir(): raise ValueError("Submitted test directory is not a directory") shutil.rmtree(destination) for name, (raw, mode) in captured.items(): destination = worktree / safe(name) for parent in destination.parents: if parent == worktree: break if parent.is_symlink(): raise ValueError("Submitted test parent is a symlink") if destination.is_symlink(): raise ValueError("Submitted trusted file is a symlink") destination.parent.mkdir(parents=True, exist_ok=True) destination.write_bytes(raw) destination.chmod(mode)
def run(worktree, private_root, output, invoke=None): private_root, output, worktree = Path(private_root), Path(output), Path(worktree) expected = json.loads((private_root / "expected-panels.json").read_bytes()) config = json.loads((private_root / "panel-config.json").read_bytes()) manifest = json.loads((private_root / "trusted-inventory.json").read_bytes()) restore(worktree, private_root / "trusted", manifest) output.mkdir(parents=True, exist_ok=True) for name in ( "reward.txt", "pass-to-pass.xml", "fail-to-pass.xml", "pytest-evidence.json", ): (output / name).unlink(missing_ok=True) environment = dict(os.environ) for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"): environment.pop(key, None) commands, native_exit = [], 0 invoke = invoke or subprocess.run for group in ("pass-to-pass", "fail-to-pass"): if ( not isinstance(expected[group], list) or not expected[group] or any( not isinstance(target, str) or not target for target in expected[group] ) ): raise ValueError("Frozen native pytest selectors are incomplete") command = [ *config["official_pytest_argv"], "--override-ini=addopts=", "--junitxml=" + str(output / (group + ".xml")), *expected[group], ] result = invoke(command, cwd=worktree, env=environment, check=False) native_exit = result.returncode commands.append({"group": group, "argv": command, "exit_code": native_exit}) if native_exit != 0: break (output / "pytest-commands.json").write_text( json.dumps(commands, sort_keys=True) + "\n" ) spec = importlib.util.spec_from_file_location( "trusted_pytest_result", private_root / "check_pytest.py" ) checker = importlib.util.module_from_spec(spec) spec.loader.exec_module(checker) result = checker.assess(output, expected, native_exit) (output / "reward.txt").write_text(str(result["reward"]) + "\n") (output / "pytest-evidence.json").write_text( json.dumps(result, sort_keys=True) + "\n" ) return result
if __name__ == "__main__": run("/testbed/repo", "/tests", "/logs/verifier")1234567891011121314151617181920212223{ "dependency_installation_pinned": false, "official_install_cmds": [ "pip install -e .[dev]" ], "official_pytest_argv": [ "pytest", "--disable-warnings", "--color=no", "--tb=no", "--verbose" ], "official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose", "panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.", "python_version": "3.10", "source_bound_test_dependency_cmds": [ "python -m pip install 'marshmallow>=3.10.0,<4.0.0'" ], "test_dependency_source_sha256": { "pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4", "tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7" }}123456#!/bin/bashset -Eeuo pipefailsource /opt/miniconda3/bin/activateconda activate testbedcd /testbed/repoexec python -I /tests/grade.py123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172{ "directory_roots": [ "tests" ], "files": { "pyproject.toml": { "bytes": 2488, "mode": 420, "sha256": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4" }, "tests/__init__.py": { "bytes": 0, "mode": 420, "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, "tests/conftest.py": { "bytes": 810, "mode": 420, "sha256": "0009b46d9e729e75bd002d1e0864afaca1f96a6953ce60f8389410bebd0787e2" }, "tests/schemas.py": { "bytes": 2130, "mode": 420, "sha256": "64084646e19c70bf1170dd6639bdd6800dd92a3983074ed2841fae60fbaaec61" }, "tests/test_core.py": { "bytes": 51766, "mode": 420, "sha256": "18ca6c50d1894f5b4fc3d981412341ceed3cc1401bca7ab5ec0c8688b2c67ff3" }, "tests/test_ext_marshmallow.py": { "bytes": 52950, "mode": 420, "sha256": "12f40adf8f18db5073d9f0b692562c528eebc008307e982149da48c7fb600cf5" }, "tests/test_ext_marshmallow_common.py": { "bytes": 3236, "mode": 420, "sha256": "e17249f21422b2fa79f74f51898f242cb1e9786d0ba6df58bc3086d928d51d79" }, "tests/test_ext_marshmallow_field.py": { "bytes": 22438, "mode": 420, "sha256": "39223a47f90ca40e515a7e34ac8806087b3e0ba2968f6832b0a4a77c8c7226b1" }, "tests/test_ext_marshmallow_openapi.py": { "bytes": 24310, "mode": 420, "sha256": "d4edc2675840f8cc7ba0dda6169e2ab3e5c59907e20ae26576d4860828cb9e6b" }, "tests/test_utils.py": { "bytes": 918, "mode": 420, "sha256": "54f00d286b489440bc17cbbb162fcd53c7aedd8f96dea8d5064f44f70c026810" }, "tests/test_yaml_utils.py": { "bytes": 1285, "mode": 420, "sha256": "4a4af4dc1f013207b65093d25ac67809409c1ec7f63f03122a27bf9e1c873003" }, "tests/utils.py": { "bytes": 1806, "mode": 420, "sha256": "a0de7ce4c28047b674ffe7d5ff4cf2b9d97a07378b529c1f058a7099838ea000" }, "tox.ini": { "bytes": 778, "mode": 420, "sha256": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7" } }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697[project]name = "apispec"version = "6.8.1"description = "A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)."readme = "README.rst"license = { file = "LICENSE" }authors = [{ name = "Steven Loria", email = "sloria1@gmail.com" }]maintainers = [ { name = "Steven Loria", email = "sloria1@gmail.com" }, { name = "Jérôme Lafréchoux", email = "jerome@jolimont.fr" },]classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13",]keywords = [ "apispec", "swagger", "openapi", "specification", "oas", "documentation", "spec", "rest", "api",]requires-python = ">=3.9"dependencies = ["packaging>=21.3"]
[project.urls]Changelog = "https://apispec.readthedocs.io/en/latest/changelog.html"Funding = "https://opencollective.com/marshmallow"Issues = "https://github.com/marshmallow-code/apispec/issues"Source = "https://github.com/marshmallow-code/apispec"Tidelift = "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi"
[project.optional-dependencies]yaml = ["PyYAML>=3.10"]marshmallow = ["marshmallow>=3.18.0"]docs = [ "apispec[marshmallow]", "pyyaml==6.0.2", "sphinx==8.1.3", "sphinx-issues==5.0.0", "sphinx-rtd-theme==3.0.2",]tests = ["apispec[yaml,marshmallow]", "openapi-spec-validator==0.7.1", "pytest"]dev = ["apispec[tests]", "tox", "pre-commit>=3.5,<5.0"]
[build-system]requires = ["flit_core<4"]build-backend = "flit_core.buildapi"
[tool.flit.sdist]include = [ "docs/", "tests/", "CHANGELOG.rst", "CONTRIBUTING.rst", "SECURITY.md", "tox.ini",]exclude = ["docs/_build/"]
[tool.ruff]src = ["src"]fix = trueshow-fixes = trueoutput-format = "full"
[tool.ruff.format]docstring-code-format = true
[tool.ruff.lint]ignore = ["E203", "E266", "E501", "E731"]select = [ "B", # flake8-bugbear "E", # pycodestyle error "F", # pyflakes "I", # isort "UP", # pyupgrade "W", # pycodestyle warning]
[tool.mypy]ignore_missing_imports = truewarn_unreachable = truewarn_unused_ignores = truewarn_redundant_casts = trueno_implicit_optional = truetasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/LICENSE.sourceAdded+19
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/adapter.jsonAdded+127
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/dependency-setup.shAdded+8
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/environment/DockerfileAdded+3
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/instruction.mdAdded+38
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/metadata.jsonAdded+736
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provenance.jsonAdded+88
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provided-gold.diffAdded+41
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/solution/solve.shAdded+47
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/task.tomlAdded+24
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/check_pytest.pyAdded+91
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/expected-panels.jsonAdded+565
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/grade.pyAdded+128
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/panel-config.jsonAdded+23
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/test.shAdded+6
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted-inventory.jsonAdded+72
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/pyproject.tomlAdded+97
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/__init__.pyAdded
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/conftest.pyAdded+35
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/schemas.pyAdded+85
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_core.pyAdded+1269
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow.pyAdded+1342
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_common.pyAdded+90
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_field.pyAdded+664
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_openapi.pyAdded+685
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_utils.pyAdded+24
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_yaml_utils.pyAdded+47
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/utils.pyAdded+65
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tox.iniAdded+34
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/first-hunk-only.shAdded+29
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/original-bug.shAdded+3
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/openenv.jsonAdded+27
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/LICENSE.sourceAdded+19
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/adapter.jsonAdded+127
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/dependency-setup.shAdded+8
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/environment/DockerfileAdded+3
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/instruction.mdAdded+32
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/metadata.jsonAdded+746
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provenance.jsonAdded+88
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provided-gold.diffAdded+50
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/solution/solve.shAdded+56
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/task.tomlAdded+24
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/check_pytest.pyAdded+91
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/expected-panels.jsonAdded+575
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/grade.pyAdded+128
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/panel-config.jsonAdded+23
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/test.shAdded+6
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted-inventory.jsonAdded+72
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/pyproject.tomlAdded+97
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/tests/__init__.pyAdded