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
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/LICENSE.source +19 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/adapter.json +127 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/dependency-setup.sh +8 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/environment/Dockerfile +3 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/instruction.md +38 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/metadata.json +736 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provenance.json +88 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provided-gold.diff +41 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/solution/solve.sh +47 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/task.toml +24 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/check_pytest.py +91 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/expected-panels.json +565 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/grade.py +128 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/panel-config.json +23 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/test.sh +6 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted-inventory.json +72 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/pyproject.toml +97 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/__init__.py +0 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/conftest.py +35 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/schemas.py +85 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_core.py +1269 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow.py +1342 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_common.py +90 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_field.py +664 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_openapi.py +685 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_utils.py +24 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_yaml_utils.py +47 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/utils.py +65 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tox.ini +34 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/first-hunk-only.sh +29 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/original-bug.sh +3 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/openenv.json +27 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/LICENSE.source +19 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/adapter.json +127 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/dependency-setup.sh +8 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/environment/Dockerfile +3 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/instruction.md +32 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/metadata.json +746 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provenance.json +88 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provided-gold.diff +50 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/solution/solve.sh +56 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/task.toml +24 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/check_pytest.py +91 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/expected-panels.json +575 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/grade.py +128 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/panel-config.json +23 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/test.sh +6 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted-inventory.json +72 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/pyproject.toml +97 -0
- tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/tests/__init__.py +0 -0
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/LICENSE.source
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright Steven Loria, Jérôme Lafréchoux, and contributors
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 4 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 5 |
+
in the Software without restriction, including without limitation the rights
|
| 6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 7 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 8 |
+
furnished to do so, subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in
|
| 11 |
+
all copies or substantial portions of the Software.
|
| 12 |
+
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 19 |
+
THE SOFTWARE.
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/adapter.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"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.",
|
| 3 |
+
"collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481",
|
| 4 |
+
"dependency_installation_pinned": false,
|
| 5 |
+
"dependency_setup_sha256": "213839c53a312d83a5569a18303cecdb03befd5a43f54c1af2e7afcf93ea1ac5",
|
| 6 |
+
"gold_patch_sha256": "de2a4ba1cd39cdd977548d94da03112df3c316b9e2ebce0115e104f82eeff17d",
|
| 7 |
+
"hostile_code_isolation_established": false,
|
| 8 |
+
"known_wrong_semantic_implementations": 0,
|
| 9 |
+
"native_inventory_sha256": "492be585a058a3631e0b331afad30aff9c7199b8690d001a259334c9c024016a",
|
| 10 |
+
"new_files_deletions_and_executable_modes_supported": true,
|
| 11 |
+
"official_profile": {
|
| 12 |
+
"eval_sets": [],
|
| 13 |
+
"profile_class": "Apispec8b421526",
|
| 14 |
+
"profile_lines": [
|
| 15 |
+
127,
|
| 16 |
+
131
|
| 17 |
+
],
|
| 18 |
+
"profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f",
|
| 19 |
+
"profile_source_path": "swesmith/profiles/python.py",
|
| 20 |
+
"profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286",
|
| 21 |
+
"upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 22 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 23 |
+
},
|
| 24 |
+
"original_bug_canary_nop_equivalent": true,
|
| 25 |
+
"original_bug_runtime_wrongness_established": false,
|
| 26 |
+
"partial_repair_canary": true,
|
| 27 |
+
"partial_repair_sha256": "d646e697c79226f71af6c3237b051bc1752870f3a39cc7116e4641926039be08",
|
| 28 |
+
"partial_repair_wrongness_established": false,
|
| 29 |
+
"provided_original_bug_control": true,
|
| 30 |
+
"repo_url": "https://github.com/swesmith/marshmallow-code__apispec.8b421526.git",
|
| 31 |
+
"runtime_image": null,
|
| 32 |
+
"runtime_ready": false,
|
| 33 |
+
"runtime_recipe": {
|
| 34 |
+
"dependency_installation_pinned": false,
|
| 35 |
+
"official_install_cmds": [
|
| 36 |
+
"pip install -e .[dev]"
|
| 37 |
+
],
|
| 38 |
+
"official_pytest_argv": [
|
| 39 |
+
"pytest",
|
| 40 |
+
"--disable-warnings",
|
| 41 |
+
"--color=no",
|
| 42 |
+
"--tb=no",
|
| 43 |
+
"--verbose"
|
| 44 |
+
],
|
| 45 |
+
"official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose",
|
| 46 |
+
"panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.",
|
| 47 |
+
"python_version": "3.10",
|
| 48 |
+
"source_bound_test_dependency_cmds": [
|
| 49 |
+
"python -m pip install 'marshmallow>=3.10.0,<4.0.0'"
|
| 50 |
+
],
|
| 51 |
+
"test_dependency_source_sha256": {
|
| 52 |
+
"pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4",
|
| 53 |
+
"tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"runtime_resource_review_required": false,
|
| 57 |
+
"schema": "python-git-patch-jobs-v1",
|
| 58 |
+
"source_base_commit": "fba1562227e51ef44176e0af5866b30084e89e34",
|
| 59 |
+
"source_completion_sha256": "c4f70a6d59c4b6677e4f99f817db164d5e9ba3812b205ded396d485c95fa756a",
|
| 60 |
+
"source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876",
|
| 61 |
+
"source_pr_url": null,
|
| 62 |
+
"source_record": {
|
| 63 |
+
"anti_training_canary": false,
|
| 64 |
+
"anti_training_reviewed": true,
|
| 65 |
+
"candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 66 |
+
"cloud_launch_ready": false,
|
| 67 |
+
"eligibility": {
|
| 68 |
+
"reasons": [],
|
| 69 |
+
"semantic_nonoverlap_established": false,
|
| 70 |
+
"status": "eligible_for_controls",
|
| 71 |
+
"training_admissible": false,
|
| 72 |
+
"warnings": []
|
| 73 |
+
},
|
| 74 |
+
"healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 75 |
+
"instruction_sha256": "b99d93e7d1ff633d09d46c2987f628b9957c2d97ac0aaf0f29923c7c795bf73a",
|
| 76 |
+
"is_fork": true,
|
| 77 |
+
"learner_path": "tasks/8c897387852803297e721ad7/learner",
|
| 78 |
+
"license_evidence": {
|
| 79 |
+
"source_code": {
|
| 80 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 81 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 82 |
+
"reviewed": true,
|
| 83 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 84 |
+
"spdx": "MIT",
|
| 85 |
+
"training_allowed": true,
|
| 86 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE"
|
| 87 |
+
},
|
| 88 |
+
"task_bundle": {
|
| 89 |
+
"reviewed": true,
|
| 90 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 91 |
+
"spdx": "MIT",
|
| 92 |
+
"training_allowed": true,
|
| 93 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 94 |
+
}
|
| 95 |
+
},
|
| 96 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 97 |
+
"patch_sha256": "9dccf3389c791cc31b743bcef019e52d81149a6224ee9201699f6ea2855e64da",
|
| 98 |
+
"provenance_path": "tasks/8c897387852803297e721ad7/source-proof.json",
|
| 99 |
+
"repository_lineage": [
|
| 100 |
+
"swesmith/marshmallow-code__apispec.8b421526",
|
| 101 |
+
"marshmallow-code/apispec"
|
| 102 |
+
],
|
| 103 |
+
"rfc008_complete": false,
|
| 104 |
+
"runtime_qualified": false,
|
| 105 |
+
"semantic_nonoverlap_established": false,
|
| 106 |
+
"source_commit": "fba1562227e51ef44176e0af5866b30084e89e34",
|
| 107 |
+
"source_dataset": "SWE-bench/SWE-smith-py",
|
| 108 |
+
"source_head_commit": "2e76199a4675c36551a60af74281a718099c0598",
|
| 109 |
+
"source_kind": "mutation",
|
| 110 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 111 |
+
"source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e",
|
| 112 |
+
"source_split": "train",
|
| 113 |
+
"target_model_calibrated": false,
|
| 114 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 115 |
+
"task_sha256": "0f66703367994d529603408f2239290015020c9799d54c597935b6458c5e4a38",
|
| 116 |
+
"training_admissible": false,
|
| 117 |
+
"upstream_identity_reviewed": true,
|
| 118 |
+
"upstream_repo": "marshmallow-code/apispec",
|
| 119 |
+
"usage": "quarantine_only"
|
| 120 |
+
},
|
| 121 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 122 |
+
"symlink_submodule_changes_supported": false,
|
| 123 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 124 |
+
"transfer": "index-independent-worktree-to-Git-binary-patch",
|
| 125 |
+
"transfer_path": "/testbed/submission.patch",
|
| 126 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 127 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/dependency-setup.sh
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
source /opt/miniconda3/bin/activate
|
| 4 |
+
conda activate testbed
|
| 5 |
+
cd /testbed/repo
|
| 6 |
+
python -c 'import sys; assert sys.version_info[:2] == (3, 10)'
|
| 7 |
+
pip install -e .[dev]
|
| 8 |
+
python -m pip install 'marshmallow>=3.10.0,<4.0.0'
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Runtime is selected only by an independently qualified immutable amd64 receipt.
|
| 2 |
+
FROM ubuntu:22.04
|
| 3 |
+
RUN false
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/instruction.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Schema key generation produces inconsistent results with unhashable attributes
|
| 2 |
+
|
| 3 |
+
#### Description
|
| 4 |
+
|
| 5 |
+
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.
|
| 6 |
+
|
| 7 |
+
#### Steps/Code to Reproduce
|
| 8 |
+
|
| 9 |
+
```python
|
| 10 |
+
from apispec.ext.marshmallow.common import make_schema_key
|
| 11 |
+
import marshmallow
|
| 12 |
+
|
| 13 |
+
class TestSchema(marshmallow.Schema):
|
| 14 |
+
pass
|
| 15 |
+
|
| 16 |
+
# Create schema instances with unhashable attributes
|
| 17 |
+
schema1 = TestSchema()
|
| 18 |
+
schema1.some_list = [1, 2, 3]
|
| 19 |
+
|
| 20 |
+
schema2 = TestSchema()
|
| 21 |
+
schema2.some_list = [1, 2, 3]
|
| 22 |
+
|
| 23 |
+
# These should produce the same key but don't
|
| 24 |
+
key1 = make_schema_key(schema1)
|
| 25 |
+
key2 = make_schema_key(schema2)
|
| 26 |
+
|
| 27 |
+
print(f"Key 1: {key1}")
|
| 28 |
+
print(f"Key 2: {key2}")
|
| 29 |
+
print(f"Keys equal: {key1 == key2}")
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
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.
|
| 33 |
+
|
| 34 |
+
This affects schema caching and component registration, potentially causing schemas that should be considered identical to be treated as different schemas.
|
| 35 |
+
|
| 36 |
+
## Environment
|
| 37 |
+
|
| 38 |
+
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.
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/metadata.json
ADDED
|
@@ -0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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"all_runtime_and_training_flags": false,
|
| 3 |
+
"official_profile": {
|
| 4 |
+
"eval_sets": [],
|
| 5 |
+
"profile_class": "Apispec8b421526",
|
| 6 |
+
"profile_lines": [
|
| 7 |
+
127,
|
| 8 |
+
131
|
| 9 |
+
],
|
| 10 |
+
"profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f",
|
| 11 |
+
"profile_source_path": "swesmith/profiles/python.py",
|
| 12 |
+
"profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286",
|
| 13 |
+
"upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 14 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 15 |
+
},
|
| 16 |
+
"source_healthy_reference_proof": {
|
| 17 |
+
"FAIL_TO_PASS": [
|
| 18 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]",
|
| 19 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]",
|
| 20 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]",
|
| 21 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]",
|
| 22 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]",
|
| 23 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]",
|
| 24 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]",
|
| 25 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]",
|
| 26 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]",
|
| 27 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]",
|
| 28 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]",
|
| 29 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]",
|
| 30 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]",
|
| 31 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]",
|
| 32 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]",
|
| 33 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]",
|
| 34 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver",
|
| 35 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]",
|
| 36 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]",
|
| 37 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none",
|
| 38 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]",
|
| 39 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]",
|
| 40 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]",
|
| 41 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]",
|
| 42 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]",
|
| 43 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]",
|
| 44 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]",
|
| 45 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]",
|
| 46 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]",
|
| 47 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]",
|
| 48 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]",
|
| 49 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]",
|
| 50 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]",
|
| 51 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]",
|
| 52 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]",
|
| 53 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]",
|
| 54 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]",
|
| 55 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]",
|
| 56 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]",
|
| 57 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]",
|
| 58 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]",
|
| 59 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]",
|
| 60 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]",
|
| 61 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]",
|
| 62 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]",
|
| 63 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 64 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]",
|
| 65 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]",
|
| 66 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]",
|
| 67 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 68 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]",
|
| 69 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]",
|
| 70 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]",
|
| 71 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]",
|
| 72 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]",
|
| 73 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]",
|
| 74 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2",
|
| 75 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 76 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]",
|
| 77 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]",
|
| 78 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]",
|
| 79 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]",
|
| 80 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]",
|
| 81 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]",
|
| 82 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]",
|
| 83 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]",
|
| 84 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]",
|
| 85 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]",
|
| 86 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]",
|
| 87 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]",
|
| 88 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 89 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]",
|
| 90 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 91 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 92 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]",
|
| 93 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 94 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 95 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]",
|
| 96 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]",
|
| 97 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]",
|
| 98 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]",
|
| 99 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]",
|
| 100 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]",
|
| 101 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]",
|
| 102 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]",
|
| 103 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]",
|
| 104 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]",
|
| 105 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]",
|
| 106 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]",
|
| 107 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]",
|
| 108 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]",
|
| 109 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]",
|
| 110 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]",
|
| 111 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]",
|
| 112 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]",
|
| 113 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]",
|
| 114 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]",
|
| 115 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]",
|
| 116 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]",
|
| 117 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]",
|
| 118 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]",
|
| 119 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]",
|
| 120 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]",
|
| 121 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]",
|
| 122 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]",
|
| 123 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]",
|
| 124 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]",
|
| 125 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]",
|
| 126 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]",
|
| 127 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]",
|
| 128 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]",
|
| 129 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]",
|
| 130 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]",
|
| 131 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]",
|
| 132 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]",
|
| 133 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]",
|
| 134 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]",
|
| 135 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]",
|
| 136 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]",
|
| 137 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]",
|
| 138 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]",
|
| 139 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]",
|
| 140 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]",
|
| 141 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]",
|
| 142 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]",
|
| 143 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]",
|
| 144 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]",
|
| 145 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]",
|
| 146 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]",
|
| 147 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]",
|
| 148 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]",
|
| 149 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]",
|
| 150 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]",
|
| 151 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]",
|
| 152 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]",
|
| 153 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]",
|
| 154 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]",
|
| 155 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]",
|
| 156 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]",
|
| 157 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]",
|
| 158 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]",
|
| 159 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]",
|
| 160 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]",
|
| 161 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]",
|
| 162 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]",
|
| 163 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]",
|
| 164 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]",
|
| 165 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]",
|
| 166 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]",
|
| 167 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]",
|
| 168 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]",
|
| 169 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2",
|
| 170 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3",
|
| 171 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]",
|
| 172 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]",
|
| 173 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]",
|
| 174 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]",
|
| 175 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]",
|
| 176 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]",
|
| 177 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]",
|
| 178 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]",
|
| 179 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]",
|
| 180 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]",
|
| 181 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]",
|
| 182 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]",
|
| 183 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]",
|
| 184 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]",
|
| 185 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]",
|
| 186 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]",
|
| 187 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]",
|
| 188 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]",
|
| 189 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]",
|
| 190 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]"
|
| 191 |
+
],
|
| 192 |
+
"PASS_TO_PASS": [
|
| 193 |
+
"tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version",
|
| 194 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]",
|
| 195 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]",
|
| 196 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]",
|
| 197 |
+
"tests/test_core.py::TestTags::test_tag[2.0]",
|
| 198 |
+
"tests/test_core.py::TestTags::test_tag[3.0.0]",
|
| 199 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[2.0]",
|
| 200 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]",
|
| 201 |
+
"tests/test_core.py::TestComponents::test_schema[2.0]",
|
| 202 |
+
"tests/test_core.py::TestComponents::test_schema[3.0.0]",
|
| 203 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]",
|
| 204 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]",
|
| 205 |
+
"tests/test_core.py::TestComponents::test_schema_description[2.0]",
|
| 206 |
+
"tests/test_core.py::TestComponents::test_schema_description[3.0.0]",
|
| 207 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]",
|
| 208 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]",
|
| 209 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[2.0]",
|
| 210 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]",
|
| 211 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]",
|
| 212 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]",
|
| 213 |
+
"tests/test_core.py::TestComponents::test_response[2.0]",
|
| 214 |
+
"tests/test_core.py::TestComponents::test_response[3.0.0]",
|
| 215 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[2.0]",
|
| 216 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]",
|
| 217 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]",
|
| 218 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]",
|
| 219 |
+
"tests/test_core.py::TestComponents::test_parameter[2.0]",
|
| 220 |
+
"tests/test_core.py::TestComponents::test_parameter[3.0.0]",
|
| 221 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]",
|
| 222 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]",
|
| 223 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]",
|
| 224 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]",
|
| 225 |
+
"tests/test_core.py::TestComponents::test_header[3.0.0]",
|
| 226 |
+
"tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]",
|
| 227 |
+
"tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]",
|
| 228 |
+
"tests/test_core.py::TestComponents::test_example[3.0.0]",
|
| 229 |
+
"tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]",
|
| 230 |
+
"tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]",
|
| 231 |
+
"tests/test_core.py::TestComponents::test_security_scheme[2.0]",
|
| 232 |
+
"tests/test_core.py::TestComponents::test_security_scheme[3.0.0]",
|
| 233 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]",
|
| 234 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]",
|
| 235 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]",
|
| 236 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]",
|
| 237 |
+
"tests/test_core.py::TestComponents::test_to_yaml[2.0]",
|
| 238 |
+
"tests/test_core.py::TestComponents::test_to_yaml[3.0.0]",
|
| 239 |
+
"tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec",
|
| 240 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]",
|
| 241 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]",
|
| 242 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]",
|
| 243 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]",
|
| 244 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]",
|
| 245 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]",
|
| 246 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]",
|
| 247 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]",
|
| 248 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]",
|
| 249 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]",
|
| 250 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]",
|
| 251 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]",
|
| 252 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]",
|
| 253 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]",
|
| 254 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]",
|
| 255 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]",
|
| 256 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]",
|
| 257 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]",
|
| 258 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]",
|
| 259 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]",
|
| 260 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[2.0]",
|
| 261 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]",
|
| 262 |
+
"tests/test_core.py::TestComponents::test_response_lazy[2.0]",
|
| 263 |
+
"tests/test_core.py::TestComponents::test_response_lazy[3.0.0]",
|
| 264 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[2.0]",
|
| 265 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]",
|
| 266 |
+
"tests/test_core.py::TestComponents::test_header_lazy[3.0.0]",
|
| 267 |
+
"tests/test_core.py::TestComponents::test_example_lazy[3.0.0]",
|
| 268 |
+
"tests/test_core.py::TestPath::test_path[2.0]",
|
| 269 |
+
"tests/test_core.py::TestPath::test_path[3.0.0]",
|
| 270 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[2.0]",
|
| 271 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]",
|
| 272 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[2.0]",
|
| 273 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]",
|
| 274 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]",
|
| 275 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]",
|
| 276 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[2.0]",
|
| 277 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]",
|
| 278 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]",
|
| 279 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]",
|
| 280 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]",
|
| 281 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]",
|
| 282 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]",
|
| 283 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]",
|
| 284 |
+
"tests/test_core.py::TestPath::test_path_summary_description[2.0]",
|
| 285 |
+
"tests/test_core.py::TestPath::test_path_summary_description[3.0.0]",
|
| 286 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]",
|
| 287 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]",
|
| 288 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]",
|
| 289 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]",
|
| 290 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]",
|
| 291 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]",
|
| 292 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[2.0]",
|
| 293 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]",
|
| 294 |
+
"tests/test_core.py::TestPath::test_global_parameters[2.0]",
|
| 295 |
+
"tests/test_core.py::TestPath::test_global_parameters[3.0.0]",
|
| 296 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]",
|
| 297 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]",
|
| 298 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[2.0]",
|
| 299 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]",
|
| 300 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]",
|
| 301 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]",
|
| 302 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]",
|
| 303 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]",
|
| 304 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]",
|
| 305 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]",
|
| 306 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]",
|
| 307 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]",
|
| 308 |
+
"tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]",
|
| 309 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]",
|
| 310 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]",
|
| 311 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]",
|
| 312 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]",
|
| 313 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]",
|
| 314 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]",
|
| 315 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]",
|
| 316 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]",
|
| 317 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]",
|
| 318 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]",
|
| 319 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]",
|
| 320 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]",
|
| 321 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]",
|
| 322 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]",
|
| 323 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]",
|
| 324 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]",
|
| 325 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]",
|
| 326 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]",
|
| 327 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]",
|
| 328 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]",
|
| 329 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]",
|
| 330 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]",
|
| 331 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]",
|
| 332 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]",
|
| 333 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]",
|
| 334 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]",
|
| 335 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]",
|
| 336 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]",
|
| 337 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]",
|
| 338 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]",
|
| 339 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]",
|
| 340 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]",
|
| 341 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]",
|
| 342 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]",
|
| 343 |
+
"tests/test_core.py::TestPluginsOrder::test_plugins_order",
|
| 344 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]",
|
| 345 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]",
|
| 346 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]",
|
| 347 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]",
|
| 348 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]",
|
| 349 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed",
|
| 350 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal",
|
| 351 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal",
|
| 352 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal",
|
| 353 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]",
|
| 354 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]",
|
| 355 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]",
|
| 356 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]",
|
| 357 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields",
|
| 358 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]",
|
| 359 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]",
|
| 360 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]",
|
| 361 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]",
|
| 362 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]",
|
| 363 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]",
|
| 364 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]",
|
| 365 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]",
|
| 366 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]",
|
| 367 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]",
|
| 368 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]",
|
| 369 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]",
|
| 370 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]",
|
| 371 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]",
|
| 372 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]",
|
| 373 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]",
|
| 374 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]",
|
| 375 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]",
|
| 376 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]",
|
| 377 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]",
|
| 378 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]",
|
| 379 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]",
|
| 380 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]",
|
| 381 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]",
|
| 382 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]",
|
| 383 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]",
|
| 384 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]",
|
| 385 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]",
|
| 386 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]",
|
| 387 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]",
|
| 388 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]",
|
| 389 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]",
|
| 390 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]",
|
| 391 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]",
|
| 392 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]",
|
| 393 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]",
|
| 394 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]",
|
| 395 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]",
|
| 396 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]",
|
| 397 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]",
|
| 398 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]",
|
| 399 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]",
|
| 400 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]",
|
| 401 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]",
|
| 402 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]",
|
| 403 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]",
|
| 404 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]",
|
| 405 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]",
|
| 406 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]",
|
| 407 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]",
|
| 408 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]",
|
| 409 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]",
|
| 410 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]",
|
| 411 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]",
|
| 412 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]",
|
| 413 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]",
|
| 414 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]",
|
| 415 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]",
|
| 416 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]",
|
| 417 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]",
|
| 418 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]",
|
| 419 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]",
|
| 420 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]",
|
| 421 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]",
|
| 422 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]",
|
| 423 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]",
|
| 424 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]",
|
| 425 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]",
|
| 426 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]",
|
| 427 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]",
|
| 428 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]",
|
| 429 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]",
|
| 430 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]",
|
| 431 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]",
|
| 432 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]",
|
| 433 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]",
|
| 434 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]",
|
| 435 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]",
|
| 436 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]",
|
| 437 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]",
|
| 438 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]",
|
| 439 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]",
|
| 440 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]",
|
| 441 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]",
|
| 442 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]",
|
| 443 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]",
|
| 444 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]",
|
| 445 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]",
|
| 446 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]",
|
| 447 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]",
|
| 448 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]",
|
| 449 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]",
|
| 450 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]",
|
| 451 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]",
|
| 452 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]",
|
| 453 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]",
|
| 454 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]",
|
| 455 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]",
|
| 456 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]",
|
| 457 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]",
|
| 458 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]",
|
| 459 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]",
|
| 460 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]",
|
| 461 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]",
|
| 462 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]",
|
| 463 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]",
|
| 464 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]",
|
| 465 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]",
|
| 466 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]",
|
| 467 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]",
|
| 468 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]",
|
| 469 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]",
|
| 470 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]",
|
| 471 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]",
|
| 472 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]",
|
| 473 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]",
|
| 474 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]",
|
| 475 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]",
|
| 476 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]",
|
| 477 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]",
|
| 478 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]",
|
| 479 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]",
|
| 480 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]",
|
| 481 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]",
|
| 482 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]",
|
| 483 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]",
|
| 484 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]",
|
| 485 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]",
|
| 486 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]",
|
| 487 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]",
|
| 488 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]",
|
| 489 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]",
|
| 490 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]",
|
| 491 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]",
|
| 492 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]",
|
| 493 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]",
|
| 494 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]",
|
| 495 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]",
|
| 496 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]",
|
| 497 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]",
|
| 498 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]",
|
| 499 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]",
|
| 500 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]",
|
| 501 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]",
|
| 502 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]",
|
| 503 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]",
|
| 504 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]",
|
| 505 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]",
|
| 506 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]",
|
| 507 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]",
|
| 508 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]",
|
| 509 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]",
|
| 510 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]",
|
| 511 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]",
|
| 512 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]",
|
| 513 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]",
|
| 514 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]",
|
| 515 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]",
|
| 516 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]",
|
| 517 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]",
|
| 518 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]",
|
| 519 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]",
|
| 520 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]",
|
| 521 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]",
|
| 522 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]",
|
| 523 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]",
|
| 524 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]",
|
| 525 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]",
|
| 526 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]",
|
| 527 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]",
|
| 528 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]",
|
| 529 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]",
|
| 530 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]",
|
| 531 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]",
|
| 532 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]",
|
| 533 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]",
|
| 534 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]",
|
| 535 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]",
|
| 536 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]",
|
| 537 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]",
|
| 538 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]",
|
| 539 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]",
|
| 540 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]",
|
| 541 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]",
|
| 542 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]",
|
| 543 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]",
|
| 544 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]",
|
| 545 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]",
|
| 546 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]",
|
| 547 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]",
|
| 548 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]",
|
| 549 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]",
|
| 550 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]",
|
| 551 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]",
|
| 552 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]",
|
| 553 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]",
|
| 554 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]",
|
| 555 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]",
|
| 556 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]",
|
| 557 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]",
|
| 558 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]",
|
| 559 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]",
|
| 560 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]",
|
| 561 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]",
|
| 562 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]",
|
| 563 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]",
|
| 564 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]",
|
| 565 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]",
|
| 566 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]",
|
| 567 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types",
|
| 568 |
+
"tests/test_utils.py::test_build_reference",
|
| 569 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring",
|
| 570 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]",
|
| 571 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]",
|
| 572 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]",
|
| 573 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]",
|
| 574 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]",
|
| 575 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]",
|
| 576 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_unicode",
|
| 577 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default",
|
| 578 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs"
|
| 579 |
+
],
|
| 580 |
+
"all_git_blobs_modes_verified": true,
|
| 581 |
+
"cloud_launch_ready": false,
|
| 582 |
+
"commits": {
|
| 583 |
+
"bug": "2e76199a4675c36551a60af74281a718099c0598",
|
| 584 |
+
"healthy": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 585 |
+
"learner": "fba1562227e51ef44176e0af5866b30084e89e34"
|
| 586 |
+
},
|
| 587 |
+
"existing_squirrel_snapshot_reused": false,
|
| 588 |
+
"full_transfer_allowlist": [
|
| 589 |
+
"/testbed/.github/FUNDING.yml",
|
| 590 |
+
"/testbed/.github/dependabot.yml",
|
| 591 |
+
"/testbed/.gitignore",
|
| 592 |
+
"/testbed/.pre-commit-config.yaml",
|
| 593 |
+
"/testbed/AUTHORS.rst",
|
| 594 |
+
"/testbed/CHANGELOG.rst",
|
| 595 |
+
"/testbed/CONTRIBUTING.rst",
|
| 596 |
+
"/testbed/LICENSE",
|
| 597 |
+
"/testbed/README.rst",
|
| 598 |
+
"/testbed/RELEASING.md",
|
| 599 |
+
"/testbed/SECURITY.md",
|
| 600 |
+
"/testbed/docs/Makefile",
|
| 601 |
+
"/testbed/docs/api_core.rst",
|
| 602 |
+
"/testbed/docs/api_ext.rst",
|
| 603 |
+
"/testbed/docs/authors.rst",
|
| 604 |
+
"/testbed/docs/changelog.rst",
|
| 605 |
+
"/testbed/docs/conf.py",
|
| 606 |
+
"/testbed/docs/contributing.rst",
|
| 607 |
+
"/testbed/docs/ecosystem.rst",
|
| 608 |
+
"/testbed/docs/index.rst",
|
| 609 |
+
"/testbed/docs/install.rst",
|
| 610 |
+
"/testbed/docs/license.rst",
|
| 611 |
+
"/testbed/docs/make.bat",
|
| 612 |
+
"/testbed/docs/quickstart.rst",
|
| 613 |
+
"/testbed/docs/special_topics.rst",
|
| 614 |
+
"/testbed/docs/upgrading.rst",
|
| 615 |
+
"/testbed/docs/using_plugins.rst",
|
| 616 |
+
"/testbed/docs/writing_plugins.rst",
|
| 617 |
+
"/testbed/pyproject.toml",
|
| 618 |
+
"/testbed/readthedocs.yml",
|
| 619 |
+
"/testbed/src/apispec/__init__.py",
|
| 620 |
+
"/testbed/src/apispec/core.py",
|
| 621 |
+
"/testbed/src/apispec/exceptions.py",
|
| 622 |
+
"/testbed/src/apispec/ext/__init__.py",
|
| 623 |
+
"/testbed/src/apispec/ext/marshmallow/__init__.py",
|
| 624 |
+
"/testbed/src/apispec/ext/marshmallow/common.py",
|
| 625 |
+
"/testbed/src/apispec/ext/marshmallow/field_converter.py",
|
| 626 |
+
"/testbed/src/apispec/ext/marshmallow/openapi.py",
|
| 627 |
+
"/testbed/src/apispec/ext/marshmallow/schema_resolver.py",
|
| 628 |
+
"/testbed/src/apispec/plugin.py",
|
| 629 |
+
"/testbed/src/apispec/py.typed",
|
| 630 |
+
"/testbed/src/apispec/utils.py",
|
| 631 |
+
"/testbed/src/apispec/yaml_utils.py",
|
| 632 |
+
"/testbed/tests/__init__.py",
|
| 633 |
+
"/testbed/tests/conftest.py",
|
| 634 |
+
"/testbed/tests/schemas.py",
|
| 635 |
+
"/testbed/tests/test_core.py",
|
| 636 |
+
"/testbed/tests/test_utils.py",
|
| 637 |
+
"/testbed/tests/test_yaml_utils.py",
|
| 638 |
+
"/testbed/tests/utils.py",
|
| 639 |
+
"/testbed/tox.ini"
|
| 640 |
+
],
|
| 641 |
+
"healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed",
|
| 642 |
+
"mutation_matches_dataset_and_git_blobs": true,
|
| 643 |
+
"official_profile": {
|
| 644 |
+
"eval_sets": [],
|
| 645 |
+
"profile_class": "Apispec8b421526",
|
| 646 |
+
"profile_lines": [
|
| 647 |
+
127,
|
| 648 |
+
131
|
| 649 |
+
],
|
| 650 |
+
"profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f",
|
| 651 |
+
"profile_source_path": "swesmith/profiles/python.py",
|
| 652 |
+
"profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286",
|
| 653 |
+
"upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 654 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 655 |
+
},
|
| 656 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 657 |
+
"private_test_paths": [
|
| 658 |
+
"tests/test_ext_marshmallow.py",
|
| 659 |
+
"tests/test_ext_marshmallow_common.py",
|
| 660 |
+
"tests/test_ext_marshmallow_field.py",
|
| 661 |
+
"tests/test_ext_marshmallow_openapi.py"
|
| 662 |
+
],
|
| 663 |
+
"private_tests_unchanged": true,
|
| 664 |
+
"profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference",
|
| 665 |
+
"qwen_calibrated": false,
|
| 666 |
+
"runtime_qualified": false,
|
| 667 |
+
"source_paths": [
|
| 668 |
+
"src/apispec/ext/marshmallow/common.py"
|
| 669 |
+
],
|
| 670 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 671 |
+
"source_stages_bytes": 1020883,
|
| 672 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 673 |
+
"transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter",
|
| 674 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 675 |
+
},
|
| 676 |
+
"source_record": {
|
| 677 |
+
"anti_training_canary": false,
|
| 678 |
+
"anti_training_reviewed": true,
|
| 679 |
+
"candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 680 |
+
"cloud_launch_ready": false,
|
| 681 |
+
"eligibility": {
|
| 682 |
+
"reasons": [],
|
| 683 |
+
"semantic_nonoverlap_established": false,
|
| 684 |
+
"status": "eligible_for_controls",
|
| 685 |
+
"training_admissible": false,
|
| 686 |
+
"warnings": []
|
| 687 |
+
},
|
| 688 |
+
"healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 689 |
+
"instruction_sha256": "b99d93e7d1ff633d09d46c2987f628b9957c2d97ac0aaf0f29923c7c795bf73a",
|
| 690 |
+
"is_fork": true,
|
| 691 |
+
"learner_path": "tasks/8c897387852803297e721ad7/learner",
|
| 692 |
+
"license_evidence": {
|
| 693 |
+
"source_code": {
|
| 694 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 695 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 696 |
+
"reviewed": true,
|
| 697 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 698 |
+
"spdx": "MIT",
|
| 699 |
+
"training_allowed": true,
|
| 700 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE"
|
| 701 |
+
},
|
| 702 |
+
"task_bundle": {
|
| 703 |
+
"reviewed": true,
|
| 704 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 705 |
+
"spdx": "MIT",
|
| 706 |
+
"training_allowed": true,
|
| 707 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 708 |
+
}
|
| 709 |
+
},
|
| 710 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 711 |
+
"patch_sha256": "9dccf3389c791cc31b743bcef019e52d81149a6224ee9201699f6ea2855e64da",
|
| 712 |
+
"provenance_path": "tasks/8c897387852803297e721ad7/source-proof.json",
|
| 713 |
+
"repository_lineage": [
|
| 714 |
+
"swesmith/marshmallow-code__apispec.8b421526",
|
| 715 |
+
"marshmallow-code/apispec"
|
| 716 |
+
],
|
| 717 |
+
"rfc008_complete": false,
|
| 718 |
+
"runtime_qualified": false,
|
| 719 |
+
"semantic_nonoverlap_established": false,
|
| 720 |
+
"source_commit": "fba1562227e51ef44176e0af5866b30084e89e34",
|
| 721 |
+
"source_dataset": "SWE-bench/SWE-smith-py",
|
| 722 |
+
"source_head_commit": "2e76199a4675c36551a60af74281a718099c0598",
|
| 723 |
+
"source_kind": "mutation",
|
| 724 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 725 |
+
"source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e",
|
| 726 |
+
"source_split": "train",
|
| 727 |
+
"target_model_calibrated": false,
|
| 728 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 729 |
+
"task_sha256": "0f66703367994d529603408f2239290015020c9799d54c597935b6458c5e4a38",
|
| 730 |
+
"training_admissible": false,
|
| 731 |
+
"upstream_identity_reviewed": true,
|
| 732 |
+
"upstream_repo": "marshmallow-code/apispec",
|
| 733 |
+
"usage": "quarantine_only"
|
| 734 |
+
},
|
| 735 |
+
"task_kind": "original-source-mutation"
|
| 736 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provenance.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"generated_reference": false,
|
| 3 |
+
"healthy_reference_delta_sha256": "de2a4ba1cd39cdd977548d94da03112df3c316b9e2ebce0115e104f82eeff17d",
|
| 4 |
+
"native_pytest_ids_preserved": true,
|
| 5 |
+
"original_source_code_license": {
|
| 6 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 7 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 8 |
+
"reviewed": true,
|
| 9 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 10 |
+
"spdx": "MIT",
|
| 11 |
+
"training_allowed": true,
|
| 12 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE"
|
| 13 |
+
},
|
| 14 |
+
"provided_reference": true,
|
| 15 |
+
"qwen_calibrated": false,
|
| 16 |
+
"runtime_qualified": false,
|
| 17 |
+
"source_completion_sha256": "c4f70a6d59c4b6677e4f99f817db164d5e9ba3812b205ded396d485c95fa756a",
|
| 18 |
+
"source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876",
|
| 19 |
+
"source_proof_sha256": "b61faa8c3c2eb9eeb38d0e19ed494a3a219fb65ca5052bb75fd4495ccc303baf",
|
| 20 |
+
"source_record": {
|
| 21 |
+
"anti_training_canary": false,
|
| 22 |
+
"anti_training_reviewed": true,
|
| 23 |
+
"candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 24 |
+
"cloud_launch_ready": false,
|
| 25 |
+
"eligibility": {
|
| 26 |
+
"reasons": [],
|
| 27 |
+
"semantic_nonoverlap_established": false,
|
| 28 |
+
"status": "eligible_for_controls",
|
| 29 |
+
"training_admissible": false,
|
| 30 |
+
"warnings": []
|
| 31 |
+
},
|
| 32 |
+
"healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 33 |
+
"instruction_sha256": "b99d93e7d1ff633d09d46c2987f628b9957c2d97ac0aaf0f29923c7c795bf73a",
|
| 34 |
+
"is_fork": true,
|
| 35 |
+
"learner_path": "tasks/8c897387852803297e721ad7/learner",
|
| 36 |
+
"license_evidence": {
|
| 37 |
+
"source_code": {
|
| 38 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 39 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 40 |
+
"reviewed": true,
|
| 41 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 42 |
+
"spdx": "MIT",
|
| 43 |
+
"training_allowed": true,
|
| 44 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/fba1562227e51ef44176e0af5866b30084e89e34/LICENSE"
|
| 45 |
+
},
|
| 46 |
+
"task_bundle": {
|
| 47 |
+
"reviewed": true,
|
| 48 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 49 |
+
"spdx": "MIT",
|
| 50 |
+
"training_allowed": true,
|
| 51 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 55 |
+
"patch_sha256": "9dccf3389c791cc31b743bcef019e52d81149a6224ee9201699f6ea2855e64da",
|
| 56 |
+
"provenance_path": "tasks/8c897387852803297e721ad7/source-proof.json",
|
| 57 |
+
"repository_lineage": [
|
| 58 |
+
"swesmith/marshmallow-code__apispec.8b421526",
|
| 59 |
+
"marshmallow-code/apispec"
|
| 60 |
+
],
|
| 61 |
+
"rfc008_complete": false,
|
| 62 |
+
"runtime_qualified": false,
|
| 63 |
+
"semantic_nonoverlap_established": false,
|
| 64 |
+
"source_commit": "fba1562227e51ef44176e0af5866b30084e89e34",
|
| 65 |
+
"source_dataset": "SWE-bench/SWE-smith-py",
|
| 66 |
+
"source_head_commit": "2e76199a4675c36551a60af74281a718099c0598",
|
| 67 |
+
"source_kind": "mutation",
|
| 68 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 69 |
+
"source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e",
|
| 70 |
+
"source_split": "train",
|
| 71 |
+
"target_model_calibrated": false,
|
| 72 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__sw95y0ye",
|
| 73 |
+
"task_sha256": "0f66703367994d529603408f2239290015020c9799d54c597935b6458c5e4a38",
|
| 74 |
+
"training_admissible": false,
|
| 75 |
+
"upstream_identity_reviewed": true,
|
| 76 |
+
"upstream_repo": "marshmallow-code/apispec",
|
| 77 |
+
"usage": "quarantine_only"
|
| 78 |
+
},
|
| 79 |
+
"task_bundle_license": {
|
| 80 |
+
"reviewed": true,
|
| 81 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 82 |
+
"spdx": "MIT",
|
| 83 |
+
"training_allowed": true,
|
| 84 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 85 |
+
},
|
| 86 |
+
"training_admissible": false,
|
| 87 |
+
"trusted_tests_sha256": "800ba7da08ca9ff402906f2c3f0f85c4f500c385020e3e6b6d0a029e65c0654e"
|
| 88 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/provided-gold.diff
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/src/apispec/ext/marshmallow/common.py b/src/apispec/ext/marshmallow/common.py
|
| 2 |
+
index 874cc4c4c63773177ad06bd0d75fdf851eaadec4..e5373771ab017e6b7dc138515139ab992c19cfe0 100644
|
| 3 |
+
--- a/src/apispec/ext/marshmallow/common.py
|
| 4 |
+
+++ b/src/apispec/ext/marshmallow/common.py
|
| 5 |
+
@@ -119,14 +119,14 @@
|
| 6 |
+
hash(attribute)
|
| 7 |
+
except TypeError:
|
| 8 |
+
# Unhashable iterable (list, set)
|
| 9 |
+
- attribute = list(attribute) # Change from frozenset to list
|
| 10 |
+
- modifiers.insert(0, attribute) # Change from append to insert at position 0
|
| 11 |
+
- return tuple([schema.__class__, *reversed(modifiers)]) # Reverse the modifiers to their original order
|
| 12 |
+
+ attribute = frozenset(attribute)
|
| 13 |
+
+ modifiers.append(attribute)
|
| 14 |
+
+ return tuple([schema.__class__, *modifiers])
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def get_unique_schema_name(components: Components, name: str, counter: int = 0) -> str:
|
| 18 |
+
"""Function to generate a unique name based on the provided name and names
|
| 19 |
+
- already in the spec. Will append a number to the name to make it unique if
|
| 20 |
+
+ already in the spec. Will append a number to the name to make it unique if
|
| 21 |
+
the name is already in the spec.
|
| 22 |
+
|
| 23 |
+
:param Components components: instance of the components of the spec
|
| 24 |
+
@@ -134,7 +134,7 @@
|
| 25 |
+
:param int counter: the counter of the number of recursions
|
| 26 |
+
:return: the unique name
|
| 27 |
+
"""
|
| 28 |
+
- if name not in components.schemas and counter > 0:
|
| 29 |
+
+ if name not in components.schemas:
|
| 30 |
+
return name
|
| 31 |
+
if not counter: # first time through recursion
|
| 32 |
+
warnings.warn(
|
| 33 |
+
@@ -145,6 +145,6 @@
|
| 34 |
+
stacklevel=2,
|
| 35 |
+
)
|
| 36 |
+
else: # subsequent recursions
|
| 37 |
+
- name = name[:-len(str(counter)) - 1]
|
| 38 |
+
- counter -= 1
|
| 39 |
+
+ name = name[: -len(str(counter))]
|
| 40 |
+
+ counter += 1
|
| 41 |
+
return get_unique_schema_name(components, name + str(counter), counter)
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/solution/solve.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
cd /testbed/repo
|
| 4 |
+
cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE'
|
| 5 |
+
diff --git a/src/apispec/ext/marshmallow/common.py b/src/apispec/ext/marshmallow/common.py
|
| 6 |
+
index 874cc4c4c63773177ad06bd0d75fdf851eaadec4..e5373771ab017e6b7dc138515139ab992c19cfe0 100644
|
| 7 |
+
--- a/src/apispec/ext/marshmallow/common.py
|
| 8 |
+
+++ b/src/apispec/ext/marshmallow/common.py
|
| 9 |
+
@@ -119,14 +119,14 @@
|
| 10 |
+
hash(attribute)
|
| 11 |
+
except TypeError:
|
| 12 |
+
# Unhashable iterable (list, set)
|
| 13 |
+
- attribute = list(attribute) # Change from frozenset to list
|
| 14 |
+
- modifiers.insert(0, attribute) # Change from append to insert at position 0
|
| 15 |
+
- return tuple([schema.__class__, *reversed(modifiers)]) # Reverse the modifiers to their original order
|
| 16 |
+
+ attribute = frozenset(attribute)
|
| 17 |
+
+ modifiers.append(attribute)
|
| 18 |
+
+ return tuple([schema.__class__, *modifiers])
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def get_unique_schema_name(components: Components, name: str, counter: int = 0) -> str:
|
| 22 |
+
"""Function to generate a unique name based on the provided name and names
|
| 23 |
+
- already in the spec. Will append a number to the name to make it unique if
|
| 24 |
+
+ already in the spec. Will append a number to the name to make it unique if
|
| 25 |
+
the name is already in the spec.
|
| 26 |
+
|
| 27 |
+
:param Components components: instance of the components of the spec
|
| 28 |
+
@@ -134,7 +134,7 @@
|
| 29 |
+
:param int counter: the counter of the number of recursions
|
| 30 |
+
:return: the unique name
|
| 31 |
+
"""
|
| 32 |
+
- if name not in components.schemas and counter > 0:
|
| 33 |
+
+ if name not in components.schemas:
|
| 34 |
+
return name
|
| 35 |
+
if not counter: # first time through recursion
|
| 36 |
+
warnings.warn(
|
| 37 |
+
@@ -145,6 +145,6 @@
|
| 38 |
+
stacklevel=2,
|
| 39 |
+
)
|
| 40 |
+
else: # subsequent recursions
|
| 41 |
+
- name = name[:-len(str(counter)) - 1]
|
| 42 |
+
- counter -= 1
|
| 43 |
+
+ name = name[: -len(str(counter))]
|
| 44 |
+
+ counter += 1
|
| 45 |
+
return get_unique_schema_name(components, name + str(counter), counter)
|
| 46 |
+
OPENENV_REFERENCE
|
| 47 |
+
/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/task.toml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version = "1.0"
|
| 2 |
+
|
| 3 |
+
[agent]
|
| 4 |
+
timeout_sec = 1800.0
|
| 5 |
+
|
| 6 |
+
[verifier]
|
| 7 |
+
timeout_sec = 900.0
|
| 8 |
+
|
| 9 |
+
[environment]
|
| 10 |
+
docker_image = "ghcr.io/younesbelkada/scale800@sha256:7964148413e9a3b3d4d831e52001cc91e4b4f88bec8f2c37affee6ee0a70d039"
|
| 11 |
+
build_timeout_sec = 600.0
|
| 12 |
+
cpus = 2
|
| 13 |
+
memory_mb = 8192
|
| 14 |
+
storage_mb = 16384
|
| 15 |
+
|
| 16 |
+
[metadata]
|
| 17 |
+
author_name = "SWE-smith source adapter"
|
| 18 |
+
category = "bugfix"
|
| 19 |
+
tags = ["swe", "python", "mutation-repair"]
|
| 20 |
+
|
| 21 |
+
[environment.env]
|
| 22 |
+
# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's
|
| 23 |
+
# non-interactive shells never run `conda activate`
|
| 24 |
+
PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/check_pytest.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Distinguish real pytest failures from missing/setup/verifier evidence."""
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import json
|
| 5 |
+
import re
|
| 6 |
+
import xml.etree.ElementTree as ET
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def matches(case, target):
|
| 11 |
+
parts = target.split("::")
|
| 12 |
+
module = parts[0].removesuffix(".py").replace("/", ".")
|
| 13 |
+
classname = case.get("classname", "")
|
| 14 |
+
name = case.get("name", "")
|
| 15 |
+
if not (classname == module or classname.startswith(module + ".")):
|
| 16 |
+
return False
|
| 17 |
+
selector = parts[-1] if len(parts) > 1 else ""
|
| 18 |
+
classes = parts[1:-1]
|
| 19 |
+
if classes and classname != module + "." + ".".join(classes):
|
| 20 |
+
return False
|
| 21 |
+
return (
|
| 22 |
+
not selector
|
| 23 |
+
or name == selector
|
| 24 |
+
or ("[" not in selector and name.startswith(selector + "["))
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def assess(root, expected, native_exit):
|
| 29 |
+
all_cases = []
|
| 30 |
+
actual_failure = False
|
| 31 |
+
for group in ("pass-to-pass", "fail-to-pass"):
|
| 32 |
+
path = Path(root) / (group + ".xml")
|
| 33 |
+
if not path.exists():
|
| 34 |
+
if actual_failure:
|
| 35 |
+
continue
|
| 36 |
+
raise ValueError("Missing preceding pytest panel")
|
| 37 |
+
if actual_failure:
|
| 38 |
+
raise ValueError(
|
| 39 |
+
"Pytest evidence continued after the native stop-on-failure"
|
| 40 |
+
)
|
| 41 |
+
raw = path.read_bytes()
|
| 42 |
+
if not 0 < len(raw) <= 4 * 1024**2 or re.search(
|
| 43 |
+
rb"<!\s*(?:DOCTYPE|ENTITY)", raw, re.I
|
| 44 |
+
):
|
| 45 |
+
raise ValueError("Unbounded or unsafe pytest XML")
|
| 46 |
+
tree = ET.fromstring(raw)
|
| 47 |
+
cases = list(tree.iter("testcase"))
|
| 48 |
+
if len(cases) > 20000:
|
| 49 |
+
raise ValueError("Too many pytest cases")
|
| 50 |
+
identities = [(c.get("classname"), c.get("name")) for c in cases]
|
| 51 |
+
if len(identities) != len(set(identities)):
|
| 52 |
+
raise ValueError("Duplicate pytest case evidence")
|
| 53 |
+
targets = expected[group]
|
| 54 |
+
if any(not any(matches(case, t) for t in targets) for case in cases):
|
| 55 |
+
raise ValueError("Unexpected pytest case")
|
| 56 |
+
all_cases.extend(cases)
|
| 57 |
+
failures = [c for c in cases if c.find("failure") is not None]
|
| 58 |
+
if any(
|
| 59 |
+
c.find("error") is not None or c.find("skipped") is not None for c in cases
|
| 60 |
+
):
|
| 61 |
+
raise ValueError("Pytest collection/error/skip is not a completed panel")
|
| 62 |
+
actual_failure = actual_failure or bool(failures)
|
| 63 |
+
if not failures and any(
|
| 64 |
+
not any(matches(case, t) for case in cases) for t in targets
|
| 65 |
+
):
|
| 66 |
+
raise ValueError("Declared pytest target never ran")
|
| 67 |
+
if actual_failure:
|
| 68 |
+
if native_exit == 0:
|
| 69 |
+
raise ValueError("Native verifier exit disagrees with pytest failure")
|
| 70 |
+
return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)}
|
| 71 |
+
if native_exit != 0:
|
| 72 |
+
raise ValueError("Setup or native verifier failed without a real test failure")
|
| 73 |
+
for group in ("pass-to-pass", "fail-to-pass"):
|
| 74 |
+
if not (Path(root) / (group + ".xml")).is_file():
|
| 75 |
+
raise ValueError("Missing completed pytest panel")
|
| 76 |
+
return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)}
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
if __name__ == "__main__":
|
| 80 |
+
p = argparse.ArgumentParser()
|
| 81 |
+
p.add_argument("--root", required=True)
|
| 82 |
+
p.add_argument("--expected", required=True)
|
| 83 |
+
p.add_argument("--native-exit", type=int, required=True)
|
| 84 |
+
a = p.parse_args()
|
| 85 |
+
result = assess(a.root, json.loads(Path(a.expected).read_text()), a.native_exit)
|
| 86 |
+
reward = Path(a.root) / "reward.txt"
|
| 87 |
+
if reward.read_text().strip() != str(result["reward"]):
|
| 88 |
+
raise ValueError("Native raw reward disagrees with pytest evidence")
|
| 89 |
+
(Path(a.root) / "pytest-evidence.json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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fail-to-pass": [
|
| 3 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]",
|
| 4 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]",
|
| 5 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]",
|
| 6 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]",
|
| 7 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]",
|
| 8 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]",
|
| 9 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]",
|
| 10 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]",
|
| 11 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]",
|
| 12 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]",
|
| 13 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]",
|
| 14 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]",
|
| 15 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]",
|
| 16 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]",
|
| 17 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]",
|
| 18 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]",
|
| 19 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver",
|
| 20 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]",
|
| 21 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]",
|
| 22 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none",
|
| 23 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]",
|
| 24 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]",
|
| 25 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]",
|
| 26 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]",
|
| 27 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]",
|
| 28 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]",
|
| 29 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]",
|
| 30 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]",
|
| 31 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]",
|
| 32 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]",
|
| 33 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]",
|
| 34 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]",
|
| 35 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]",
|
| 36 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]",
|
| 37 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]",
|
| 38 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]",
|
| 39 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]",
|
| 40 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]",
|
| 41 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]",
|
| 42 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]",
|
| 43 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]",
|
| 44 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]",
|
| 45 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]",
|
| 46 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]",
|
| 47 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]",
|
| 48 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 49 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]",
|
| 50 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]",
|
| 51 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]",
|
| 52 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 53 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]",
|
| 54 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]",
|
| 55 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]",
|
| 56 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]",
|
| 57 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]",
|
| 58 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]",
|
| 59 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2",
|
| 60 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 61 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]",
|
| 62 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]",
|
| 63 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]",
|
| 64 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]",
|
| 65 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]",
|
| 66 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]",
|
| 67 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]",
|
| 68 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]",
|
| 69 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]",
|
| 70 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]",
|
| 71 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]",
|
| 72 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]",
|
| 73 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 74 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]",
|
| 75 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 76 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 77 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]",
|
| 78 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 79 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 80 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]",
|
| 81 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]",
|
| 82 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]",
|
| 83 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]",
|
| 84 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]",
|
| 85 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]",
|
| 86 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]",
|
| 87 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]",
|
| 88 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]",
|
| 89 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]",
|
| 90 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]",
|
| 91 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]",
|
| 92 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]",
|
| 93 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]",
|
| 94 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]",
|
| 95 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]",
|
| 96 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]",
|
| 97 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]",
|
| 98 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]",
|
| 99 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]",
|
| 100 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]",
|
| 101 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]",
|
| 102 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]",
|
| 103 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]",
|
| 104 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]",
|
| 105 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]",
|
| 106 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]",
|
| 107 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]",
|
| 108 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]",
|
| 109 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]",
|
| 110 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]",
|
| 111 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]",
|
| 112 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]",
|
| 113 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]",
|
| 114 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]",
|
| 115 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]",
|
| 116 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]",
|
| 117 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]",
|
| 118 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]",
|
| 119 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]",
|
| 120 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]",
|
| 121 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]",
|
| 122 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]",
|
| 123 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]",
|
| 124 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]",
|
| 125 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]",
|
| 126 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]",
|
| 127 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]",
|
| 128 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]",
|
| 129 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]",
|
| 130 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]",
|
| 131 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]",
|
| 132 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]",
|
| 133 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]",
|
| 134 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]",
|
| 135 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]",
|
| 136 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]",
|
| 137 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]",
|
| 138 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]",
|
| 139 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]",
|
| 140 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]",
|
| 141 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]",
|
| 142 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]",
|
| 143 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]",
|
| 144 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]",
|
| 145 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]",
|
| 146 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]",
|
| 147 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]",
|
| 148 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]",
|
| 149 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]",
|
| 150 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]",
|
| 151 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]",
|
| 152 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]",
|
| 153 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]",
|
| 154 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2",
|
| 155 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3",
|
| 156 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]",
|
| 157 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]",
|
| 158 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]",
|
| 159 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]",
|
| 160 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]",
|
| 161 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]",
|
| 162 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]",
|
| 163 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]",
|
| 164 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]",
|
| 165 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]",
|
| 166 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]",
|
| 167 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]",
|
| 168 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]",
|
| 169 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]",
|
| 170 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]",
|
| 171 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]",
|
| 172 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]",
|
| 173 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]",
|
| 174 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]",
|
| 175 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]"
|
| 176 |
+
],
|
| 177 |
+
"pass-to-pass": [
|
| 178 |
+
"tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version",
|
| 179 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]",
|
| 180 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]",
|
| 181 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]",
|
| 182 |
+
"tests/test_core.py::TestTags::test_tag[2.0]",
|
| 183 |
+
"tests/test_core.py::TestTags::test_tag[3.0.0]",
|
| 184 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[2.0]",
|
| 185 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]",
|
| 186 |
+
"tests/test_core.py::TestComponents::test_schema[2.0]",
|
| 187 |
+
"tests/test_core.py::TestComponents::test_schema[3.0.0]",
|
| 188 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]",
|
| 189 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]",
|
| 190 |
+
"tests/test_core.py::TestComponents::test_schema_description[2.0]",
|
| 191 |
+
"tests/test_core.py::TestComponents::test_schema_description[3.0.0]",
|
| 192 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]",
|
| 193 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]",
|
| 194 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[2.0]",
|
| 195 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]",
|
| 196 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]",
|
| 197 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]",
|
| 198 |
+
"tests/test_core.py::TestComponents::test_response[2.0]",
|
| 199 |
+
"tests/test_core.py::TestComponents::test_response[3.0.0]",
|
| 200 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[2.0]",
|
| 201 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]",
|
| 202 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]",
|
| 203 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]",
|
| 204 |
+
"tests/test_core.py::TestComponents::test_parameter[2.0]",
|
| 205 |
+
"tests/test_core.py::TestComponents::test_parameter[3.0.0]",
|
| 206 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]",
|
| 207 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]",
|
| 208 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]",
|
| 209 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]",
|
| 210 |
+
"tests/test_core.py::TestComponents::test_header[3.0.0]",
|
| 211 |
+
"tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]",
|
| 212 |
+
"tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]",
|
| 213 |
+
"tests/test_core.py::TestComponents::test_example[3.0.0]",
|
| 214 |
+
"tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]",
|
| 215 |
+
"tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]",
|
| 216 |
+
"tests/test_core.py::TestComponents::test_security_scheme[2.0]",
|
| 217 |
+
"tests/test_core.py::TestComponents::test_security_scheme[3.0.0]",
|
| 218 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]",
|
| 219 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]",
|
| 220 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]",
|
| 221 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]",
|
| 222 |
+
"tests/test_core.py::TestComponents::test_to_yaml[2.0]",
|
| 223 |
+
"tests/test_core.py::TestComponents::test_to_yaml[3.0.0]",
|
| 224 |
+
"tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec",
|
| 225 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]",
|
| 226 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]",
|
| 227 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]",
|
| 228 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]",
|
| 229 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]",
|
| 230 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]",
|
| 231 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]",
|
| 232 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]",
|
| 233 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]",
|
| 234 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]",
|
| 235 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]",
|
| 236 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]",
|
| 237 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]",
|
| 238 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]",
|
| 239 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]",
|
| 240 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]",
|
| 241 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]",
|
| 242 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]",
|
| 243 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]",
|
| 244 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]",
|
| 245 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[2.0]",
|
| 246 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]",
|
| 247 |
+
"tests/test_core.py::TestComponents::test_response_lazy[2.0]",
|
| 248 |
+
"tests/test_core.py::TestComponents::test_response_lazy[3.0.0]",
|
| 249 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[2.0]",
|
| 250 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]",
|
| 251 |
+
"tests/test_core.py::TestComponents::test_header_lazy[3.0.0]",
|
| 252 |
+
"tests/test_core.py::TestComponents::test_example_lazy[3.0.0]",
|
| 253 |
+
"tests/test_core.py::TestPath::test_path[2.0]",
|
| 254 |
+
"tests/test_core.py::TestPath::test_path[3.0.0]",
|
| 255 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[2.0]",
|
| 256 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]",
|
| 257 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[2.0]",
|
| 258 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]",
|
| 259 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]",
|
| 260 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]",
|
| 261 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[2.0]",
|
| 262 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]",
|
| 263 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]",
|
| 264 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]",
|
| 265 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]",
|
| 266 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]",
|
| 267 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]",
|
| 268 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]",
|
| 269 |
+
"tests/test_core.py::TestPath::test_path_summary_description[2.0]",
|
| 270 |
+
"tests/test_core.py::TestPath::test_path_summary_description[3.0.0]",
|
| 271 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]",
|
| 272 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]",
|
| 273 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]",
|
| 274 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]",
|
| 275 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]",
|
| 276 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]",
|
| 277 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[2.0]",
|
| 278 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]",
|
| 279 |
+
"tests/test_core.py::TestPath::test_global_parameters[2.0]",
|
| 280 |
+
"tests/test_core.py::TestPath::test_global_parameters[3.0.0]",
|
| 281 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]",
|
| 282 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]",
|
| 283 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[2.0]",
|
| 284 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]",
|
| 285 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]",
|
| 286 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]",
|
| 287 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]",
|
| 288 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]",
|
| 289 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]",
|
| 290 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]",
|
| 291 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]",
|
| 292 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]",
|
| 293 |
+
"tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]",
|
| 294 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]",
|
| 295 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]",
|
| 296 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]",
|
| 297 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]",
|
| 298 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]",
|
| 299 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]",
|
| 300 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]",
|
| 301 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]",
|
| 302 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]",
|
| 303 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]",
|
| 304 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]",
|
| 305 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]",
|
| 306 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]",
|
| 307 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]",
|
| 308 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]",
|
| 309 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]",
|
| 310 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]",
|
| 311 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]",
|
| 312 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]",
|
| 313 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]",
|
| 314 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]",
|
| 315 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]",
|
| 316 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]",
|
| 317 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]",
|
| 318 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]",
|
| 319 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]",
|
| 320 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]",
|
| 321 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]",
|
| 322 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]",
|
| 323 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]",
|
| 324 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]",
|
| 325 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]",
|
| 326 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]",
|
| 327 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]",
|
| 328 |
+
"tests/test_core.py::TestPluginsOrder::test_plugins_order",
|
| 329 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]",
|
| 330 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]",
|
| 331 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]",
|
| 332 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]",
|
| 333 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]",
|
| 334 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed",
|
| 335 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal",
|
| 336 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal",
|
| 337 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal",
|
| 338 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]",
|
| 339 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]",
|
| 340 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]",
|
| 341 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]",
|
| 342 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields",
|
| 343 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]",
|
| 344 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]",
|
| 345 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]",
|
| 346 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]",
|
| 347 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]",
|
| 348 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]",
|
| 349 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]",
|
| 350 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]",
|
| 351 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]",
|
| 352 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]",
|
| 353 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]",
|
| 354 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]",
|
| 355 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]",
|
| 356 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]",
|
| 357 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]",
|
| 358 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]",
|
| 359 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]",
|
| 360 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]",
|
| 361 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]",
|
| 362 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]",
|
| 363 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]",
|
| 364 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]",
|
| 365 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]",
|
| 366 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]",
|
| 367 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]",
|
| 368 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]",
|
| 369 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]",
|
| 370 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]",
|
| 371 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]",
|
| 372 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]",
|
| 373 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]",
|
| 374 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]",
|
| 375 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]",
|
| 376 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]",
|
| 377 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]",
|
| 378 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]",
|
| 379 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]",
|
| 380 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]",
|
| 381 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]",
|
| 382 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]",
|
| 383 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]",
|
| 384 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]",
|
| 385 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]",
|
| 386 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]",
|
| 387 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]",
|
| 388 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]",
|
| 389 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]",
|
| 390 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]",
|
| 391 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]",
|
| 392 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]",
|
| 393 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]",
|
| 394 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]",
|
| 395 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]",
|
| 396 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]",
|
| 397 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]",
|
| 398 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]",
|
| 399 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]",
|
| 400 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]",
|
| 401 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]",
|
| 402 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]",
|
| 403 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]",
|
| 404 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]",
|
| 405 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]",
|
| 406 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]",
|
| 407 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]",
|
| 408 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]",
|
| 409 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]",
|
| 410 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]",
|
| 411 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]",
|
| 412 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]",
|
| 413 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]",
|
| 414 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]",
|
| 415 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]",
|
| 416 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]",
|
| 417 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]",
|
| 418 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]",
|
| 419 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]",
|
| 420 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]",
|
| 421 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]",
|
| 422 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]",
|
| 423 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]",
|
| 424 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]",
|
| 425 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]",
|
| 426 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]",
|
| 427 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]",
|
| 428 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]",
|
| 429 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]",
|
| 430 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]",
|
| 431 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]",
|
| 432 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]",
|
| 433 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]",
|
| 434 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]",
|
| 435 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]",
|
| 436 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]",
|
| 437 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]",
|
| 438 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]",
|
| 439 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]",
|
| 440 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]",
|
| 441 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]",
|
| 442 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]",
|
| 443 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]",
|
| 444 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]",
|
| 445 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]",
|
| 446 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]",
|
| 447 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]",
|
| 448 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]",
|
| 449 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]",
|
| 450 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]",
|
| 451 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]",
|
| 452 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]",
|
| 453 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]",
|
| 454 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]",
|
| 455 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]",
|
| 456 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]",
|
| 457 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]",
|
| 458 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]",
|
| 459 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]",
|
| 460 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]",
|
| 461 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]",
|
| 462 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]",
|
| 463 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]",
|
| 464 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]",
|
| 465 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]",
|
| 466 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]",
|
| 467 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]",
|
| 468 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]",
|
| 469 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]",
|
| 470 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]",
|
| 471 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]",
|
| 472 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]",
|
| 473 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]",
|
| 474 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]",
|
| 475 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]",
|
| 476 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]",
|
| 477 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]",
|
| 478 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]",
|
| 479 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]",
|
| 480 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]",
|
| 481 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]",
|
| 482 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]",
|
| 483 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]",
|
| 484 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]",
|
| 485 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]",
|
| 486 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]",
|
| 487 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]",
|
| 488 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]",
|
| 489 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]",
|
| 490 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]",
|
| 491 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]",
|
| 492 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]",
|
| 493 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]",
|
| 494 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]",
|
| 495 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]",
|
| 496 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]",
|
| 497 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]",
|
| 498 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]",
|
| 499 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]",
|
| 500 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]",
|
| 501 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]",
|
| 502 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]",
|
| 503 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]",
|
| 504 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]",
|
| 505 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]",
|
| 506 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]",
|
| 507 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]",
|
| 508 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]",
|
| 509 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]",
|
| 510 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]",
|
| 511 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]",
|
| 512 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]",
|
| 513 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]",
|
| 514 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]",
|
| 515 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]",
|
| 516 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]",
|
| 517 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]",
|
| 518 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]",
|
| 519 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]",
|
| 520 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]",
|
| 521 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]",
|
| 522 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]",
|
| 523 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]",
|
| 524 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]",
|
| 525 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]",
|
| 526 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]",
|
| 527 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]",
|
| 528 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]",
|
| 529 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]",
|
| 530 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]",
|
| 531 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]",
|
| 532 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]",
|
| 533 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]",
|
| 534 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]",
|
| 535 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]",
|
| 536 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]",
|
| 537 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]",
|
| 538 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]",
|
| 539 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]",
|
| 540 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]",
|
| 541 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]",
|
| 542 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]",
|
| 543 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]",
|
| 544 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]",
|
| 545 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]",
|
| 546 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]",
|
| 547 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]",
|
| 548 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]",
|
| 549 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]",
|
| 550 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]",
|
| 551 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]",
|
| 552 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types",
|
| 553 |
+
"tests/test_utils.py::test_build_reference",
|
| 554 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring",
|
| 555 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]",
|
| 556 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]",
|
| 557 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]",
|
| 558 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]",
|
| 559 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]",
|
| 560 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]",
|
| 561 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_unicode",
|
| 562 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default",
|
| 563 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs"
|
| 564 |
+
]
|
| 565 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/grade.py
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Trusted private pytest panel runner. Installed only in a fresh grader Job."""
|
| 2 |
+
|
| 3 |
+
import hashlib
|
| 4 |
+
import importlib.util
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
import shutil
|
| 8 |
+
import stat
|
| 9 |
+
import subprocess
|
| 10 |
+
from pathlib import Path, PurePosixPath
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def sha(raw):
|
| 14 |
+
return hashlib.sha256(raw).hexdigest()
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def safe(value):
|
| 18 |
+
path = PurePosixPath(value)
|
| 19 |
+
if (
|
| 20 |
+
path.is_absolute()
|
| 21 |
+
or path.as_posix() != value
|
| 22 |
+
or not path.parts
|
| 23 |
+
or any(part in {".", "..", ".git"} for part in path.parts)
|
| 24 |
+
):
|
| 25 |
+
raise ValueError("Unsafe trusted test path")
|
| 26 |
+
return path
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def restore(worktree, private, manifest):
|
| 30 |
+
worktree, private = Path(worktree), Path(private)
|
| 31 |
+
captured = {}
|
| 32 |
+
for name, expected in manifest["files"].items():
|
| 33 |
+
path = private / safe(name)
|
| 34 |
+
info = path.lstat()
|
| 35 |
+
raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b""
|
| 36 |
+
if (
|
| 37 |
+
not stat.S_ISREG(info.st_mode)
|
| 38 |
+
or len(raw) != expected["bytes"]
|
| 39 |
+
or sha(raw) != expected["sha256"]
|
| 40 |
+
or stat.S_IMODE(info.st_mode) != expected["mode"]
|
| 41 |
+
):
|
| 42 |
+
raise ValueError("Trusted private test bytes or modes drifted")
|
| 43 |
+
captured[name] = (raw, expected["mode"])
|
| 44 |
+
# Capture and verify every private byte before changing the submitted tree.
|
| 45 |
+
for name in manifest["directory_roots"]:
|
| 46 |
+
destination = worktree / safe(name)
|
| 47 |
+
if destination.is_symlink():
|
| 48 |
+
raise ValueError("Submitted test directory is a symlink")
|
| 49 |
+
for parent in destination.parents:
|
| 50 |
+
if parent == worktree:
|
| 51 |
+
break
|
| 52 |
+
if parent.is_symlink():
|
| 53 |
+
raise ValueError("Submitted test parent is a symlink")
|
| 54 |
+
if destination.exists():
|
| 55 |
+
if not destination.is_dir():
|
| 56 |
+
raise ValueError("Submitted test directory is not a directory")
|
| 57 |
+
shutil.rmtree(destination)
|
| 58 |
+
for name, (raw, mode) in captured.items():
|
| 59 |
+
destination = worktree / safe(name)
|
| 60 |
+
for parent in destination.parents:
|
| 61 |
+
if parent == worktree:
|
| 62 |
+
break
|
| 63 |
+
if parent.is_symlink():
|
| 64 |
+
raise ValueError("Submitted test parent is a symlink")
|
| 65 |
+
if destination.is_symlink():
|
| 66 |
+
raise ValueError("Submitted trusted file is a symlink")
|
| 67 |
+
destination.parent.mkdir(parents=True, exist_ok=True)
|
| 68 |
+
destination.write_bytes(raw)
|
| 69 |
+
destination.chmod(mode)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def run(worktree, private_root, output, invoke=None):
|
| 73 |
+
private_root, output, worktree = Path(private_root), Path(output), Path(worktree)
|
| 74 |
+
expected = json.loads((private_root / "expected-panels.json").read_bytes())
|
| 75 |
+
config = json.loads((private_root / "panel-config.json").read_bytes())
|
| 76 |
+
manifest = json.loads((private_root / "trusted-inventory.json").read_bytes())
|
| 77 |
+
restore(worktree, private_root / "trusted", manifest)
|
| 78 |
+
output.mkdir(parents=True, exist_ok=True)
|
| 79 |
+
for name in (
|
| 80 |
+
"reward.txt",
|
| 81 |
+
"pass-to-pass.xml",
|
| 82 |
+
"fail-to-pass.xml",
|
| 83 |
+
"pytest-evidence.json",
|
| 84 |
+
):
|
| 85 |
+
(output / name).unlink(missing_ok=True)
|
| 86 |
+
environment = dict(os.environ)
|
| 87 |
+
for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"):
|
| 88 |
+
environment.pop(key, None)
|
| 89 |
+
commands, native_exit = [], 0
|
| 90 |
+
invoke = invoke or subprocess.run
|
| 91 |
+
for group in ("pass-to-pass", "fail-to-pass"):
|
| 92 |
+
if (
|
| 93 |
+
not isinstance(expected[group], list)
|
| 94 |
+
or not expected[group]
|
| 95 |
+
or any(
|
| 96 |
+
not isinstance(target, str) or not target for target in expected[group]
|
| 97 |
+
)
|
| 98 |
+
):
|
| 99 |
+
raise ValueError("Frozen native pytest selectors are incomplete")
|
| 100 |
+
command = [
|
| 101 |
+
*config["official_pytest_argv"],
|
| 102 |
+
"--override-ini=addopts=",
|
| 103 |
+
"--junitxml=" + str(output / (group + ".xml")),
|
| 104 |
+
*expected[group],
|
| 105 |
+
]
|
| 106 |
+
result = invoke(command, cwd=worktree, env=environment, check=False)
|
| 107 |
+
native_exit = result.returncode
|
| 108 |
+
commands.append({"group": group, "argv": command, "exit_code": native_exit})
|
| 109 |
+
if native_exit != 0:
|
| 110 |
+
break
|
| 111 |
+
(output / "pytest-commands.json").write_text(
|
| 112 |
+
json.dumps(commands, sort_keys=True) + "\n"
|
| 113 |
+
)
|
| 114 |
+
spec = importlib.util.spec_from_file_location(
|
| 115 |
+
"trusted_pytest_result", private_root / "check_pytest.py"
|
| 116 |
+
)
|
| 117 |
+
checker = importlib.util.module_from_spec(spec)
|
| 118 |
+
spec.loader.exec_module(checker)
|
| 119 |
+
result = checker.assess(output, expected, native_exit)
|
| 120 |
+
(output / "reward.txt").write_text(str(result["reward"]) + "\n")
|
| 121 |
+
(output / "pytest-evidence.json").write_text(
|
| 122 |
+
json.dumps(result, sort_keys=True) + "\n"
|
| 123 |
+
)
|
| 124 |
+
return result
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
if __name__ == "__main__":
|
| 128 |
+
run("/testbed/repo", "/tests", "/logs/verifier")
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/panel-config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dependency_installation_pinned": false,
|
| 3 |
+
"official_install_cmds": [
|
| 4 |
+
"pip install -e .[dev]"
|
| 5 |
+
],
|
| 6 |
+
"official_pytest_argv": [
|
| 7 |
+
"pytest",
|
| 8 |
+
"--disable-warnings",
|
| 9 |
+
"--color=no",
|
| 10 |
+
"--tb=no",
|
| 11 |
+
"--verbose"
|
| 12 |
+
],
|
| 13 |
+
"official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose",
|
| 14 |
+
"panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.",
|
| 15 |
+
"python_version": "3.10",
|
| 16 |
+
"source_bound_test_dependency_cmds": [
|
| 17 |
+
"python -m pip install 'marshmallow>=3.10.0,<4.0.0'"
|
| 18 |
+
],
|
| 19 |
+
"test_dependency_source_sha256": {
|
| 20 |
+
"pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4",
|
| 21 |
+
"tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7"
|
| 22 |
+
}
|
| 23 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/test.sh
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
source /opt/miniconda3/bin/activate
|
| 4 |
+
conda activate testbed
|
| 5 |
+
cd /testbed/repo
|
| 6 |
+
exec python -I /tests/grade.py
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted-inventory.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"directory_roots": [
|
| 3 |
+
"tests"
|
| 4 |
+
],
|
| 5 |
+
"files": {
|
| 6 |
+
"pyproject.toml": {
|
| 7 |
+
"bytes": 2488,
|
| 8 |
+
"mode": 420,
|
| 9 |
+
"sha256": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4"
|
| 10 |
+
},
|
| 11 |
+
"tests/__init__.py": {
|
| 12 |
+
"bytes": 0,
|
| 13 |
+
"mode": 420,
|
| 14 |
+
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
| 15 |
+
},
|
| 16 |
+
"tests/conftest.py": {
|
| 17 |
+
"bytes": 810,
|
| 18 |
+
"mode": 420,
|
| 19 |
+
"sha256": "0009b46d9e729e75bd002d1e0864afaca1f96a6953ce60f8389410bebd0787e2"
|
| 20 |
+
},
|
| 21 |
+
"tests/schemas.py": {
|
| 22 |
+
"bytes": 2130,
|
| 23 |
+
"mode": 420,
|
| 24 |
+
"sha256": "64084646e19c70bf1170dd6639bdd6800dd92a3983074ed2841fae60fbaaec61"
|
| 25 |
+
},
|
| 26 |
+
"tests/test_core.py": {
|
| 27 |
+
"bytes": 51766,
|
| 28 |
+
"mode": 420,
|
| 29 |
+
"sha256": "18ca6c50d1894f5b4fc3d981412341ceed3cc1401bca7ab5ec0c8688b2c67ff3"
|
| 30 |
+
},
|
| 31 |
+
"tests/test_ext_marshmallow.py": {
|
| 32 |
+
"bytes": 52950,
|
| 33 |
+
"mode": 420,
|
| 34 |
+
"sha256": "12f40adf8f18db5073d9f0b692562c528eebc008307e982149da48c7fb600cf5"
|
| 35 |
+
},
|
| 36 |
+
"tests/test_ext_marshmallow_common.py": {
|
| 37 |
+
"bytes": 3236,
|
| 38 |
+
"mode": 420,
|
| 39 |
+
"sha256": "e17249f21422b2fa79f74f51898f242cb1e9786d0ba6df58bc3086d928d51d79"
|
| 40 |
+
},
|
| 41 |
+
"tests/test_ext_marshmallow_field.py": {
|
| 42 |
+
"bytes": 22438,
|
| 43 |
+
"mode": 420,
|
| 44 |
+
"sha256": "39223a47f90ca40e515a7e34ac8806087b3e0ba2968f6832b0a4a77c8c7226b1"
|
| 45 |
+
},
|
| 46 |
+
"tests/test_ext_marshmallow_openapi.py": {
|
| 47 |
+
"bytes": 24310,
|
| 48 |
+
"mode": 420,
|
| 49 |
+
"sha256": "d4edc2675840f8cc7ba0dda6169e2ab3e5c59907e20ae26576d4860828cb9e6b"
|
| 50 |
+
},
|
| 51 |
+
"tests/test_utils.py": {
|
| 52 |
+
"bytes": 918,
|
| 53 |
+
"mode": 420,
|
| 54 |
+
"sha256": "54f00d286b489440bc17cbbb162fcd53c7aedd8f96dea8d5064f44f70c026810"
|
| 55 |
+
},
|
| 56 |
+
"tests/test_yaml_utils.py": {
|
| 57 |
+
"bytes": 1285,
|
| 58 |
+
"mode": 420,
|
| 59 |
+
"sha256": "4a4af4dc1f013207b65093d25ac67809409c1ec7f63f03122a27bf9e1c873003"
|
| 60 |
+
},
|
| 61 |
+
"tests/utils.py": {
|
| 62 |
+
"bytes": 1806,
|
| 63 |
+
"mode": 420,
|
| 64 |
+
"sha256": "a0de7ce4c28047b674ffe7d5ff4cf2b9d97a07378b529c1f058a7099838ea000"
|
| 65 |
+
},
|
| 66 |
+
"tox.ini": {
|
| 67 |
+
"bytes": 778,
|
| 68 |
+
"mode": 420,
|
| 69 |
+
"sha256": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7"
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/pyproject.toml
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "apispec"
|
| 3 |
+
version = "6.8.1"
|
| 4 |
+
description = "A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)."
|
| 5 |
+
readme = "README.rst"
|
| 6 |
+
license = { file = "LICENSE" }
|
| 7 |
+
authors = [{ name = "Steven Loria", email = "sloria1@gmail.com" }]
|
| 8 |
+
maintainers = [
|
| 9 |
+
{ name = "Steven Loria", email = "sloria1@gmail.com" },
|
| 10 |
+
{ name = "Jérôme Lafréchoux", email = "jerome@jolimont.fr" },
|
| 11 |
+
]
|
| 12 |
+
classifiers = [
|
| 13 |
+
"Development Status :: 5 - Production/Stable",
|
| 14 |
+
"Intended Audience :: Developers",
|
| 15 |
+
"License :: OSI Approved :: MIT License",
|
| 16 |
+
"Programming Language :: Python :: 3",
|
| 17 |
+
"Programming Language :: Python :: 3.9",
|
| 18 |
+
"Programming Language :: Python :: 3.10",
|
| 19 |
+
"Programming Language :: Python :: 3.11",
|
| 20 |
+
"Programming Language :: Python :: 3.12",
|
| 21 |
+
"Programming Language :: Python :: 3.13",
|
| 22 |
+
]
|
| 23 |
+
keywords = [
|
| 24 |
+
"apispec",
|
| 25 |
+
"swagger",
|
| 26 |
+
"openapi",
|
| 27 |
+
"specification",
|
| 28 |
+
"oas",
|
| 29 |
+
"documentation",
|
| 30 |
+
"spec",
|
| 31 |
+
"rest",
|
| 32 |
+
"api",
|
| 33 |
+
]
|
| 34 |
+
requires-python = ">=3.9"
|
| 35 |
+
dependencies = ["packaging>=21.3"]
|
| 36 |
+
|
| 37 |
+
[project.urls]
|
| 38 |
+
Changelog = "https://apispec.readthedocs.io/en/latest/changelog.html"
|
| 39 |
+
Funding = "https://opencollective.com/marshmallow"
|
| 40 |
+
Issues = "https://github.com/marshmallow-code/apispec/issues"
|
| 41 |
+
Source = "https://github.com/marshmallow-code/apispec"
|
| 42 |
+
Tidelift = "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi"
|
| 43 |
+
|
| 44 |
+
[project.optional-dependencies]
|
| 45 |
+
yaml = ["PyYAML>=3.10"]
|
| 46 |
+
marshmallow = ["marshmallow>=3.18.0"]
|
| 47 |
+
docs = [
|
| 48 |
+
"apispec[marshmallow]",
|
| 49 |
+
"pyyaml==6.0.2",
|
| 50 |
+
"sphinx==8.1.3",
|
| 51 |
+
"sphinx-issues==5.0.0",
|
| 52 |
+
"sphinx-rtd-theme==3.0.2",
|
| 53 |
+
]
|
| 54 |
+
tests = ["apispec[yaml,marshmallow]", "openapi-spec-validator==0.7.1", "pytest"]
|
| 55 |
+
dev = ["apispec[tests]", "tox", "pre-commit>=3.5,<5.0"]
|
| 56 |
+
|
| 57 |
+
[build-system]
|
| 58 |
+
requires = ["flit_core<4"]
|
| 59 |
+
build-backend = "flit_core.buildapi"
|
| 60 |
+
|
| 61 |
+
[tool.flit.sdist]
|
| 62 |
+
include = [
|
| 63 |
+
"docs/",
|
| 64 |
+
"tests/",
|
| 65 |
+
"CHANGELOG.rst",
|
| 66 |
+
"CONTRIBUTING.rst",
|
| 67 |
+
"SECURITY.md",
|
| 68 |
+
"tox.ini",
|
| 69 |
+
]
|
| 70 |
+
exclude = ["docs/_build/"]
|
| 71 |
+
|
| 72 |
+
[tool.ruff]
|
| 73 |
+
src = ["src"]
|
| 74 |
+
fix = true
|
| 75 |
+
show-fixes = true
|
| 76 |
+
output-format = "full"
|
| 77 |
+
|
| 78 |
+
[tool.ruff.format]
|
| 79 |
+
docstring-code-format = true
|
| 80 |
+
|
| 81 |
+
[tool.ruff.lint]
|
| 82 |
+
ignore = ["E203", "E266", "E501", "E731"]
|
| 83 |
+
select = [
|
| 84 |
+
"B", # flake8-bugbear
|
| 85 |
+
"E", # pycodestyle error
|
| 86 |
+
"F", # pyflakes
|
| 87 |
+
"I", # isort
|
| 88 |
+
"UP", # pyupgrade
|
| 89 |
+
"W", # pycodestyle warning
|
| 90 |
+
]
|
| 91 |
+
|
| 92 |
+
[tool.mypy]
|
| 93 |
+
ignore_missing_imports = true
|
| 94 |
+
warn_unreachable = true
|
| 95 |
+
warn_unused_ignores = true
|
| 96 |
+
warn_redundant_casts = true
|
| 97 |
+
no_implicit_optional = true
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/__init__.py
ADDED
|
File without changes
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/conftest.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from collections import namedtuple
|
| 2 |
+
|
| 3 |
+
import pytest
|
| 4 |
+
|
| 5 |
+
from apispec import APISpec
|
| 6 |
+
from apispec.ext.marshmallow import MarshmallowPlugin
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
def make_spec(openapi_version):
|
| 10 |
+
ma_plugin = MarshmallowPlugin()
|
| 11 |
+
spec = APISpec(
|
| 12 |
+
title="Validation",
|
| 13 |
+
version="0.1",
|
| 14 |
+
openapi_version=openapi_version,
|
| 15 |
+
plugins=(ma_plugin,),
|
| 16 |
+
)
|
| 17 |
+
return namedtuple("Spec", ("spec", "marshmallow_plugin", "openapi"))(
|
| 18 |
+
spec, ma_plugin, ma_plugin.converter
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@pytest.fixture(params=("2.0", "3.0.0"))
|
| 23 |
+
def spec_fixture(request):
|
| 24 |
+
return make_spec(request.param)
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
@pytest.fixture(params=("2.0", "3.0.0"))
|
| 28 |
+
def spec(request):
|
| 29 |
+
return make_spec(request.param).spec
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
@pytest.fixture(params=("2.0", "3.0.0"))
|
| 33 |
+
def openapi(request):
|
| 34 |
+
spec = make_spec(request.param)
|
| 35 |
+
return spec.openapi
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/schemas.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from marshmallow import Schema, fields
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
class PetSchema(Schema):
|
| 5 |
+
description = dict(id="Pet id", name="Pet name", password="Password")
|
| 6 |
+
id = fields.Int(dump_only=True, metadata={"description": description["id"]})
|
| 7 |
+
name = fields.Str(
|
| 8 |
+
required=True,
|
| 9 |
+
metadata={
|
| 10 |
+
"description": description["name"],
|
| 11 |
+
"deprecated": False,
|
| 12 |
+
"allowEmptyValue": False,
|
| 13 |
+
},
|
| 14 |
+
)
|
| 15 |
+
password = fields.Str(
|
| 16 |
+
load_only=True, metadata={"description": description["password"]}
|
| 17 |
+
)
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class SampleSchema(Schema):
|
| 21 |
+
runs = fields.Nested("RunSchema", many=True)
|
| 22 |
+
|
| 23 |
+
count = fields.Int()
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
class RunSchema(Schema):
|
| 27 |
+
sample = fields.Nested(SampleSchema)
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
class AnalysisSchema(Schema):
|
| 31 |
+
sample = fields.Nested(SampleSchema)
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
class AnalysisWithListSchema(Schema):
|
| 35 |
+
samples = fields.List(fields.Nested(SampleSchema))
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
class PatternedObjectSchema(Schema):
|
| 39 |
+
count = fields.Int(dump_only=True, metadata={"x-count": 1})
|
| 40 |
+
count2 = fields.Int(dump_only=True, metadata={"x_count2": 2})
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
class SelfReferencingSchema(Schema):
|
| 44 |
+
id = fields.Int()
|
| 45 |
+
single = fields.Nested(lambda: SelfReferencingSchema())
|
| 46 |
+
multiple = fields.Nested(lambda: SelfReferencingSchema(many=True))
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
class OrderedSchema(Schema):
|
| 50 |
+
field1 = fields.Int()
|
| 51 |
+
field2 = fields.Int()
|
| 52 |
+
field3 = fields.Int()
|
| 53 |
+
field4 = fields.Int()
|
| 54 |
+
field5 = fields.Int()
|
| 55 |
+
|
| 56 |
+
class Meta:
|
| 57 |
+
ordered = True
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class DefaultValuesSchema(Schema):
|
| 61 |
+
number_auto_default = fields.Int(load_default=12)
|
| 62 |
+
number_manual_default = fields.Int(load_default=12, metadata={"default": 42})
|
| 63 |
+
string_callable_default = fields.Str(load_default=lambda: "Callable")
|
| 64 |
+
string_manual_default = fields.Str(
|
| 65 |
+
load_default=lambda: "Callable", metadata={"default": "Manual"}
|
| 66 |
+
)
|
| 67 |
+
numbers = fields.List(fields.Int, load_default=list)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
class CategorySchema(Schema):
|
| 71 |
+
id = fields.Int()
|
| 72 |
+
name = fields.Str(required=True)
|
| 73 |
+
breed = fields.Str(dump_only=True)
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
class CustomList(fields.List):
|
| 77 |
+
pass
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
class CustomStringField(fields.String):
|
| 81 |
+
pass
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
class CustomIntegerField(fields.Integer):
|
| 85 |
+
pass
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_core.py
ADDED
|
@@ -0,0 +1,1269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import copy
|
| 2 |
+
from http import HTTPStatus
|
| 3 |
+
|
| 4 |
+
import pytest
|
| 5 |
+
import yaml
|
| 6 |
+
|
| 7 |
+
from apispec import APISpec, BasePlugin
|
| 8 |
+
from apispec.exceptions import (
|
| 9 |
+
APISpecError,
|
| 10 |
+
DuplicateComponentNameError,
|
| 11 |
+
DuplicateParameterError,
|
| 12 |
+
InvalidParameterError,
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
from .utils import (
|
| 16 |
+
build_ref,
|
| 17 |
+
get_examples,
|
| 18 |
+
get_headers,
|
| 19 |
+
get_parameters,
|
| 20 |
+
get_paths,
|
| 21 |
+
get_responses,
|
| 22 |
+
get_schemas,
|
| 23 |
+
get_security_schemes,
|
| 24 |
+
)
|
| 25 |
+
|
| 26 |
+
description = "This is a sample Petstore server. You can find out more "
|
| 27 |
+
'about Swagger at <a href="http://swagger.wordnik.com">http://swagger.wordnik.com</a> '
|
| 28 |
+
"or on irc.freenode.net, #swagger. For this sample, you can use the api "
|
| 29 |
+
'key "special-key" to test the authorization filters'
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class RefsSchemaTestMixin:
|
| 33 |
+
REFS_SCHEMA = {
|
| 34 |
+
"properties": {
|
| 35 |
+
"nested": "NestedSchema",
|
| 36 |
+
"deep_nested": {"properties": {"nested": "NestedSchema"}},
|
| 37 |
+
"nested_list": {"items": "DeepNestedSchema"},
|
| 38 |
+
"deep_nested_list": {
|
| 39 |
+
"items": {"properties": {"nested": "DeepNestedSchema"}}
|
| 40 |
+
},
|
| 41 |
+
"allof": {
|
| 42 |
+
"allOf": [
|
| 43 |
+
"AllOfSchema",
|
| 44 |
+
{"properties": {"nested": "AllOfSchema"}},
|
| 45 |
+
]
|
| 46 |
+
},
|
| 47 |
+
"oneof": {
|
| 48 |
+
"oneOf": [
|
| 49 |
+
"OneOfSchema",
|
| 50 |
+
{"properties": {"nested": "OneOfSchema"}},
|
| 51 |
+
]
|
| 52 |
+
},
|
| 53 |
+
"anyof": {
|
| 54 |
+
"anyOf": [
|
| 55 |
+
"AnyOfSchema",
|
| 56 |
+
{"properties": {"nested": "AnyOfSchema"}},
|
| 57 |
+
]
|
| 58 |
+
},
|
| 59 |
+
"not": "NotSchema",
|
| 60 |
+
"deep_not": {"properties": {"nested": "DeepNotSchema"}},
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
@staticmethod
|
| 65 |
+
def assert_schema_refs(spec, schema):
|
| 66 |
+
props = schema["properties"]
|
| 67 |
+
assert props["nested"] == build_ref(spec, "schema", "NestedSchema")
|
| 68 |
+
assert props["deep_nested"]["properties"]["nested"] == build_ref(
|
| 69 |
+
spec, "schema", "NestedSchema"
|
| 70 |
+
)
|
| 71 |
+
assert props["nested_list"]["items"] == build_ref(
|
| 72 |
+
spec, "schema", "DeepNestedSchema"
|
| 73 |
+
)
|
| 74 |
+
assert props["deep_nested_list"]["items"]["properties"]["nested"] == build_ref(
|
| 75 |
+
spec, "schema", "DeepNestedSchema"
|
| 76 |
+
)
|
| 77 |
+
assert props["allof"]["allOf"][0] == build_ref(spec, "schema", "AllOfSchema")
|
| 78 |
+
assert props["allof"]["allOf"][1]["properties"]["nested"] == build_ref(
|
| 79 |
+
spec, "schema", "AllOfSchema"
|
| 80 |
+
)
|
| 81 |
+
assert props["oneof"]["oneOf"][0] == build_ref(spec, "schema", "OneOfSchema")
|
| 82 |
+
assert props["oneof"]["oneOf"][1]["properties"]["nested"] == build_ref(
|
| 83 |
+
spec, "schema", "OneOfSchema"
|
| 84 |
+
)
|
| 85 |
+
assert props["anyof"]["anyOf"][0] == build_ref(spec, "schema", "AnyOfSchema")
|
| 86 |
+
assert props["anyof"]["anyOf"][1]["properties"]["nested"] == build_ref(
|
| 87 |
+
spec, "schema", "AnyOfSchema"
|
| 88 |
+
)
|
| 89 |
+
assert props["not"] == build_ref(spec, "schema", "NotSchema")
|
| 90 |
+
assert props["deep_not"]["properties"]["nested"] == build_ref(
|
| 91 |
+
spec, "schema", "DeepNotSchema"
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
@pytest.fixture(params=("2.0", "3.0.0"))
|
| 96 |
+
def spec(request):
|
| 97 |
+
openapi_version = request.param
|
| 98 |
+
if openapi_version == "2.0":
|
| 99 |
+
security_kwargs = {"security": [{"apiKey": []}]}
|
| 100 |
+
else:
|
| 101 |
+
security_kwargs = {
|
| 102 |
+
"components": {
|
| 103 |
+
"securitySchemes": {
|
| 104 |
+
"bearerAuth": dict(type="http", scheme="bearer", bearerFormat="JWT")
|
| 105 |
+
},
|
| 106 |
+
"schemas": {
|
| 107 |
+
"ErrorResponse": {
|
| 108 |
+
"type": "object",
|
| 109 |
+
"properties": {
|
| 110 |
+
"ok": {
|
| 111 |
+
"type": "boolean",
|
| 112 |
+
"description": "status indicator",
|
| 113 |
+
"example": False,
|
| 114 |
+
}
|
| 115 |
+
},
|
| 116 |
+
"required": ["ok"],
|
| 117 |
+
}
|
| 118 |
+
},
|
| 119 |
+
}
|
| 120 |
+
}
|
| 121 |
+
return APISpec(
|
| 122 |
+
title="Swagger Petstore",
|
| 123 |
+
version="1.0.0",
|
| 124 |
+
openapi_version=openapi_version,
|
| 125 |
+
info={"description": description},
|
| 126 |
+
**security_kwargs,
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
class TestAPISpecInit:
|
| 131 |
+
def test_raises_wrong_apispec_version(self):
|
| 132 |
+
message = "Not a valid OpenAPI version number:"
|
| 133 |
+
with pytest.raises(APISpecError, match=message):
|
| 134 |
+
APISpec(
|
| 135 |
+
"Swagger Petstore",
|
| 136 |
+
version="1.0.0",
|
| 137 |
+
openapi_version="4.0", # 4.0 is not supported
|
| 138 |
+
info={"description": description},
|
| 139 |
+
security=[{"apiKey": []}],
|
| 140 |
+
)
|
| 141 |
+
|
| 142 |
+
|
| 143 |
+
class TestMetadata:
|
| 144 |
+
def test_openapi_metadata(self, spec):
|
| 145 |
+
metadata = spec.to_dict()
|
| 146 |
+
assert metadata["info"]["title"] == "Swagger Petstore"
|
| 147 |
+
assert metadata["info"]["version"] == "1.0.0"
|
| 148 |
+
assert metadata["info"]["description"] == description
|
| 149 |
+
if spec.openapi_version.major < 3:
|
| 150 |
+
assert metadata["swagger"] == str(spec.openapi_version)
|
| 151 |
+
assert metadata["security"] == [{"apiKey": []}]
|
| 152 |
+
else:
|
| 153 |
+
assert metadata["openapi"] == str(spec.openapi_version)
|
| 154 |
+
security_schemes = {
|
| 155 |
+
"bearerAuth": dict(type="http", scheme="bearer", bearerFormat="JWT")
|
| 156 |
+
}
|
| 157 |
+
assert metadata["components"]["securitySchemes"] == security_schemes
|
| 158 |
+
assert metadata["components"]["schemas"].get("ErrorResponse", False)
|
| 159 |
+
assert metadata["info"]["title"] == "Swagger Petstore"
|
| 160 |
+
assert metadata["info"]["version"] == "1.0.0"
|
| 161 |
+
assert metadata["info"]["description"] == description
|
| 162 |
+
|
| 163 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 164 |
+
def test_openapi_metadata_merge_v3(self, spec):
|
| 165 |
+
properties = {
|
| 166 |
+
"ok": {
|
| 167 |
+
"type": "boolean",
|
| 168 |
+
"description": "property description",
|
| 169 |
+
"example": True,
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
spec.components.schema(
|
| 173 |
+
"definition", {"properties": properties, "description": "description"}
|
| 174 |
+
)
|
| 175 |
+
metadata = spec.to_dict()
|
| 176 |
+
assert metadata["components"]["schemas"].get("ErrorResponse", False)
|
| 177 |
+
assert metadata["components"]["schemas"].get("definition", False)
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
class TestTags:
|
| 181 |
+
tag = {
|
| 182 |
+
"name": "MyTag",
|
| 183 |
+
"description": "This tag gathers all API endpoints which are mine.",
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
def test_tag(self, spec):
|
| 187 |
+
spec.tag(self.tag)
|
| 188 |
+
tags_json = spec.to_dict()["tags"]
|
| 189 |
+
assert self.tag in tags_json
|
| 190 |
+
|
| 191 |
+
def test_tag_is_chainable(self, spec):
|
| 192 |
+
spec.tag({"name": "tag1"}).tag({"name": "tag2"})
|
| 193 |
+
assert spec.to_dict()["tags"] == [{"name": "tag1"}, {"name": "tag2"}]
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
class TestComponents(RefsSchemaTestMixin):
|
| 197 |
+
properties = {
|
| 198 |
+
"id": {"type": "integer", "format": "int64"},
|
| 199 |
+
"name": {"type": "string", "example": "doggie"},
|
| 200 |
+
}
|
| 201 |
+
|
| 202 |
+
def test_schema(self, spec):
|
| 203 |
+
spec.components.schema("Pet", {"properties": self.properties})
|
| 204 |
+
schemas = get_schemas(spec)
|
| 205 |
+
assert "Pet" in schemas
|
| 206 |
+
assert schemas["Pet"]["properties"] == self.properties
|
| 207 |
+
|
| 208 |
+
def test_schema_is_chainable(self, spec):
|
| 209 |
+
spec.components.schema("Pet", {"properties": {}}).schema(
|
| 210 |
+
"Plant", {"properties": {}}
|
| 211 |
+
)
|
| 212 |
+
schemas = get_schemas(spec)
|
| 213 |
+
assert "Pet" in schemas
|
| 214 |
+
assert "Plant" in schemas
|
| 215 |
+
|
| 216 |
+
def test_schema_description(self, spec):
|
| 217 |
+
model_description = "An animal which lives with humans."
|
| 218 |
+
spec.components.schema(
|
| 219 |
+
"Pet", {"properties": self.properties, "description": model_description}
|
| 220 |
+
)
|
| 221 |
+
schemas = get_schemas(spec)
|
| 222 |
+
assert schemas["Pet"]["description"] == model_description
|
| 223 |
+
|
| 224 |
+
def test_schema_stores_enum(self, spec):
|
| 225 |
+
enum = ["name", "photoUrls"]
|
| 226 |
+
spec.components.schema("Pet", {"properties": self.properties, "enum": enum})
|
| 227 |
+
schemas = get_schemas(spec)
|
| 228 |
+
assert schemas["Pet"]["enum"] == enum
|
| 229 |
+
|
| 230 |
+
def test_schema_discriminator(self, spec):
|
| 231 |
+
spec.components.schema(
|
| 232 |
+
"Pet", {"properties": self.properties, "discriminator": "name"}
|
| 233 |
+
)
|
| 234 |
+
schemas = get_schemas(spec)
|
| 235 |
+
assert schemas["Pet"]["discriminator"] == "name"
|
| 236 |
+
|
| 237 |
+
def test_schema_duplicate_name(self, spec):
|
| 238 |
+
spec.components.schema("Pet", {"properties": self.properties})
|
| 239 |
+
with pytest.raises(
|
| 240 |
+
DuplicateComponentNameError,
|
| 241 |
+
match='Another schema with name "Pet" is already registered.',
|
| 242 |
+
):
|
| 243 |
+
spec.components.schema("Pet", properties=self.properties)
|
| 244 |
+
|
| 245 |
+
def test_response(self, spec):
|
| 246 |
+
response = {"description": "Pet not found"}
|
| 247 |
+
spec.components.response("NotFound", response)
|
| 248 |
+
responses = get_responses(spec)
|
| 249 |
+
assert responses["NotFound"] == response
|
| 250 |
+
|
| 251 |
+
def test_response_is_chainable(self, spec):
|
| 252 |
+
spec.components.response("resp1").response("resp2")
|
| 253 |
+
responses = get_responses(spec)
|
| 254 |
+
assert "resp1" in responses
|
| 255 |
+
assert "resp2" in responses
|
| 256 |
+
|
| 257 |
+
def test_response_duplicate_name(self, spec):
|
| 258 |
+
spec.components.response("test_response")
|
| 259 |
+
with pytest.raises(
|
| 260 |
+
DuplicateComponentNameError,
|
| 261 |
+
match='Another response with name "test_response" is already registered.',
|
| 262 |
+
):
|
| 263 |
+
spec.components.response("test_response")
|
| 264 |
+
|
| 265 |
+
def test_parameter(self, spec):
|
| 266 |
+
# Note: this is an OpenAPI v2 parameter header
|
| 267 |
+
# but is does the job for the test even for OpenAPI v3
|
| 268 |
+
parameter = {"format": "int64", "type": "integer"}
|
| 269 |
+
spec.components.parameter("PetId", "path", parameter)
|
| 270 |
+
params = get_parameters(spec)
|
| 271 |
+
assert params["PetId"] == {
|
| 272 |
+
"format": "int64",
|
| 273 |
+
"type": "integer",
|
| 274 |
+
"in": "path",
|
| 275 |
+
"name": "PetId",
|
| 276 |
+
"required": True,
|
| 277 |
+
}
|
| 278 |
+
|
| 279 |
+
def test_parameter_is_chainable(self, spec):
|
| 280 |
+
spec.components.parameter("param1", "path").parameter("param2", "path")
|
| 281 |
+
params = get_parameters(spec)
|
| 282 |
+
assert "param1" in params
|
| 283 |
+
assert "param2" in params
|
| 284 |
+
|
| 285 |
+
def test_parameter_duplicate_name(self, spec):
|
| 286 |
+
spec.components.parameter("test_parameter", "path")
|
| 287 |
+
with pytest.raises(
|
| 288 |
+
DuplicateComponentNameError,
|
| 289 |
+
match='Another parameter with name "test_parameter" is already registered.',
|
| 290 |
+
):
|
| 291 |
+
spec.components.parameter("test_parameter", "path")
|
| 292 |
+
|
| 293 |
+
# Referenced headers are only supported in OAS 3.x
|
| 294 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 295 |
+
def test_header(self, spec):
|
| 296 |
+
header = {"schema": {"type": "string"}}
|
| 297 |
+
spec.components.header("test_header", header.copy())
|
| 298 |
+
headers = get_headers(spec)
|
| 299 |
+
assert headers["test_header"] == header
|
| 300 |
+
|
| 301 |
+
# Referenced headers are only supported in OAS 3.x
|
| 302 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 303 |
+
def test_header_is_chainable(self, spec):
|
| 304 |
+
header = {"schema": {"type": "string"}}
|
| 305 |
+
spec.components.header("header1", header).header("header2", header)
|
| 306 |
+
headers = get_headers(spec)
|
| 307 |
+
assert "header1" in headers
|
| 308 |
+
assert "header2" in headers
|
| 309 |
+
|
| 310 |
+
# Referenced headers are only supported in OAS 3.x
|
| 311 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 312 |
+
def test_header_duplicate_name(self, spec):
|
| 313 |
+
spec.components.header("test_header", {"schema": {"type": "string"}})
|
| 314 |
+
with pytest.raises(
|
| 315 |
+
DuplicateComponentNameError,
|
| 316 |
+
match='Another header with name "test_header" is already registered.',
|
| 317 |
+
):
|
| 318 |
+
spec.components.header("test_header", {"schema": {"type": "integer"}})
|
| 319 |
+
|
| 320 |
+
# Referenced examples are only supported in OAS 3.x
|
| 321 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 322 |
+
def test_example(self, spec):
|
| 323 |
+
spec.components.example("test_example", {"value": {"a": "b"}})
|
| 324 |
+
examples = get_examples(spec)
|
| 325 |
+
assert examples["test_example"]["value"] == {"a": "b"}
|
| 326 |
+
|
| 327 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 328 |
+
def test_example_is_chainable(self, spec):
|
| 329 |
+
spec.components.example("test_example_1", {}).example("test_example_2", {})
|
| 330 |
+
examples = get_examples(spec)
|
| 331 |
+
assert "test_example_1" in examples
|
| 332 |
+
assert "test_example_2" in examples
|
| 333 |
+
|
| 334 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 335 |
+
def test_example_duplicate_name(self, spec):
|
| 336 |
+
spec.components.example("test_example", {})
|
| 337 |
+
with pytest.raises(
|
| 338 |
+
DuplicateComponentNameError,
|
| 339 |
+
match='Another example with name "test_example" is already registered.',
|
| 340 |
+
):
|
| 341 |
+
spec.components.example("test_example", {})
|
| 342 |
+
|
| 343 |
+
def test_security_scheme(self, spec):
|
| 344 |
+
sec_scheme = {"type": "apiKey", "in": "header", "name": "X-API-Key"}
|
| 345 |
+
spec.components.security_scheme("ApiKeyAuth", sec_scheme)
|
| 346 |
+
assert get_security_schemes(spec)["ApiKeyAuth"] == sec_scheme
|
| 347 |
+
|
| 348 |
+
def test_security_scheme_is_chainable(self, spec):
|
| 349 |
+
spec.components.security_scheme("sec_1", {}).security_scheme("sec_2", {})
|
| 350 |
+
security_schemes = get_security_schemes(spec)
|
| 351 |
+
assert "sec_1" in security_schemes
|
| 352 |
+
assert "sec_2" in security_schemes
|
| 353 |
+
|
| 354 |
+
def test_security_scheme_duplicate_name(self, spec):
|
| 355 |
+
sec_scheme_1 = {"type": "apiKey", "in": "header", "name": "X-API-Key"}
|
| 356 |
+
sec_scheme_2 = {"type": "apiKey", "in": "header", "name": "X-API-Key-2"}
|
| 357 |
+
spec.components.security_scheme("ApiKeyAuth", sec_scheme_1)
|
| 358 |
+
with pytest.raises(
|
| 359 |
+
DuplicateComponentNameError,
|
| 360 |
+
match='Another security scheme with name "ApiKeyAuth" is already registered.',
|
| 361 |
+
):
|
| 362 |
+
spec.components.security_scheme("ApiKeyAuth", sec_scheme_2)
|
| 363 |
+
|
| 364 |
+
def test_to_yaml(self, spec):
|
| 365 |
+
enum = ["name", "photoUrls"]
|
| 366 |
+
spec.components.schema("Pet", properties=self.properties, enum=enum)
|
| 367 |
+
assert spec.to_dict() == yaml.safe_load(spec.to_yaml())
|
| 368 |
+
|
| 369 |
+
def test_components_can_be_accessed_by_plugin_in_init_spec(self):
|
| 370 |
+
class TestPlugin(BasePlugin):
|
| 371 |
+
def init_spec(self, spec):
|
| 372 |
+
spec.components.schema(
|
| 373 |
+
"TestSchema",
|
| 374 |
+
{"properties": {"key": {"type": "string"}}, "type": "object"},
|
| 375 |
+
)
|
| 376 |
+
|
| 377 |
+
spec = APISpec(
|
| 378 |
+
"Test API", version="0.0.1", openapi_version="2.0", plugins=[TestPlugin()]
|
| 379 |
+
)
|
| 380 |
+
assert get_schemas(spec) == {
|
| 381 |
+
"TestSchema": {"properties": {"key": {"type": "string"}}, "type": "object"}
|
| 382 |
+
}
|
| 383 |
+
|
| 384 |
+
def test_components_resolve_refs_in_schema(self, spec):
|
| 385 |
+
spec.components.schema("refs_schema", copy.deepcopy(self.REFS_SCHEMA))
|
| 386 |
+
self.assert_schema_refs(spec, get_schemas(spec)["refs_schema"])
|
| 387 |
+
|
| 388 |
+
def test_components_resolve_response_schema(self, spec):
|
| 389 |
+
schema = {"schema": "PetSchema"}
|
| 390 |
+
if spec.openapi_version.major >= 3:
|
| 391 |
+
schema = {"content": {"application/json": schema}}
|
| 392 |
+
spec.components.response("Response", schema)
|
| 393 |
+
resp = get_responses(spec)["Response"]
|
| 394 |
+
if spec.openapi_version.major < 3:
|
| 395 |
+
schema = resp["schema"]
|
| 396 |
+
else:
|
| 397 |
+
schema = resp["content"]["application/json"]["schema"]
|
| 398 |
+
assert schema == build_ref(spec, "schema", "PetSchema")
|
| 399 |
+
|
| 400 |
+
# "headers" components section only exists in OAS 3
|
| 401 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 402 |
+
def test_components_resolve_response_header(self, spec):
|
| 403 |
+
response = {"headers": {"header_1": "Header_1"}}
|
| 404 |
+
spec.components.response("Response", response)
|
| 405 |
+
resp = get_responses(spec)["Response"]
|
| 406 |
+
header_1 = resp["headers"]["header_1"]
|
| 407 |
+
assert header_1 == build_ref(spec, "header", "Header_1")
|
| 408 |
+
|
| 409 |
+
# "headers" components section only exists in OAS 3
|
| 410 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 411 |
+
def test_components_resolve_response_header_schema(self, spec):
|
| 412 |
+
response = {"headers": {"header_1": {"name": "Pet", "schema": "PetSchema"}}}
|
| 413 |
+
spec.components.response("Response", response)
|
| 414 |
+
resp = get_responses(spec)["Response"]
|
| 415 |
+
header_1 = resp["headers"]["header_1"]
|
| 416 |
+
assert header_1["schema"] == build_ref(spec, "schema", "PetSchema")
|
| 417 |
+
|
| 418 |
+
# "headers" components section only exists in OAS 3
|
| 419 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 420 |
+
def test_components_resolve_response_header_examples(self, spec):
|
| 421 |
+
response = {
|
| 422 |
+
"headers": {
|
| 423 |
+
"header_1": {"name": "Pet", "examples": {"example_1": "Example_1"}}
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
spec.components.response("Response", response)
|
| 427 |
+
resp = get_responses(spec)["Response"]
|
| 428 |
+
header_1 = resp["headers"]["header_1"]
|
| 429 |
+
assert header_1["examples"]["example_1"] == build_ref(
|
| 430 |
+
spec, "example", "Example_1"
|
| 431 |
+
)
|
| 432 |
+
|
| 433 |
+
# "examples" components section only exists in OAS 3
|
| 434 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 435 |
+
def test_components_resolve_response_examples(self, spec):
|
| 436 |
+
response = {
|
| 437 |
+
"content": {"application/json": {"examples": {"example_1": "Example_1"}}}
|
| 438 |
+
}
|
| 439 |
+
spec.components.response("Response", response)
|
| 440 |
+
resp = get_responses(spec)["Response"]
|
| 441 |
+
example_1 = resp["content"]["application/json"]["examples"]["example_1"]
|
| 442 |
+
assert example_1 == build_ref(spec, "example", "Example_1")
|
| 443 |
+
|
| 444 |
+
def test_components_resolve_refs_in_response_schema(self, spec):
|
| 445 |
+
schema = copy.deepcopy(self.REFS_SCHEMA)
|
| 446 |
+
if spec.openapi_version.major >= 3:
|
| 447 |
+
response = {"content": {"application/json": {"schema": schema}}}
|
| 448 |
+
else:
|
| 449 |
+
response = {"schema": schema}
|
| 450 |
+
spec.components.response("Response", response)
|
| 451 |
+
resp = get_responses(spec)["Response"]
|
| 452 |
+
if spec.openapi_version.major < 3:
|
| 453 |
+
schema = resp["schema"]
|
| 454 |
+
else:
|
| 455 |
+
schema = resp["content"]["application/json"]["schema"]
|
| 456 |
+
self.assert_schema_refs(spec, schema)
|
| 457 |
+
|
| 458 |
+
# "headers" components section only exists in OAS 3
|
| 459 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 460 |
+
def test_components_resolve_refs_in_response_header_schema(self, spec):
|
| 461 |
+
header = {"schema": copy.deepcopy(self.REFS_SCHEMA)}
|
| 462 |
+
response = {"headers": {"header": header}}
|
| 463 |
+
spec.components.response("Response", response)
|
| 464 |
+
resp = get_responses(spec)["Response"]
|
| 465 |
+
self.assert_schema_refs(spec, resp["headers"]["header"]["schema"])
|
| 466 |
+
|
| 467 |
+
# "examples" components section only exists in OAS 3
|
| 468 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 469 |
+
def test_components_resolve_parameter_examples(self, spec):
|
| 470 |
+
parameter = {
|
| 471 |
+
"examples": {"example_1": "Example_1"},
|
| 472 |
+
}
|
| 473 |
+
spec.components.parameter("param", "path", parameter)
|
| 474 |
+
param = get_parameters(spec)["param"]
|
| 475 |
+
example_1 = param["examples"]["example_1"]
|
| 476 |
+
assert example_1 == build_ref(spec, "example", "Example_1")
|
| 477 |
+
|
| 478 |
+
def test_components_resolve_parameter_schemas(self, spec):
|
| 479 |
+
parameter = {"schema": "PetSchema"}
|
| 480 |
+
spec.components.parameter("param", "path", parameter)
|
| 481 |
+
param = get_parameters(spec)["param"]
|
| 482 |
+
assert param["schema"] == build_ref(spec, "schema", "PetSchema")
|
| 483 |
+
|
| 484 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 485 |
+
def test_components_resolve_parameter_schemas_v3(self, spec):
|
| 486 |
+
parameter = {"content": {"application/json": {"schema": "PetSchema"}}}
|
| 487 |
+
spec.components.parameter("param", "path", parameter)
|
| 488 |
+
param = get_parameters(spec)["param"]
|
| 489 |
+
schema = param["content"]["application/json"]["schema"]
|
| 490 |
+
assert schema == build_ref(spec, "schema", "PetSchema")
|
| 491 |
+
|
| 492 |
+
def test_components_resolve_refs_in_parameter_schema(self, spec):
|
| 493 |
+
parameter = {"schema": copy.deepcopy(self.REFS_SCHEMA)}
|
| 494 |
+
spec.components.parameter("param", "path", parameter)
|
| 495 |
+
self.assert_schema_refs(spec, get_parameters(spec)["param"]["schema"])
|
| 496 |
+
|
| 497 |
+
# "headers" components section only exists in OAS 3
|
| 498 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 499 |
+
def test_components_resolve_header_schema(self, spec):
|
| 500 |
+
header = {"name": "Pet", "schema": "PetSchema"}
|
| 501 |
+
spec.components.header("header", header)
|
| 502 |
+
header = get_headers(spec)["header"]
|
| 503 |
+
assert header["schema"] == build_ref(spec, "schema", "PetSchema")
|
| 504 |
+
|
| 505 |
+
# "headers" components section only exists in OAS 3
|
| 506 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 507 |
+
def test_components_resolve_header_examples(self, spec):
|
| 508 |
+
header = {"name": "Pet", "examples": {"example_1": "Example_1"}}
|
| 509 |
+
spec.components.header("header", header)
|
| 510 |
+
header = get_headers(spec)["header"]
|
| 511 |
+
assert header["examples"]["example_1"] == build_ref(
|
| 512 |
+
spec, "example", "Example_1"
|
| 513 |
+
)
|
| 514 |
+
|
| 515 |
+
# "headers" components section only exists in OAS 3
|
| 516 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 517 |
+
def test_components_resolve_refs_in_header_schema(self, spec):
|
| 518 |
+
header = {"schema": copy.deepcopy(self.REFS_SCHEMA)}
|
| 519 |
+
spec.components.header("header", header)
|
| 520 |
+
self.assert_schema_refs(spec, get_headers(spec)["header"]["schema"])
|
| 521 |
+
|
| 522 |
+
def test_schema_lazy(self, spec):
|
| 523 |
+
spec.components.schema("Pet_1", {"properties": self.properties}, lazy=False)
|
| 524 |
+
spec.components.schema("Pet_2", {"properties": self.properties}, lazy=True)
|
| 525 |
+
schemas = get_schemas(spec)
|
| 526 |
+
assert "Pet_1" in schemas
|
| 527 |
+
assert "Pet_2" not in schemas
|
| 528 |
+
spec.components.schema("PetFriend", {"oneOf": ["Pet_1", "Pet_2"]})
|
| 529 |
+
schemas = get_schemas(spec)
|
| 530 |
+
assert "Pet_2" in schemas
|
| 531 |
+
assert schemas["Pet_2"]["properties"] == self.properties
|
| 532 |
+
|
| 533 |
+
def test_response_lazy(self, spec):
|
| 534 |
+
response_1 = {"description": "Response 1"}
|
| 535 |
+
response_2 = {"description": "Response 2"}
|
| 536 |
+
spec.components.response("Response_1", response_1, lazy=False)
|
| 537 |
+
spec.components.response("Response_2", response_2, lazy=True)
|
| 538 |
+
responses = get_responses(spec)
|
| 539 |
+
assert "Response_1" in responses
|
| 540 |
+
assert "Response_2" not in responses
|
| 541 |
+
spec.path("/path", operations={"get": {"responses": {"200": "Response_2"}}})
|
| 542 |
+
responses = get_responses(spec)
|
| 543 |
+
assert "Response_2" in responses
|
| 544 |
+
|
| 545 |
+
def test_parameter_lazy(self, spec):
|
| 546 |
+
parameter = {"format": "int64", "type": "integer"}
|
| 547 |
+
spec.components.parameter("Param_1", "path", parameter, lazy=False)
|
| 548 |
+
spec.components.parameter("Param_2", "path", parameter, lazy=True)
|
| 549 |
+
params = get_parameters(spec)
|
| 550 |
+
assert "Param_1" in params
|
| 551 |
+
assert "Param_2" not in params
|
| 552 |
+
spec.path("/path", operations={"get": {"parameters": ["Param_1", "Param_2"]}})
|
| 553 |
+
assert "Param_2" in params
|
| 554 |
+
|
| 555 |
+
# Referenced headers are only supported in OAS 3.x
|
| 556 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 557 |
+
def test_header_lazy(self, spec):
|
| 558 |
+
header = {"schema": {"type": "string"}}
|
| 559 |
+
spec.components.header("Header_1", header, lazy=False)
|
| 560 |
+
spec.components.header("Header_2", header, lazy=True)
|
| 561 |
+
headers = get_headers(spec)
|
| 562 |
+
assert "Header_1" in headers
|
| 563 |
+
assert "Header_2" not in headers
|
| 564 |
+
spec.path(
|
| 565 |
+
"/path",
|
| 566 |
+
operations={
|
| 567 |
+
"get": {"responses": {"200": {"headers": {"header_2": "Header_2"}}}}
|
| 568 |
+
},
|
| 569 |
+
)
|
| 570 |
+
assert "Header_2" in headers
|
| 571 |
+
|
| 572 |
+
# Referenced examples are only supported in OAS 3.x
|
| 573 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 574 |
+
def test_example_lazy(self, spec):
|
| 575 |
+
spec.components.example("Example_1", {"value": {"a": "b"}}, lazy=False)
|
| 576 |
+
spec.components.example("Example_2", {"value": {"a": "b"}}, lazy=True)
|
| 577 |
+
examples = get_examples(spec)
|
| 578 |
+
assert "Example_1" in examples
|
| 579 |
+
assert "Example_2" not in examples
|
| 580 |
+
spec.path(
|
| 581 |
+
"/path",
|
| 582 |
+
operations={
|
| 583 |
+
"get": {
|
| 584 |
+
"responses": {
|
| 585 |
+
"200": {
|
| 586 |
+
"content": {
|
| 587 |
+
"application/json": {
|
| 588 |
+
"examples": {"example_2": "Example_2"}
|
| 589 |
+
}
|
| 590 |
+
}
|
| 591 |
+
}
|
| 592 |
+
}
|
| 593 |
+
}
|
| 594 |
+
},
|
| 595 |
+
)
|
| 596 |
+
assert "Example_2" in examples
|
| 597 |
+
|
| 598 |
+
|
| 599 |
+
class TestPath(RefsSchemaTestMixin):
|
| 600 |
+
paths = {
|
| 601 |
+
"/pet/{petId}": {
|
| 602 |
+
"get": {
|
| 603 |
+
"parameters": [
|
| 604 |
+
{
|
| 605 |
+
"required": True,
|
| 606 |
+
"format": "int64",
|
| 607 |
+
"name": "petId",
|
| 608 |
+
"in": "path",
|
| 609 |
+
"type": "integer",
|
| 610 |
+
"description": "ID of pet that needs to be fetched",
|
| 611 |
+
}
|
| 612 |
+
],
|
| 613 |
+
"responses": {
|
| 614 |
+
"200": {"description": "successful operation"},
|
| 615 |
+
"400": {"description": "Invalid ID supplied"},
|
| 616 |
+
"404": {"description": "Pet not found"},
|
| 617 |
+
},
|
| 618 |
+
"produces": ["application/json", "application/xml"],
|
| 619 |
+
"operationId": "getPetById",
|
| 620 |
+
"summary": "Find pet by ID",
|
| 621 |
+
"description": (
|
| 622 |
+
"Returns a pet when ID < 10. "
|
| 623 |
+
"ID > 10 or nonintegers will simulate API error conditions"
|
| 624 |
+
),
|
| 625 |
+
"tags": ["pet"],
|
| 626 |
+
}
|
| 627 |
+
}
|
| 628 |
+
}
|
| 629 |
+
|
| 630 |
+
def test_path(self, spec):
|
| 631 |
+
route_spec = self.paths["/pet/{petId}"]["get"]
|
| 632 |
+
spec.path(
|
| 633 |
+
path="/pet/{petId}",
|
| 634 |
+
operations=dict(
|
| 635 |
+
get=dict(
|
| 636 |
+
parameters=route_spec["parameters"],
|
| 637 |
+
responses=route_spec["responses"],
|
| 638 |
+
produces=route_spec["produces"],
|
| 639 |
+
operationId=route_spec["operationId"],
|
| 640 |
+
summary=route_spec["summary"],
|
| 641 |
+
description=route_spec["description"],
|
| 642 |
+
tags=route_spec["tags"],
|
| 643 |
+
)
|
| 644 |
+
),
|
| 645 |
+
)
|
| 646 |
+
|
| 647 |
+
p = get_paths(spec)["/pet/{petId}"]["get"]
|
| 648 |
+
assert p["parameters"] == route_spec["parameters"]
|
| 649 |
+
assert p["responses"] == route_spec["responses"]
|
| 650 |
+
assert p["operationId"] == route_spec["operationId"]
|
| 651 |
+
assert p["summary"] == route_spec["summary"]
|
| 652 |
+
assert p["description"] == route_spec["description"]
|
| 653 |
+
assert p["tags"] == route_spec["tags"]
|
| 654 |
+
|
| 655 |
+
def test_paths_maintain_order(self, spec):
|
| 656 |
+
spec.path(path="/path1")
|
| 657 |
+
spec.path(path="/path2")
|
| 658 |
+
spec.path(path="/path3")
|
| 659 |
+
spec.path(path="/path4")
|
| 660 |
+
assert list(spec.to_dict()["paths"].keys()) == [
|
| 661 |
+
"/path1",
|
| 662 |
+
"/path2",
|
| 663 |
+
"/path3",
|
| 664 |
+
"/path4",
|
| 665 |
+
]
|
| 666 |
+
|
| 667 |
+
def test_path_is_chainable(self, spec):
|
| 668 |
+
spec.path(path="/path1").path("/path2")
|
| 669 |
+
assert list(spec.to_dict()["paths"].keys()) == ["/path1", "/path2"]
|
| 670 |
+
|
| 671 |
+
def test_path_methods_maintain_order(self, spec):
|
| 672 |
+
methods = ["get", "post", "put", "patch", "delete", "head", "options"]
|
| 673 |
+
for method in methods:
|
| 674 |
+
spec.path(path="/path", operations={method: {}})
|
| 675 |
+
assert list(spec.to_dict()["paths"]["/path"]) == methods
|
| 676 |
+
|
| 677 |
+
def test_path_merges_paths(self, spec):
|
| 678 |
+
"""Test that adding a second HTTP method to an existing path performs
|
| 679 |
+
a merge operation instead of an overwrite"""
|
| 680 |
+
path = "/pet/{petId}"
|
| 681 |
+
route_spec = self.paths[path]["get"]
|
| 682 |
+
spec.path(path=path, operations=dict(get=route_spec))
|
| 683 |
+
spec.path(
|
| 684 |
+
path=path,
|
| 685 |
+
operations=dict(
|
| 686 |
+
put=dict(
|
| 687 |
+
parameters=route_spec["parameters"],
|
| 688 |
+
responses=route_spec["responses"],
|
| 689 |
+
produces=route_spec["produces"],
|
| 690 |
+
operationId="updatePet",
|
| 691 |
+
summary="Updates an existing Pet",
|
| 692 |
+
description="Use this method to make changes to Pet `petId`",
|
| 693 |
+
tags=route_spec["tags"],
|
| 694 |
+
)
|
| 695 |
+
),
|
| 696 |
+
)
|
| 697 |
+
|
| 698 |
+
p = get_paths(spec)[path]
|
| 699 |
+
assert "get" in p
|
| 700 |
+
assert "put" in p
|
| 701 |
+
|
| 702 |
+
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0"))
|
| 703 |
+
def test_path_called_twice_with_same_operations_parameters(self, openapi_version):
|
| 704 |
+
"""Test calling path twice with same operations or parameters
|
| 705 |
+
|
| 706 |
+
operations and parameters being mutated by clean_operations and plugin helpers
|
| 707 |
+
should not make path fail on second call
|
| 708 |
+
"""
|
| 709 |
+
|
| 710 |
+
class TestPlugin(BasePlugin):
|
| 711 |
+
def path_helper(self, path, operations, parameters, **kwargs):
|
| 712 |
+
"""Mutate operations and parameters"""
|
| 713 |
+
operations.update({"post": {"responses": {"201": "201ResponseRef"}}})
|
| 714 |
+
parameters.append("ParamRef_3")
|
| 715 |
+
return path
|
| 716 |
+
|
| 717 |
+
spec = APISpec(
|
| 718 |
+
title="Swagger Petstore",
|
| 719 |
+
version="1.0.0",
|
| 720 |
+
openapi_version=openapi_version,
|
| 721 |
+
plugins=[TestPlugin()],
|
| 722 |
+
)
|
| 723 |
+
|
| 724 |
+
path = "/pet/{petId}"
|
| 725 |
+
parameters = ["ParamRef_1"]
|
| 726 |
+
operation = {
|
| 727 |
+
"parameters": ["ParamRef_2"],
|
| 728 |
+
"responses": {"200": "200ResponseRef"},
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
+
spec.path(path=path, operations={"get": operation}, parameters=parameters)
|
| 732 |
+
spec.path(path=path, operations={"put": operation}, parameters=parameters)
|
| 733 |
+
operations = (get_paths(spec))[path]
|
| 734 |
+
assert (
|
| 735 |
+
operations["get"]
|
| 736 |
+
== operations["put"]
|
| 737 |
+
== {
|
| 738 |
+
"parameters": [build_ref(spec, "parameter", "ParamRef_2")],
|
| 739 |
+
"responses": {"200": build_ref(spec, "response", "200ResponseRef")},
|
| 740 |
+
}
|
| 741 |
+
)
|
| 742 |
+
assert operations["parameters"] == [
|
| 743 |
+
build_ref(spec, "parameter", "ParamRef_1"),
|
| 744 |
+
build_ref(spec, "parameter", "ParamRef_3"),
|
| 745 |
+
]
|
| 746 |
+
|
| 747 |
+
def test_path_ensures_path_parameters_required(self, spec):
|
| 748 |
+
path = "/pet/{petId}"
|
| 749 |
+
spec.path(
|
| 750 |
+
path=path,
|
| 751 |
+
operations=dict(put=dict(parameters=[{"name": "petId", "in": "path"}])),
|
| 752 |
+
)
|
| 753 |
+
assert get_paths(spec)[path]["put"]["parameters"][0]["required"] is True
|
| 754 |
+
|
| 755 |
+
def test_path_with_no_path_raises_error(self, spec):
|
| 756 |
+
message = "Path template is not specified"
|
| 757 |
+
with pytest.raises(APISpecError, match=message):
|
| 758 |
+
spec.path()
|
| 759 |
+
|
| 760 |
+
def test_path_summary_description(self, spec):
|
| 761 |
+
summary = "Operations on a Pet"
|
| 762 |
+
description = "Operations on a Pet identified by its ID"
|
| 763 |
+
spec.path(path="/pet/{petId}", summary=summary, description=description)
|
| 764 |
+
|
| 765 |
+
p = get_paths(spec)["/pet/{petId}"]
|
| 766 |
+
assert p["summary"] == summary
|
| 767 |
+
assert p["description"] == description
|
| 768 |
+
|
| 769 |
+
def test_path_resolves_parameter(self, spec):
|
| 770 |
+
route_spec = self.paths["/pet/{petId}"]["get"]
|
| 771 |
+
spec.components.parameter("test_parameter", "path", route_spec["parameters"][0])
|
| 772 |
+
spec.path(
|
| 773 |
+
path="/pet/{petId}", operations={"get": {"parameters": ["test_parameter"]}}
|
| 774 |
+
)
|
| 775 |
+
p = get_paths(spec)["/pet/{petId}"]["get"]
|
| 776 |
+
assert p["parameters"][0] == build_ref(spec, "parameter", "test_parameter")
|
| 777 |
+
|
| 778 |
+
@pytest.mark.parametrize(
|
| 779 |
+
"parameters",
|
| 780 |
+
([{"name": "petId"}], [{"in": "path"}]), # missing "in" # missing "name"
|
| 781 |
+
)
|
| 782 |
+
def test_path_invalid_parameter(self, spec, parameters):
|
| 783 |
+
path = "/pet/{petId}"
|
| 784 |
+
|
| 785 |
+
with pytest.raises(InvalidParameterError):
|
| 786 |
+
spec.path(path=path, operations=dict(put={}, get={}), parameters=parameters)
|
| 787 |
+
|
| 788 |
+
def test_parameter_duplicate(self, spec):
|
| 789 |
+
spec.path(
|
| 790 |
+
path="/pet/{petId}",
|
| 791 |
+
operations={
|
| 792 |
+
"get": {
|
| 793 |
+
"parameters": [
|
| 794 |
+
{"name": "petId", "in": "path"},
|
| 795 |
+
{"name": "petId", "in": "query"},
|
| 796 |
+
]
|
| 797 |
+
}
|
| 798 |
+
},
|
| 799 |
+
)
|
| 800 |
+
|
| 801 |
+
with pytest.raises(DuplicateParameterError):
|
| 802 |
+
spec.path(
|
| 803 |
+
path="/pet/{petId}",
|
| 804 |
+
operations={
|
| 805 |
+
"get": {
|
| 806 |
+
"parameters": [
|
| 807 |
+
{"name": "petId", "in": "path"},
|
| 808 |
+
{"name": "petId", "in": "path"},
|
| 809 |
+
]
|
| 810 |
+
}
|
| 811 |
+
},
|
| 812 |
+
)
|
| 813 |
+
|
| 814 |
+
def test_global_parameters(self, spec):
|
| 815 |
+
path = "/pet/{petId}"
|
| 816 |
+
route_spec = self.paths["/pet/{petId}"]["get"]
|
| 817 |
+
|
| 818 |
+
spec.components.parameter("test_parameter", "path", route_spec["parameters"][0])
|
| 819 |
+
spec.path(
|
| 820 |
+
path=path,
|
| 821 |
+
operations=dict(put={}, get={}),
|
| 822 |
+
parameters=[{"name": "petId", "in": "path"}, "test_parameter"],
|
| 823 |
+
)
|
| 824 |
+
|
| 825 |
+
assert get_paths(spec)[path]["parameters"] == [
|
| 826 |
+
{"name": "petId", "in": "path", "required": True},
|
| 827 |
+
build_ref(spec, "parameter", "test_parameter"),
|
| 828 |
+
]
|
| 829 |
+
|
| 830 |
+
def test_global_parameter_duplicate(self, spec):
|
| 831 |
+
path = "/pet/{petId}"
|
| 832 |
+
spec.path(
|
| 833 |
+
path=path,
|
| 834 |
+
operations=dict(put={}, get={}),
|
| 835 |
+
parameters=[
|
| 836 |
+
{"name": "petId", "in": "path"},
|
| 837 |
+
{"name": "petId", "in": "query"},
|
| 838 |
+
],
|
| 839 |
+
)
|
| 840 |
+
|
| 841 |
+
assert get_paths(spec)[path]["parameters"] == [
|
| 842 |
+
{"name": "petId", "in": "path", "required": True},
|
| 843 |
+
{"name": "petId", "in": "query"},
|
| 844 |
+
]
|
| 845 |
+
|
| 846 |
+
with pytest.raises(DuplicateParameterError):
|
| 847 |
+
spec.path(
|
| 848 |
+
path=path,
|
| 849 |
+
operations=dict(put={}, get={}),
|
| 850 |
+
parameters=[
|
| 851 |
+
{"name": "petId", "in": "path"},
|
| 852 |
+
{"name": "petId", "in": "path"},
|
| 853 |
+
"test_parameter",
|
| 854 |
+
],
|
| 855 |
+
)
|
| 856 |
+
|
| 857 |
+
def test_path_resolves_response(self, spec):
|
| 858 |
+
route_spec = self.paths["/pet/{petId}"]["get"]
|
| 859 |
+
spec.components.response("test_response", route_spec["responses"]["200"])
|
| 860 |
+
spec.path(
|
| 861 |
+
path="/pet/{petId}",
|
| 862 |
+
operations={"get": {"responses": {"200": "test_response"}}},
|
| 863 |
+
)
|
| 864 |
+
p = get_paths(spec)["/pet/{petId}"]["get"]
|
| 865 |
+
assert p["responses"]["200"] == build_ref(spec, "response", "test_response")
|
| 866 |
+
|
| 867 |
+
def test_path_response_with_HTTPStatus_code(self, spec):
|
| 868 |
+
code = HTTPStatus(200)
|
| 869 |
+
spec.path(
|
| 870 |
+
path="/pet/{petId}",
|
| 871 |
+
operations={"get": {"responses": {code: "test_response"}}},
|
| 872 |
+
)
|
| 873 |
+
|
| 874 |
+
assert "200" in get_paths(spec)["/pet/{petId}"]["get"]["responses"]
|
| 875 |
+
|
| 876 |
+
def test_path_response_with_status_code_range(self, spec, recwarn):
|
| 877 |
+
status_code = "2XX"
|
| 878 |
+
|
| 879 |
+
spec.path(
|
| 880 |
+
path="/pet/{petId}",
|
| 881 |
+
operations={"get": {"responses": {status_code: "test_response"}}},
|
| 882 |
+
)
|
| 883 |
+
|
| 884 |
+
if spec.openapi_version.major < 3:
|
| 885 |
+
assert len(recwarn) == 1
|
| 886 |
+
assert recwarn.pop(UserWarning)
|
| 887 |
+
|
| 888 |
+
assert status_code in get_paths(spec)["/pet/{petId}"]["get"]["responses"]
|
| 889 |
+
|
| 890 |
+
def test_path_check_invalid_http_method(self, spec):
|
| 891 |
+
spec.path("/pet/{petId}", operations={"get": {}})
|
| 892 |
+
spec.path("/pet/{petId}", operations={"x-dummy": {}})
|
| 893 |
+
message = "One or more HTTP methods are invalid"
|
| 894 |
+
with pytest.raises(APISpecError, match=message):
|
| 895 |
+
spec.path("/pet/{petId}", operations={"dummy": {}})
|
| 896 |
+
|
| 897 |
+
def test_path_resolve_response_schema(self, spec):
|
| 898 |
+
schema = {"schema": "PetSchema"}
|
| 899 |
+
if spec.openapi_version.major >= 3:
|
| 900 |
+
schema = {"content": {"application/json": schema}}
|
| 901 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}})
|
| 902 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 903 |
+
if spec.openapi_version.major < 3:
|
| 904 |
+
schema = resp["schema"]
|
| 905 |
+
else:
|
| 906 |
+
schema = resp["content"]["application/json"]["schema"]
|
| 907 |
+
assert schema == build_ref(spec, "schema", "PetSchema")
|
| 908 |
+
|
| 909 |
+
# callbacks only exists in OAS 3
|
| 910 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 911 |
+
def test_path_resolve_callbacks(self, spec):
|
| 912 |
+
parameter = {"name": "petId", "in": "query", "schema": "PetSchema"}
|
| 913 |
+
spec.path(
|
| 914 |
+
"/pet/{petId}",
|
| 915 |
+
operations={
|
| 916 |
+
"get": {
|
| 917 |
+
"callbacks": {
|
| 918 |
+
"onEvent": {
|
| 919 |
+
"/callback/{petId}": {
|
| 920 |
+
"post": {
|
| 921 |
+
"parameters": [parameter],
|
| 922 |
+
"requestBody": {
|
| 923 |
+
"content": {
|
| 924 |
+
"application/json": {"schema": "PetSchema"}
|
| 925 |
+
}
|
| 926 |
+
},
|
| 927 |
+
"responses": {
|
| 928 |
+
"200": {
|
| 929 |
+
"content": {
|
| 930 |
+
"application/json": {
|
| 931 |
+
"schema": "PetSchema"
|
| 932 |
+
}
|
| 933 |
+
}
|
| 934 |
+
}
|
| 935 |
+
},
|
| 936 |
+
}
|
| 937 |
+
}
|
| 938 |
+
}
|
| 939 |
+
},
|
| 940 |
+
}
|
| 941 |
+
},
|
| 942 |
+
)
|
| 943 |
+
path = get_paths(spec)["/pet/{petId}"]
|
| 944 |
+
schema_ref = build_ref(spec, "schema", "PetSchema")
|
| 945 |
+
callback_op = path["get"]["callbacks"]["onEvent"]["/callback/{petId}"]["post"]
|
| 946 |
+
assert callback_op["parameters"][0]["schema"] == schema_ref
|
| 947 |
+
assert (
|
| 948 |
+
callback_op["requestBody"]["content"]["application/json"]["schema"]
|
| 949 |
+
== schema_ref
|
| 950 |
+
)
|
| 951 |
+
assert (
|
| 952 |
+
callback_op["responses"]["200"]["content"]["application/json"]["schema"]
|
| 953 |
+
== schema_ref
|
| 954 |
+
)
|
| 955 |
+
|
| 956 |
+
# requestBody only exists in OAS 3
|
| 957 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 958 |
+
def test_path_resolve_request_body(self, spec):
|
| 959 |
+
spec.path(
|
| 960 |
+
"/pet/{petId}",
|
| 961 |
+
operations={
|
| 962 |
+
"get": {
|
| 963 |
+
"requestBody": {
|
| 964 |
+
"content": {"application/json": {"schema": "PetSchema"}}
|
| 965 |
+
}
|
| 966 |
+
}
|
| 967 |
+
},
|
| 968 |
+
)
|
| 969 |
+
assert get_paths(spec)["/pet/{petId}"]["get"]["requestBody"]["content"][
|
| 970 |
+
"application/json"
|
| 971 |
+
]["schema"] == build_ref(spec, "schema", "PetSchema")
|
| 972 |
+
|
| 973 |
+
# "headers" components section only exists in OAS 3
|
| 974 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 975 |
+
def test_path_resolve_response_header(self, spec):
|
| 976 |
+
response = {"headers": {"header_1": "Header_1"}}
|
| 977 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}})
|
| 978 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 979 |
+
header_1 = resp["headers"]["header_1"]
|
| 980 |
+
assert header_1 == build_ref(spec, "header", "Header_1")
|
| 981 |
+
|
| 982 |
+
# "headers" components section only exists in OAS 3
|
| 983 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 984 |
+
def test_path_resolve_response_header_schema(self, spec):
|
| 985 |
+
response = {"headers": {"header_1": {"name": "Pet", "schema": "PetSchema"}}}
|
| 986 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}})
|
| 987 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 988 |
+
header_1 = resp["headers"]["header_1"]
|
| 989 |
+
assert header_1["schema"] == build_ref(spec, "schema", "PetSchema")
|
| 990 |
+
|
| 991 |
+
# "headers" components section only exists in OAS 3
|
| 992 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 993 |
+
def test_path_resolve_response_header_examples(self, spec):
|
| 994 |
+
response = {
|
| 995 |
+
"headers": {
|
| 996 |
+
"header_1": {"name": "Pet", "examples": {"example_1": "Example_1"}}
|
| 997 |
+
}
|
| 998 |
+
}
|
| 999 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}})
|
| 1000 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 1001 |
+
header_1 = resp["headers"]["header_1"]
|
| 1002 |
+
assert header_1["examples"]["example_1"] == build_ref(
|
| 1003 |
+
spec, "example", "Example_1"
|
| 1004 |
+
)
|
| 1005 |
+
|
| 1006 |
+
# "examples" components section only exists in OAS 3
|
| 1007 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 1008 |
+
def test_path_resolve_response_examples(self, spec):
|
| 1009 |
+
response = {
|
| 1010 |
+
"content": {"application/json": {"examples": {"example_1": "Example_1"}}}
|
| 1011 |
+
}
|
| 1012 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": response}}})
|
| 1013 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 1014 |
+
example_1 = resp["content"]["application/json"]["examples"]["example_1"]
|
| 1015 |
+
assert example_1 == build_ref(spec, "example", "Example_1")
|
| 1016 |
+
|
| 1017 |
+
# "examples" components section only exists in OAS 3
|
| 1018 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 1019 |
+
def test_path_resolve_request_body_examples(self, spec):
|
| 1020 |
+
request_body = {
|
| 1021 |
+
"content": {"application/json": {"examples": {"example_1": "Example_1"}}}
|
| 1022 |
+
}
|
| 1023 |
+
spec.path("/pet/{petId}", operations={"get": {"requestBody": request_body}})
|
| 1024 |
+
reqbdy = get_paths(spec)["/pet/{petId}"]["get"]["requestBody"]
|
| 1025 |
+
example_1 = reqbdy["content"]["application/json"]["examples"]["example_1"]
|
| 1026 |
+
assert example_1 == build_ref(spec, "example", "Example_1")
|
| 1027 |
+
|
| 1028 |
+
# "examples" components section only exists in OAS 3
|
| 1029 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 1030 |
+
def test_path_resolve_parameter_examples(self, spec):
|
| 1031 |
+
parameter = {
|
| 1032 |
+
"name": "test",
|
| 1033 |
+
"in": "query",
|
| 1034 |
+
"examples": {"example_1": "Example_1"},
|
| 1035 |
+
}
|
| 1036 |
+
spec.path("/pet/{petId}", operations={"get": {"parameters": [parameter]}})
|
| 1037 |
+
param = get_paths(spec)["/pet/{petId}"]["get"]["parameters"][0]
|
| 1038 |
+
example_1 = param["examples"]["example_1"]
|
| 1039 |
+
assert example_1 == build_ref(spec, "example", "Example_1")
|
| 1040 |
+
|
| 1041 |
+
def test_path_resolve_parameter_schemas(self, spec):
|
| 1042 |
+
parameter = {"name": "test", "in": "query", "schema": "PetSchema"}
|
| 1043 |
+
spec.path("/pet/{petId}", operations={"get": {"parameters": [parameter]}})
|
| 1044 |
+
param = get_paths(spec)["/pet/{petId}"]["get"]["parameters"][0]
|
| 1045 |
+
assert param["schema"] == build_ref(spec, "schema", "PetSchema")
|
| 1046 |
+
|
| 1047 |
+
def test_path_resolve_refs_in_response_schema(self, spec):
|
| 1048 |
+
if spec.openapi_version.major >= 3:
|
| 1049 |
+
schema = {"content": {"application/json": {"schema": self.REFS_SCHEMA}}}
|
| 1050 |
+
else:
|
| 1051 |
+
schema = {"schema": self.REFS_SCHEMA}
|
| 1052 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}})
|
| 1053 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 1054 |
+
if spec.openapi_version.major < 3:
|
| 1055 |
+
schema = resp["schema"]
|
| 1056 |
+
else:
|
| 1057 |
+
schema = resp["content"]["application/json"]["schema"]
|
| 1058 |
+
self.assert_schema_refs(spec, schema)
|
| 1059 |
+
|
| 1060 |
+
def test_path_resolve_refs_in_parameter_schema(self, spec):
|
| 1061 |
+
schema = copy.copy({"schema": self.REFS_SCHEMA})
|
| 1062 |
+
schema["in"] = "query"
|
| 1063 |
+
schema["name"] = "test"
|
| 1064 |
+
spec.path("/pet/{petId}", operations={"get": {"parameters": [schema]}})
|
| 1065 |
+
schema = get_paths(spec)["/pet/{petId}"]["get"]["parameters"][0]["schema"]
|
| 1066 |
+
self.assert_schema_refs(spec, schema)
|
| 1067 |
+
|
| 1068 |
+
# requestBody only exists in OAS 3
|
| 1069 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 1070 |
+
def test_path_resolve_refs_in_request_body_schema(self, spec):
|
| 1071 |
+
schema = {"content": {"application/json": {"schema": self.REFS_SCHEMA}}}
|
| 1072 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}})
|
| 1073 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 1074 |
+
schema = resp["content"]["application/json"]["schema"]
|
| 1075 |
+
self.assert_schema_refs(spec, schema)
|
| 1076 |
+
|
| 1077 |
+
|
| 1078 |
+
class TestPlugins:
|
| 1079 |
+
@staticmethod
|
| 1080 |
+
def make_test_plugin(return_none=False):
|
| 1081 |
+
class TestPlugin(BasePlugin):
|
| 1082 |
+
"""Test Plugin
|
| 1083 |
+
|
| 1084 |
+
return_none allows to check plugin helpers returning ``None``
|
| 1085 |
+
Inputs are mutated to allow testing only a copy is passed.
|
| 1086 |
+
"""
|
| 1087 |
+
|
| 1088 |
+
def schema_helper(self, name, definition, **kwargs):
|
| 1089 |
+
definition.pop("dummy", None)
|
| 1090 |
+
if not return_none:
|
| 1091 |
+
return {"properties": {"name": {"type": "string"}}}
|
| 1092 |
+
|
| 1093 |
+
def parameter_helper(self, parameter, **kwargs):
|
| 1094 |
+
parameter.pop("dummy", None)
|
| 1095 |
+
if not return_none:
|
| 1096 |
+
return {"description": "some parameter"}
|
| 1097 |
+
|
| 1098 |
+
def response_helper(self, response, **kwargs):
|
| 1099 |
+
response.pop("dummy", None)
|
| 1100 |
+
if not return_none:
|
| 1101 |
+
return {"description": "42"}
|
| 1102 |
+
|
| 1103 |
+
def header_helper(self, header, **kwargs):
|
| 1104 |
+
header.pop("dummy", None)
|
| 1105 |
+
if not return_none:
|
| 1106 |
+
return {"description": "some header"}
|
| 1107 |
+
|
| 1108 |
+
def path_helper(self, path, operations, parameters, **kwargs):
|
| 1109 |
+
if not return_none:
|
| 1110 |
+
if path == "/path_1":
|
| 1111 |
+
operations.update({"get": {"responses": {"200": {}}}})
|
| 1112 |
+
parameters.append({"name": "page", "in": "query"})
|
| 1113 |
+
return "/path_1_modified"
|
| 1114 |
+
|
| 1115 |
+
def operation_helper(self, path, operations, **kwargs):
|
| 1116 |
+
if path == "/path_2":
|
| 1117 |
+
operations["post"] = {"responses": {"201": {}}}
|
| 1118 |
+
|
| 1119 |
+
return TestPlugin()
|
| 1120 |
+
|
| 1121 |
+
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0"))
|
| 1122 |
+
@pytest.mark.parametrize("return_none", (True, False))
|
| 1123 |
+
def test_plugin_schema_helper_is_used(self, openapi_version, return_none):
|
| 1124 |
+
spec = APISpec(
|
| 1125 |
+
title="Swagger Petstore",
|
| 1126 |
+
version="1.0.0",
|
| 1127 |
+
openapi_version=openapi_version,
|
| 1128 |
+
plugins=(self.make_test_plugin(return_none),),
|
| 1129 |
+
)
|
| 1130 |
+
schema = {"dummy": "dummy"}
|
| 1131 |
+
spec.components.schema("Pet", schema)
|
| 1132 |
+
definitions = get_schemas(spec)
|
| 1133 |
+
if return_none:
|
| 1134 |
+
assert definitions["Pet"] == {}
|
| 1135 |
+
else:
|
| 1136 |
+
assert definitions["Pet"] == {"properties": {"name": {"type": "string"}}}
|
| 1137 |
+
# Check original schema is not modified
|
| 1138 |
+
assert schema == {"dummy": "dummy"}
|
| 1139 |
+
|
| 1140 |
+
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0"))
|
| 1141 |
+
@pytest.mark.parametrize("return_none", (True, False))
|
| 1142 |
+
def test_plugin_parameter_helper_is_used(self, openapi_version, return_none):
|
| 1143 |
+
spec = APISpec(
|
| 1144 |
+
title="Swagger Petstore",
|
| 1145 |
+
version="1.0.0",
|
| 1146 |
+
openapi_version=openapi_version,
|
| 1147 |
+
plugins=(self.make_test_plugin(return_none),),
|
| 1148 |
+
)
|
| 1149 |
+
parameter = {"dummy": "dummy"}
|
| 1150 |
+
spec.components.parameter("Pet", "body", parameter)
|
| 1151 |
+
parameters = get_parameters(spec)
|
| 1152 |
+
if return_none:
|
| 1153 |
+
assert parameters["Pet"] == {"in": "body", "name": "Pet"}
|
| 1154 |
+
else:
|
| 1155 |
+
assert parameters["Pet"] == {
|
| 1156 |
+
"in": "body",
|
| 1157 |
+
"name": "Pet",
|
| 1158 |
+
"description": "some parameter",
|
| 1159 |
+
}
|
| 1160 |
+
# Check original parameter is not modified
|
| 1161 |
+
assert parameter == {"dummy": "dummy"}
|
| 1162 |
+
|
| 1163 |
+
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0"))
|
| 1164 |
+
@pytest.mark.parametrize("return_none", (True, False))
|
| 1165 |
+
def test_plugin_response_helper_is_used(self, openapi_version, return_none):
|
| 1166 |
+
spec = APISpec(
|
| 1167 |
+
title="Swagger Petstore",
|
| 1168 |
+
version="1.0.0",
|
| 1169 |
+
openapi_version=openapi_version,
|
| 1170 |
+
plugins=(self.make_test_plugin(return_none),),
|
| 1171 |
+
)
|
| 1172 |
+
response = {"dummy": "dummy"}
|
| 1173 |
+
spec.components.response("Pet", response)
|
| 1174 |
+
responses = get_responses(spec)
|
| 1175 |
+
if return_none:
|
| 1176 |
+
assert responses["Pet"] == {}
|
| 1177 |
+
else:
|
| 1178 |
+
assert responses["Pet"] == {"description": "42"}
|
| 1179 |
+
# Check original response is not modified
|
| 1180 |
+
assert response == {"dummy": "dummy"}
|
| 1181 |
+
|
| 1182 |
+
@pytest.mark.parametrize("openapi_version", ("3.0.0",))
|
| 1183 |
+
@pytest.mark.parametrize("return_none", (True, False))
|
| 1184 |
+
def test_plugin_header_helper_is_used(self, openapi_version, return_none):
|
| 1185 |
+
spec = APISpec(
|
| 1186 |
+
title="Swagger Petstore",
|
| 1187 |
+
version="1.0.0",
|
| 1188 |
+
openapi_version=openapi_version,
|
| 1189 |
+
plugins=(self.make_test_plugin(return_none),),
|
| 1190 |
+
)
|
| 1191 |
+
header = {"dummy": "dummy"}
|
| 1192 |
+
spec.components.header("Pet", header)
|
| 1193 |
+
headers = get_headers(spec)
|
| 1194 |
+
if return_none:
|
| 1195 |
+
assert headers["Pet"] == {}
|
| 1196 |
+
else:
|
| 1197 |
+
assert headers["Pet"] == {
|
| 1198 |
+
"description": "some header",
|
| 1199 |
+
}
|
| 1200 |
+
# Check original header is not modified
|
| 1201 |
+
assert header == {"dummy": "dummy"}
|
| 1202 |
+
|
| 1203 |
+
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0"))
|
| 1204 |
+
@pytest.mark.parametrize("return_none", (True, False))
|
| 1205 |
+
def test_plugin_path_helper_is_used(self, openapi_version, return_none):
|
| 1206 |
+
spec = APISpec(
|
| 1207 |
+
title="Swagger Petstore",
|
| 1208 |
+
version="1.0.0",
|
| 1209 |
+
openapi_version=openapi_version,
|
| 1210 |
+
plugins=(self.make_test_plugin(return_none),),
|
| 1211 |
+
)
|
| 1212 |
+
spec.path("/path_1")
|
| 1213 |
+
paths = get_paths(spec)
|
| 1214 |
+
assert len(paths) == 1
|
| 1215 |
+
if return_none:
|
| 1216 |
+
assert paths["/path_1"] == {}
|
| 1217 |
+
else:
|
| 1218 |
+
assert paths["/path_1_modified"] == {
|
| 1219 |
+
"get": {"responses": {"200": {}}},
|
| 1220 |
+
"parameters": [{"in": "query", "name": "page"}],
|
| 1221 |
+
}
|
| 1222 |
+
|
| 1223 |
+
@pytest.mark.parametrize("openapi_version", ("2.0", "3.0.0"))
|
| 1224 |
+
def test_plugin_operation_helper_is_used(self, openapi_version):
|
| 1225 |
+
spec = APISpec(
|
| 1226 |
+
title="Swagger Petstore",
|
| 1227 |
+
version="1.0.0",
|
| 1228 |
+
openapi_version=openapi_version,
|
| 1229 |
+
plugins=(self.make_test_plugin(),),
|
| 1230 |
+
)
|
| 1231 |
+
spec.path("/path_2", operations={"post": {"responses": {"200": {}}}})
|
| 1232 |
+
paths = get_paths(spec)
|
| 1233 |
+
assert len(paths) == 1
|
| 1234 |
+
assert paths["/path_2"] == {"post": {"responses": {"201": {}}}}
|
| 1235 |
+
|
| 1236 |
+
|
| 1237 |
+
class TestPluginsOrder:
|
| 1238 |
+
class OrderedPlugin(BasePlugin):
|
| 1239 |
+
def __init__(self, index, output):
|
| 1240 |
+
super().__init__()
|
| 1241 |
+
self.index = index
|
| 1242 |
+
self.output = output
|
| 1243 |
+
|
| 1244 |
+
def path_helper(self, path, operations, **kwargs):
|
| 1245 |
+
self.output.append(f"plugin_{self.index}_path")
|
| 1246 |
+
|
| 1247 |
+
def operation_helper(self, path, operations, **kwargs):
|
| 1248 |
+
self.output.append(f"plugin_{self.index}_operations")
|
| 1249 |
+
|
| 1250 |
+
def test_plugins_order(self):
|
| 1251 |
+
"""Test plugins execution order in APISpec.path
|
| 1252 |
+
|
| 1253 |
+
- All path helpers are called, then all operation helpers, then all response helpers.
|
| 1254 |
+
- At each step, helpers are executed in the order the plugins are passed to APISpec.
|
| 1255 |
+
"""
|
| 1256 |
+
output = []
|
| 1257 |
+
spec = APISpec(
|
| 1258 |
+
title="Swagger Petstore",
|
| 1259 |
+
version="1.0.0",
|
| 1260 |
+
openapi_version="3.0.0",
|
| 1261 |
+
plugins=(self.OrderedPlugin(1, output), self.OrderedPlugin(2, output)),
|
| 1262 |
+
)
|
| 1263 |
+
spec.path("/path", operations={"get": {"responses": {200: {}}}})
|
| 1264 |
+
assert output == [
|
| 1265 |
+
"plugin_1_path",
|
| 1266 |
+
"plugin_2_path",
|
| 1267 |
+
"plugin_1_operations",
|
| 1268 |
+
"plugin_2_operations",
|
| 1269 |
+
]
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow.py
ADDED
|
@@ -0,0 +1,1342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
|
| 3 |
+
import pytest
|
| 4 |
+
from marshmallow import Schema
|
| 5 |
+
from marshmallow.fields import DateTime, Dict, Field, List, Nested, String, TimeDelta
|
| 6 |
+
|
| 7 |
+
from apispec import APISpec
|
| 8 |
+
from apispec.exceptions import APISpecError
|
| 9 |
+
from apispec.ext.marshmallow import MarshmallowPlugin, common
|
| 10 |
+
|
| 11 |
+
from .schemas import (
|
| 12 |
+
AnalysisSchema,
|
| 13 |
+
AnalysisWithListSchema,
|
| 14 |
+
DefaultValuesSchema,
|
| 15 |
+
OrderedSchema,
|
| 16 |
+
PatternedObjectSchema,
|
| 17 |
+
PetSchema,
|
| 18 |
+
RunSchema,
|
| 19 |
+
SampleSchema,
|
| 20 |
+
SelfReferencingSchema,
|
| 21 |
+
)
|
| 22 |
+
from .utils import (
|
| 23 |
+
build_ref,
|
| 24 |
+
get_headers,
|
| 25 |
+
get_parameters,
|
| 26 |
+
get_paths,
|
| 27 |
+
get_responses,
|
| 28 |
+
get_schemas,
|
| 29 |
+
)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class TestDefinitionHelper:
|
| 33 |
+
@pytest.mark.parametrize("schema", [PetSchema, PetSchema()])
|
| 34 |
+
def test_can_use_schema_as_definition(self, spec, schema):
|
| 35 |
+
spec.components.schema("Pet", schema=schema)
|
| 36 |
+
definitions = get_schemas(spec)
|
| 37 |
+
props = definitions["Pet"]["properties"]
|
| 38 |
+
|
| 39 |
+
assert props["id"]["type"] == "integer"
|
| 40 |
+
assert props["name"]["type"] == "string"
|
| 41 |
+
|
| 42 |
+
def test_schema_helper_without_schema(self, spec):
|
| 43 |
+
spec.components.schema("Pet", {"properties": {"key": {"type": "integer"}}})
|
| 44 |
+
definitions = get_schemas(spec)
|
| 45 |
+
assert definitions["Pet"]["properties"] == {"key": {"type": "integer"}}
|
| 46 |
+
|
| 47 |
+
@pytest.mark.parametrize("schema", [AnalysisSchema, AnalysisSchema()])
|
| 48 |
+
def test_resolve_schema_dict_auto_reference(self, schema):
|
| 49 |
+
def resolver(schema):
|
| 50 |
+
schema_cls = common.resolve_schema_cls(schema)
|
| 51 |
+
return schema_cls.__name__
|
| 52 |
+
|
| 53 |
+
spec = APISpec(
|
| 54 |
+
title="Test auto-reference",
|
| 55 |
+
version="0.1",
|
| 56 |
+
openapi_version="2.0",
|
| 57 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 58 |
+
)
|
| 59 |
+
with pytest.raises(KeyError):
|
| 60 |
+
get_schemas(spec)
|
| 61 |
+
|
| 62 |
+
spec.components.schema("analysis", schema=schema)
|
| 63 |
+
spec.path(
|
| 64 |
+
"/test",
|
| 65 |
+
operations={
|
| 66 |
+
"get": {
|
| 67 |
+
"responses": {
|
| 68 |
+
"200": {"schema": build_ref(spec, "schema", "analysis")}
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
)
|
| 73 |
+
definitions = get_schemas(spec)
|
| 74 |
+
assert 3 == len(definitions)
|
| 75 |
+
|
| 76 |
+
assert "analysis" in definitions
|
| 77 |
+
assert "SampleSchema" in definitions
|
| 78 |
+
assert "RunSchema" in definitions
|
| 79 |
+
|
| 80 |
+
@pytest.mark.parametrize(
|
| 81 |
+
"schema", [AnalysisWithListSchema, AnalysisWithListSchema()]
|
| 82 |
+
)
|
| 83 |
+
def test_resolve_schema_dict_auto_reference_in_list(self, schema):
|
| 84 |
+
def resolver(schema):
|
| 85 |
+
schema_cls = common.resolve_schema_cls(schema)
|
| 86 |
+
return schema_cls.__name__
|
| 87 |
+
|
| 88 |
+
spec = APISpec(
|
| 89 |
+
title="Test auto-reference",
|
| 90 |
+
version="0.1",
|
| 91 |
+
openapi_version="2.0",
|
| 92 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 93 |
+
)
|
| 94 |
+
with pytest.raises(KeyError):
|
| 95 |
+
get_schemas(spec)
|
| 96 |
+
|
| 97 |
+
spec.components.schema("analysis", schema=schema)
|
| 98 |
+
spec.path(
|
| 99 |
+
"/test",
|
| 100 |
+
operations={
|
| 101 |
+
"get": {
|
| 102 |
+
"responses": {
|
| 103 |
+
"200": {"schema": build_ref(spec, "schema", "analysis")}
|
| 104 |
+
}
|
| 105 |
+
}
|
| 106 |
+
},
|
| 107 |
+
)
|
| 108 |
+
definitions = get_schemas(spec)
|
| 109 |
+
assert 3 == len(definitions)
|
| 110 |
+
|
| 111 |
+
assert "analysis" in definitions
|
| 112 |
+
assert "SampleSchema" in definitions
|
| 113 |
+
assert "RunSchema" in definitions
|
| 114 |
+
|
| 115 |
+
@pytest.mark.parametrize("schema", [AnalysisSchema, AnalysisSchema()])
|
| 116 |
+
def test_resolve_schema_dict_auto_reference_return_none(self, schema):
|
| 117 |
+
def resolver(schema):
|
| 118 |
+
return None
|
| 119 |
+
|
| 120 |
+
spec = APISpec(
|
| 121 |
+
title="Test auto-reference",
|
| 122 |
+
version="0.1",
|
| 123 |
+
openapi_version="2.0",
|
| 124 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 125 |
+
)
|
| 126 |
+
with pytest.raises(KeyError):
|
| 127 |
+
get_schemas(spec)
|
| 128 |
+
|
| 129 |
+
with pytest.raises(
|
| 130 |
+
APISpecError, match="Name resolver returned None for schema"
|
| 131 |
+
):
|
| 132 |
+
spec.components.schema("analysis", schema=schema)
|
| 133 |
+
|
| 134 |
+
@pytest.mark.parametrize("schema", [AnalysisSchema, AnalysisSchema()])
|
| 135 |
+
def test_warning_when_schema_added_twice(self, spec, schema):
|
| 136 |
+
spec.components.schema("Analysis", schema=schema)
|
| 137 |
+
with pytest.warns(UserWarning, match="has already been added to the spec"):
|
| 138 |
+
spec.components.schema("DuplicateAnalysis", schema=schema)
|
| 139 |
+
|
| 140 |
+
def test_schema_instances_with_different_modifiers_added(self, spec):
|
| 141 |
+
class MultiModifierSchema(Schema):
|
| 142 |
+
pet_unmodified = Nested(PetSchema)
|
| 143 |
+
pet_exclude = Nested(PetSchema, exclude=("name",))
|
| 144 |
+
|
| 145 |
+
spec.components.schema("Pet", schema=PetSchema())
|
| 146 |
+
spec.components.schema("Pet_Exclude", schema=PetSchema(exclude=("name",)))
|
| 147 |
+
|
| 148 |
+
spec.components.schema("MultiModifierSchema", schema=MultiModifierSchema)
|
| 149 |
+
|
| 150 |
+
definitions = get_schemas(spec)
|
| 151 |
+
pet_unmodified_ref = definitions["MultiModifierSchema"]["properties"][
|
| 152 |
+
"pet_unmodified"
|
| 153 |
+
]
|
| 154 |
+
assert pet_unmodified_ref == build_ref(spec, "schema", "Pet")
|
| 155 |
+
|
| 156 |
+
pet_exclude = definitions["MultiModifierSchema"]["properties"]["pet_exclude"]
|
| 157 |
+
assert pet_exclude == build_ref(spec, "schema", "Pet_Exclude")
|
| 158 |
+
|
| 159 |
+
def test_schema_instance_with_different_modifers_custom_resolver(self, recwarn):
|
| 160 |
+
class MultiModifierSchema(Schema):
|
| 161 |
+
pet_unmodified = Nested(PetSchema)
|
| 162 |
+
pet_exclude = Nested(PetSchema(partial=True))
|
| 163 |
+
|
| 164 |
+
def resolver(schema):
|
| 165 |
+
schema_instance = common.resolve_schema_instance(schema)
|
| 166 |
+
prefix = "Partial-" if schema_instance.partial else ""
|
| 167 |
+
schema_cls = common.resolve_schema_cls(schema)
|
| 168 |
+
name = prefix + schema_cls.__name__
|
| 169 |
+
if name.endswith("Schema"):
|
| 170 |
+
return name[:-6] or name
|
| 171 |
+
return name
|
| 172 |
+
|
| 173 |
+
spec = APISpec(
|
| 174 |
+
title="Test Custom Resolver for Partial",
|
| 175 |
+
version="0.1",
|
| 176 |
+
openapi_version="2.0",
|
| 177 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 178 |
+
)
|
| 179 |
+
|
| 180 |
+
spec.components.schema("NameClashSchema", schema=MultiModifierSchema)
|
| 181 |
+
assert not recwarn
|
| 182 |
+
|
| 183 |
+
def test_schema_with_clashing_names(self, spec):
|
| 184 |
+
class Pet(PetSchema):
|
| 185 |
+
another_field = String()
|
| 186 |
+
|
| 187 |
+
class NameClashSchema(Schema):
|
| 188 |
+
pet_1 = Nested(PetSchema)
|
| 189 |
+
pet_2 = Nested(Pet)
|
| 190 |
+
|
| 191 |
+
with pytest.warns(
|
| 192 |
+
UserWarning, match="Multiple schemas resolved to the name Pet"
|
| 193 |
+
):
|
| 194 |
+
spec.components.schema("NameClashSchema", schema=NameClashSchema)
|
| 195 |
+
|
| 196 |
+
definitions = get_schemas(spec)
|
| 197 |
+
|
| 198 |
+
assert "Pet" in definitions
|
| 199 |
+
assert "Pet1" in definitions
|
| 200 |
+
|
| 201 |
+
def test_resolve_nested_schema_many_true_resolver_return_none(self):
|
| 202 |
+
def resolver(schema):
|
| 203 |
+
return None
|
| 204 |
+
|
| 205 |
+
class PetFamilySchema(Schema):
|
| 206 |
+
pets_1 = Nested(PetSchema, many=True)
|
| 207 |
+
pets_2 = List(Nested(PetSchema))
|
| 208 |
+
|
| 209 |
+
spec = APISpec(
|
| 210 |
+
title="Test auto-reference",
|
| 211 |
+
version="0.1",
|
| 212 |
+
openapi_version="2.0",
|
| 213 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 214 |
+
)
|
| 215 |
+
|
| 216 |
+
spec.components.schema("PetFamily", schema=PetFamilySchema)
|
| 217 |
+
props = get_schemas(spec)["PetFamily"]["properties"]
|
| 218 |
+
pets_1 = props["pets_1"]
|
| 219 |
+
pets_2 = props["pets_2"]
|
| 220 |
+
assert pets_1["type"] == pets_2["type"] == "array"
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
class TestComponentParameterHelper:
|
| 224 |
+
@pytest.mark.parametrize("schema", [PetSchema, PetSchema()])
|
| 225 |
+
def test_can_use_schema_in_parameter(self, spec, schema):
|
| 226 |
+
param = {"schema": schema}
|
| 227 |
+
spec.components.parameter("Pet", "body", param)
|
| 228 |
+
parameter = get_parameters(spec)["Pet"]
|
| 229 |
+
assert parameter["in"] == "body"
|
| 230 |
+
reference = parameter["schema"]
|
| 231 |
+
assert reference == build_ref(spec, "schema", "Pet")
|
| 232 |
+
|
| 233 |
+
resolved_schema = spec.components.schemas["Pet"]
|
| 234 |
+
assert resolved_schema["properties"]["name"]["type"] == "string"
|
| 235 |
+
assert resolved_schema["properties"]["password"]["type"] == "string"
|
| 236 |
+
assert resolved_schema["properties"]["id"]["type"] == "integer"
|
| 237 |
+
|
| 238 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 239 |
+
@pytest.mark.parametrize("schema", [PetSchema, PetSchema()])
|
| 240 |
+
def test_can_use_schema_in_parameter_with_content(self, spec, schema):
|
| 241 |
+
param = {"content": {"application/json": {"schema": schema}}}
|
| 242 |
+
spec.components.parameter("Pet", "body", param)
|
| 243 |
+
parameter = get_parameters(spec)["Pet"]
|
| 244 |
+
assert parameter["in"] == "body"
|
| 245 |
+
reference = parameter["content"]["application/json"]["schema"]
|
| 246 |
+
assert reference == build_ref(spec, "schema", "Pet")
|
| 247 |
+
|
| 248 |
+
resolved_schema = spec.components.schemas["Pet"]
|
| 249 |
+
assert resolved_schema["properties"]["name"]["type"] == "string"
|
| 250 |
+
assert resolved_schema["properties"]["password"]["type"] == "string"
|
| 251 |
+
assert resolved_schema["properties"]["id"]["type"] == "integer"
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
class TestComponentResponseHelper:
|
| 255 |
+
@pytest.mark.parametrize("schema", [PetSchema, PetSchema()])
|
| 256 |
+
def test_can_use_schema_in_response(self, spec, schema):
|
| 257 |
+
if spec.openapi_version.major < 3:
|
| 258 |
+
resp = {"schema": schema}
|
| 259 |
+
else:
|
| 260 |
+
resp = {"content": {"application/json": {"schema": schema}}}
|
| 261 |
+
spec.components.response("GetPetOk", resp)
|
| 262 |
+
response = get_responses(spec)["GetPetOk"]
|
| 263 |
+
if spec.openapi_version.major < 3:
|
| 264 |
+
reference = response["schema"]
|
| 265 |
+
else:
|
| 266 |
+
reference = response["content"]["application/json"]["schema"]
|
| 267 |
+
assert reference == build_ref(spec, "schema", "Pet")
|
| 268 |
+
|
| 269 |
+
resolved_schema = spec.components.schemas["Pet"]
|
| 270 |
+
assert resolved_schema["properties"]["id"]["type"] == "integer"
|
| 271 |
+
assert resolved_schema["properties"]["name"]["type"] == "string"
|
| 272 |
+
assert resolved_schema["properties"]["password"]["type"] == "string"
|
| 273 |
+
|
| 274 |
+
@pytest.mark.parametrize("schema", [PetSchema, PetSchema()])
|
| 275 |
+
def test_can_use_schema_in_response_header(self, spec, schema):
|
| 276 |
+
resp = {"headers": {"PetHeader": {"schema": schema}}}
|
| 277 |
+
spec.components.response("GetPetOk", resp)
|
| 278 |
+
response = get_responses(spec)["GetPetOk"]
|
| 279 |
+
reference = response["headers"]["PetHeader"]["schema"]
|
| 280 |
+
assert reference == build_ref(spec, "schema", "Pet")
|
| 281 |
+
|
| 282 |
+
resolved_schema = spec.components.schemas["Pet"]
|
| 283 |
+
assert resolved_schema["properties"]["id"]["type"] == "integer"
|
| 284 |
+
assert resolved_schema["properties"]["name"]["type"] == "string"
|
| 285 |
+
assert resolved_schema["properties"]["password"]["type"] == "string"
|
| 286 |
+
|
| 287 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 288 |
+
def test_content_without_schema(self, spec):
|
| 289 |
+
resp = {"content": {"application/json": {"example": {"name": "Example"}}}}
|
| 290 |
+
spec.components.response("GetPetOk", resp)
|
| 291 |
+
response = get_responses(spec)["GetPetOk"]
|
| 292 |
+
assert response == resp
|
| 293 |
+
|
| 294 |
+
|
| 295 |
+
class TestComponentHeaderHelper:
|
| 296 |
+
@pytest.mark.parametrize("spec", ("3.0.0",), indirect=True)
|
| 297 |
+
@pytest.mark.parametrize("schema", [PetSchema, PetSchema()])
|
| 298 |
+
def test_can_use_schema_in_header(self, spec, schema):
|
| 299 |
+
param = {"schema": schema}
|
| 300 |
+
spec.components.header("Pet", param)
|
| 301 |
+
header = get_headers(spec)["Pet"]
|
| 302 |
+
reference = header["schema"]
|
| 303 |
+
assert reference == build_ref(spec, "schema", "Pet")
|
| 304 |
+
|
| 305 |
+
resolved_schema = spec.components.schemas["Pet"]
|
| 306 |
+
assert resolved_schema["properties"]["name"]["type"] == "string"
|
| 307 |
+
assert resolved_schema["properties"]["password"]["type"] == "string"
|
| 308 |
+
assert resolved_schema["properties"]["id"]["type"] == "integer"
|
| 309 |
+
|
| 310 |
+
|
| 311 |
+
class TestCustomField:
|
| 312 |
+
def test_can_use_custom_field_decorator(self, spec_fixture):
|
| 313 |
+
class CustomNameA(Field):
|
| 314 |
+
pass
|
| 315 |
+
|
| 316 |
+
spec_fixture.marshmallow_plugin.map_to_openapi_type(CustomNameA, DateTime)
|
| 317 |
+
|
| 318 |
+
class CustomNameB(Field):
|
| 319 |
+
pass
|
| 320 |
+
|
| 321 |
+
spec_fixture.marshmallow_plugin.map_to_openapi_type(
|
| 322 |
+
CustomNameB, "integer", "int32"
|
| 323 |
+
)
|
| 324 |
+
|
| 325 |
+
class BadCustomField(Field):
|
| 326 |
+
pass
|
| 327 |
+
|
| 328 |
+
with pytest.raises(TypeError):
|
| 329 |
+
spec_fixture.marshmallow_plugin.map_to_openapi_type(
|
| 330 |
+
BadCustomField, "integer"
|
| 331 |
+
)
|
| 332 |
+
|
| 333 |
+
class CustomPetASchema(PetSchema):
|
| 334 |
+
name = CustomNameA()
|
| 335 |
+
|
| 336 |
+
class CustomPetBSchema(PetSchema):
|
| 337 |
+
name = CustomNameB()
|
| 338 |
+
|
| 339 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 340 |
+
spec_fixture.spec.components.schema("CustomPetA", schema=CustomPetASchema)
|
| 341 |
+
spec_fixture.spec.components.schema("CustomPetB", schema=CustomPetBSchema)
|
| 342 |
+
|
| 343 |
+
props_0 = get_schemas(spec_fixture.spec)["Pet"]["properties"]
|
| 344 |
+
props_a = get_schemas(spec_fixture.spec)["CustomPetA"]["properties"]
|
| 345 |
+
props_b = get_schemas(spec_fixture.spec)["CustomPetB"]["properties"]
|
| 346 |
+
|
| 347 |
+
assert props_0["name"]["type"] == "string"
|
| 348 |
+
assert "format" not in props_0["name"]
|
| 349 |
+
|
| 350 |
+
assert props_a["name"]["type"] == "string"
|
| 351 |
+
assert props_a["name"]["format"] == "date-time"
|
| 352 |
+
|
| 353 |
+
assert props_b["name"]["type"] == "integer"
|
| 354 |
+
assert props_b["name"]["format"] == "int32"
|
| 355 |
+
|
| 356 |
+
|
| 357 |
+
def get_nested_schema(schema, field_name):
|
| 358 |
+
try:
|
| 359 |
+
return schema._declared_fields[field_name]._schema
|
| 360 |
+
except AttributeError:
|
| 361 |
+
return schema._declared_fields[field_name]._Nested__schema
|
| 362 |
+
|
| 363 |
+
|
| 364 |
+
class TestOperationHelper:
|
| 365 |
+
@pytest.fixture
|
| 366 |
+
def make_pet_callback_spec(self, spec_fixture):
|
| 367 |
+
def _make_pet_spec(operations):
|
| 368 |
+
spec_fixture.spec.path(
|
| 369 |
+
path="/pet",
|
| 370 |
+
operations={
|
| 371 |
+
"post": {"callbacks": {"petEvent": {"petCallbackUrl": operations}}}
|
| 372 |
+
},
|
| 373 |
+
)
|
| 374 |
+
return spec_fixture
|
| 375 |
+
|
| 376 |
+
return _make_pet_spec
|
| 377 |
+
|
| 378 |
+
@pytest.mark.parametrize(
|
| 379 |
+
"pet_schema",
|
| 380 |
+
(PetSchema, PetSchema(), PetSchema(many=True), "tests.schemas.PetSchema"),
|
| 381 |
+
)
|
| 382 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 383 |
+
def test_schema_v2(self, spec_fixture, pet_schema):
|
| 384 |
+
spec_fixture.spec.path(
|
| 385 |
+
path="/pet",
|
| 386 |
+
operations={
|
| 387 |
+
"get": {
|
| 388 |
+
"responses": {
|
| 389 |
+
200: {
|
| 390 |
+
"schema": pet_schema,
|
| 391 |
+
"description": "successful operation",
|
| 392 |
+
"headers": {"PetHeader": {"schema": pet_schema}},
|
| 393 |
+
}
|
| 394 |
+
}
|
| 395 |
+
}
|
| 396 |
+
},
|
| 397 |
+
)
|
| 398 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 399 |
+
if isinstance(pet_schema, Schema) and pet_schema.many is True:
|
| 400 |
+
assert get["responses"]["200"]["schema"]["type"] == "array"
|
| 401 |
+
schema_reference = get["responses"]["200"]["schema"]["items"]
|
| 402 |
+
assert (
|
| 403 |
+
get["responses"]["200"]["headers"]["PetHeader"]["schema"]["type"]
|
| 404 |
+
== "array"
|
| 405 |
+
)
|
| 406 |
+
header_reference = get["responses"]["200"]["headers"]["PetHeader"][
|
| 407 |
+
"schema"
|
| 408 |
+
]["items"]
|
| 409 |
+
else:
|
| 410 |
+
schema_reference = get["responses"]["200"]["schema"]
|
| 411 |
+
header_reference = get["responses"]["200"]["headers"]["PetHeader"]["schema"]
|
| 412 |
+
assert schema_reference == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 413 |
+
assert header_reference == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 414 |
+
assert len(spec_fixture.spec.components.schemas) == 1
|
| 415 |
+
resolved_schema = spec_fixture.spec.components.schemas["Pet"]
|
| 416 |
+
assert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema)
|
| 417 |
+
assert get["responses"]["200"]["description"] == "successful operation"
|
| 418 |
+
|
| 419 |
+
@pytest.mark.parametrize(
|
| 420 |
+
"pet_schema",
|
| 421 |
+
(PetSchema, PetSchema(), PetSchema(many=True), "tests.schemas.PetSchema"),
|
| 422 |
+
)
|
| 423 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 424 |
+
def test_schema_v3(self, spec_fixture, pet_schema):
|
| 425 |
+
spec_fixture.spec.path(
|
| 426 |
+
path="/pet",
|
| 427 |
+
operations={
|
| 428 |
+
"get": {
|
| 429 |
+
"responses": {
|
| 430 |
+
200: {
|
| 431 |
+
"content": {"application/json": {"schema": pet_schema}},
|
| 432 |
+
"description": "successful operation",
|
| 433 |
+
"headers": {"PetHeader": {"schema": pet_schema}},
|
| 434 |
+
}
|
| 435 |
+
}
|
| 436 |
+
}
|
| 437 |
+
},
|
| 438 |
+
)
|
| 439 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 440 |
+
if isinstance(pet_schema, Schema) and pet_schema.many is True:
|
| 441 |
+
assert (
|
| 442 |
+
get["responses"]["200"]["content"]["application/json"]["schema"]["type"]
|
| 443 |
+
== "array"
|
| 444 |
+
)
|
| 445 |
+
schema_reference = get["responses"]["200"]["content"]["application/json"][
|
| 446 |
+
"schema"
|
| 447 |
+
]["items"]
|
| 448 |
+
assert (
|
| 449 |
+
get["responses"]["200"]["headers"]["PetHeader"]["schema"]["type"]
|
| 450 |
+
== "array"
|
| 451 |
+
)
|
| 452 |
+
header_reference = get["responses"]["200"]["headers"]["PetHeader"][
|
| 453 |
+
"schema"
|
| 454 |
+
]["items"]
|
| 455 |
+
else:
|
| 456 |
+
schema_reference = get["responses"]["200"]["content"]["application/json"][
|
| 457 |
+
"schema"
|
| 458 |
+
]
|
| 459 |
+
header_reference = get["responses"]["200"]["headers"]["PetHeader"]["schema"]
|
| 460 |
+
|
| 461 |
+
assert schema_reference == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 462 |
+
assert header_reference == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 463 |
+
assert len(spec_fixture.spec.components.schemas) == 1
|
| 464 |
+
resolved_schema = spec_fixture.spec.components.schemas["Pet"]
|
| 465 |
+
assert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema)
|
| 466 |
+
assert get["responses"]["200"]["description"] == "successful operation"
|
| 467 |
+
|
| 468 |
+
@pytest.mark.parametrize(
|
| 469 |
+
"pet_schema",
|
| 470 |
+
(PetSchema, PetSchema(), PetSchema(many=True), "tests.schemas.PetSchema"),
|
| 471 |
+
)
|
| 472 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 473 |
+
def test_callback_schema_v3(self, make_pet_callback_spec, pet_schema):
|
| 474 |
+
spec_fixture = make_pet_callback_spec(
|
| 475 |
+
{
|
| 476 |
+
"get": {
|
| 477 |
+
"responses": {
|
| 478 |
+
"200": {
|
| 479 |
+
"content": {"application/json": {"schema": pet_schema}},
|
| 480 |
+
"description": "successful operation",
|
| 481 |
+
"headers": {"PetHeader": {"schema": pet_schema}},
|
| 482 |
+
}
|
| 483 |
+
}
|
| 484 |
+
}
|
| 485 |
+
}
|
| 486 |
+
)
|
| 487 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 488 |
+
c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"]
|
| 489 |
+
get = c["get"]
|
| 490 |
+
if isinstance(pet_schema, Schema) and pet_schema.many is True:
|
| 491 |
+
assert (
|
| 492 |
+
get["responses"]["200"]["content"]["application/json"]["schema"]["type"]
|
| 493 |
+
== "array"
|
| 494 |
+
)
|
| 495 |
+
schema_reference = get["responses"]["200"]["content"]["application/json"][
|
| 496 |
+
"schema"
|
| 497 |
+
]["items"]
|
| 498 |
+
assert (
|
| 499 |
+
get["responses"]["200"]["headers"]["PetHeader"]["schema"]["type"]
|
| 500 |
+
== "array"
|
| 501 |
+
)
|
| 502 |
+
header_reference = get["responses"]["200"]["headers"]["PetHeader"][
|
| 503 |
+
"schema"
|
| 504 |
+
]["items"]
|
| 505 |
+
else:
|
| 506 |
+
schema_reference = get["responses"]["200"]["content"]["application/json"][
|
| 507 |
+
"schema"
|
| 508 |
+
]
|
| 509 |
+
header_reference = get["responses"]["200"]["headers"]["PetHeader"]["schema"]
|
| 510 |
+
|
| 511 |
+
assert schema_reference == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 512 |
+
assert header_reference == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 513 |
+
assert len(spec_fixture.spec.components.schemas) == 1
|
| 514 |
+
resolved_schema = spec_fixture.spec.components.schemas["Pet"]
|
| 515 |
+
assert resolved_schema == spec_fixture.openapi.schema2jsonschema(PetSchema)
|
| 516 |
+
assert get["responses"]["200"]["description"] == "successful operation"
|
| 517 |
+
|
| 518 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 519 |
+
def test_schema_expand_parameters_v2(self, spec_fixture):
|
| 520 |
+
spec_fixture.spec.path(
|
| 521 |
+
path="/pet",
|
| 522 |
+
operations={
|
| 523 |
+
"get": {"parameters": [{"in": "query", "schema": PetSchema}]},
|
| 524 |
+
"post": {
|
| 525 |
+
"parameters": [
|
| 526 |
+
{
|
| 527 |
+
"in": "body",
|
| 528 |
+
"description": "a pet schema",
|
| 529 |
+
"required": True,
|
| 530 |
+
"name": "pet",
|
| 531 |
+
"schema": PetSchema,
|
| 532 |
+
}
|
| 533 |
+
]
|
| 534 |
+
},
|
| 535 |
+
},
|
| 536 |
+
)
|
| 537 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 538 |
+
get = p["get"]
|
| 539 |
+
assert get["parameters"] == spec_fixture.openapi.schema2parameters(
|
| 540 |
+
PetSchema(), location="query"
|
| 541 |
+
)
|
| 542 |
+
post = p["post"]
|
| 543 |
+
assert post["parameters"] == spec_fixture.openapi.schema2parameters(
|
| 544 |
+
PetSchema,
|
| 545 |
+
location="body",
|
| 546 |
+
required=True,
|
| 547 |
+
name="pet",
|
| 548 |
+
description="a pet schema",
|
| 549 |
+
)
|
| 550 |
+
|
| 551 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 552 |
+
def test_schema_expand_parameters_v3(self, spec_fixture):
|
| 553 |
+
spec_fixture.spec.path(
|
| 554 |
+
path="/pet",
|
| 555 |
+
operations={
|
| 556 |
+
"get": {"parameters": [{"in": "query", "schema": PetSchema}]},
|
| 557 |
+
"post": {
|
| 558 |
+
"requestBody": {
|
| 559 |
+
"description": "a pet schema",
|
| 560 |
+
"required": True,
|
| 561 |
+
"content": {"application/json": {"schema": PetSchema}},
|
| 562 |
+
}
|
| 563 |
+
},
|
| 564 |
+
},
|
| 565 |
+
)
|
| 566 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 567 |
+
get = p["get"]
|
| 568 |
+
assert get["parameters"] == spec_fixture.openapi.schema2parameters(
|
| 569 |
+
PetSchema(), location="query"
|
| 570 |
+
)
|
| 571 |
+
for parameter in get["parameters"]:
|
| 572 |
+
description = parameter.get("description", False)
|
| 573 |
+
assert description
|
| 574 |
+
name = parameter["name"]
|
| 575 |
+
assert description == PetSchema.description[name]
|
| 576 |
+
post = p["post"]
|
| 577 |
+
post_schema = spec_fixture.marshmallow_plugin.resolver.resolve_schema_dict(
|
| 578 |
+
PetSchema
|
| 579 |
+
)
|
| 580 |
+
assert (
|
| 581 |
+
post["requestBody"]["content"]["application/json"]["schema"] == post_schema
|
| 582 |
+
)
|
| 583 |
+
assert post["requestBody"]["description"] == "a pet schema"
|
| 584 |
+
assert post["requestBody"]["required"]
|
| 585 |
+
|
| 586 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 587 |
+
def test_callback_schema_expand_parameters_v3(self, make_pet_callback_spec):
|
| 588 |
+
spec_fixture = make_pet_callback_spec(
|
| 589 |
+
{
|
| 590 |
+
"get": {"parameters": [{"in": "query", "schema": PetSchema}]},
|
| 591 |
+
"post": {
|
| 592 |
+
"requestBody": {
|
| 593 |
+
"description": "a pet schema",
|
| 594 |
+
"required": True,
|
| 595 |
+
"content": {"application/json": {"schema": PetSchema}},
|
| 596 |
+
}
|
| 597 |
+
},
|
| 598 |
+
}
|
| 599 |
+
)
|
| 600 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 601 |
+
c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"]
|
| 602 |
+
get = c["get"]
|
| 603 |
+
assert get["parameters"] == spec_fixture.openapi.schema2parameters(
|
| 604 |
+
PetSchema(), location="query"
|
| 605 |
+
)
|
| 606 |
+
for parameter in get["parameters"]:
|
| 607 |
+
description = parameter.get("description", False)
|
| 608 |
+
assert description
|
| 609 |
+
name = parameter["name"]
|
| 610 |
+
assert description == PetSchema.description[name]
|
| 611 |
+
post = c["post"]
|
| 612 |
+
post_schema = spec_fixture.marshmallow_plugin.resolver.resolve_schema_dict(
|
| 613 |
+
PetSchema
|
| 614 |
+
)
|
| 615 |
+
assert (
|
| 616 |
+
post["requestBody"]["content"]["application/json"]["schema"] == post_schema
|
| 617 |
+
)
|
| 618 |
+
assert post["requestBody"]["description"] == "a pet schema"
|
| 619 |
+
assert post["requestBody"]["required"]
|
| 620 |
+
|
| 621 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 622 |
+
def test_schema_uses_ref_if_available_v2(self, spec_fixture):
|
| 623 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 624 |
+
spec_fixture.spec.path(
|
| 625 |
+
path="/pet", operations={"get": {"responses": {200: {"schema": PetSchema}}}}
|
| 626 |
+
)
|
| 627 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 628 |
+
assert get["responses"]["200"]["schema"] == build_ref(
|
| 629 |
+
spec_fixture.spec, "schema", "Pet"
|
| 630 |
+
)
|
| 631 |
+
|
| 632 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 633 |
+
def test_schema_uses_ref_if_available_v3(self, spec_fixture):
|
| 634 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 635 |
+
spec_fixture.spec.path(
|
| 636 |
+
path="/pet",
|
| 637 |
+
operations={
|
| 638 |
+
"get": {
|
| 639 |
+
"responses": {
|
| 640 |
+
200: {"content": {"application/json": {"schema": PetSchema}}}
|
| 641 |
+
}
|
| 642 |
+
}
|
| 643 |
+
},
|
| 644 |
+
)
|
| 645 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 646 |
+
assert get["responses"]["200"]["content"]["application/json"][
|
| 647 |
+
"schema"
|
| 648 |
+
] == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 649 |
+
|
| 650 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 651 |
+
def test_callback_schema_uses_ref_if_available_v3(self, make_pet_callback_spec):
|
| 652 |
+
spec_fixture = make_pet_callback_spec(
|
| 653 |
+
{
|
| 654 |
+
"get": {
|
| 655 |
+
"responses": {
|
| 656 |
+
"200": {"content": {"application/json": {"schema": PetSchema}}}
|
| 657 |
+
}
|
| 658 |
+
}
|
| 659 |
+
}
|
| 660 |
+
)
|
| 661 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 662 |
+
c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"]
|
| 663 |
+
get = c["get"]
|
| 664 |
+
assert get["responses"]["200"]["content"]["application/json"][
|
| 665 |
+
"schema"
|
| 666 |
+
] == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 667 |
+
|
| 668 |
+
def test_schema_uses_ref_if_available_name_resolver_returns_none_v2(self):
|
| 669 |
+
def resolver(schema):
|
| 670 |
+
return None
|
| 671 |
+
|
| 672 |
+
spec = APISpec(
|
| 673 |
+
title="Test auto-reference",
|
| 674 |
+
version="0.1",
|
| 675 |
+
openapi_version="2.0",
|
| 676 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 677 |
+
)
|
| 678 |
+
spec.components.schema("Pet", schema=PetSchema)
|
| 679 |
+
spec.path(
|
| 680 |
+
path="/pet", operations={"get": {"responses": {200: {"schema": PetSchema}}}}
|
| 681 |
+
)
|
| 682 |
+
get = get_paths(spec)["/pet"]["get"]
|
| 683 |
+
assert get["responses"]["200"]["schema"] == build_ref(spec, "schema", "Pet")
|
| 684 |
+
|
| 685 |
+
def test_schema_uses_ref_if_available_name_resolver_returns_none_v3(self):
|
| 686 |
+
def resolver(schema):
|
| 687 |
+
return None
|
| 688 |
+
|
| 689 |
+
spec = APISpec(
|
| 690 |
+
title="Test auto-reference",
|
| 691 |
+
version="0.1",
|
| 692 |
+
openapi_version="3.0.0",
|
| 693 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 694 |
+
)
|
| 695 |
+
spec.components.schema("Pet", schema=PetSchema)
|
| 696 |
+
spec.path(
|
| 697 |
+
path="/pet",
|
| 698 |
+
operations={
|
| 699 |
+
"get": {
|
| 700 |
+
"responses": {
|
| 701 |
+
200: {"content": {"application/json": {"schema": PetSchema}}}
|
| 702 |
+
}
|
| 703 |
+
}
|
| 704 |
+
},
|
| 705 |
+
)
|
| 706 |
+
get = get_paths(spec)["/pet"]["get"]
|
| 707 |
+
assert get["responses"]["200"]["content"]["application/json"][
|
| 708 |
+
"schema"
|
| 709 |
+
] == build_ref(spec, "schema", "Pet")
|
| 710 |
+
|
| 711 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 712 |
+
def test_schema_resolver_allof_v2(self, spec_fixture):
|
| 713 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 714 |
+
spec_fixture.spec.components.schema("Sample", schema=SampleSchema)
|
| 715 |
+
spec_fixture.spec.path(
|
| 716 |
+
path="/pet",
|
| 717 |
+
operations={
|
| 718 |
+
"get": {
|
| 719 |
+
"responses": {200: {"schema": {"allOf": [PetSchema, SampleSchema]}}}
|
| 720 |
+
}
|
| 721 |
+
},
|
| 722 |
+
)
|
| 723 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 724 |
+
assert get["responses"]["200"]["schema"] == {
|
| 725 |
+
"allOf": [
|
| 726 |
+
build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 727 |
+
build_ref(spec_fixture.spec, "schema", "Sample"),
|
| 728 |
+
]
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 732 |
+
@pytest.mark.parametrize("combinator", ["oneOf", "anyOf", "allOf"])
|
| 733 |
+
def test_schema_resolver_oneof_anyof_allof_v3(self, spec_fixture, combinator):
|
| 734 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 735 |
+
spec_fixture.spec.path(
|
| 736 |
+
path="/pet",
|
| 737 |
+
operations={
|
| 738 |
+
"get": {
|
| 739 |
+
"responses": {
|
| 740 |
+
200: {
|
| 741 |
+
"content": {
|
| 742 |
+
"application/json": {
|
| 743 |
+
"schema": {combinator: [PetSchema, SampleSchema]}
|
| 744 |
+
}
|
| 745 |
+
}
|
| 746 |
+
}
|
| 747 |
+
}
|
| 748 |
+
}
|
| 749 |
+
},
|
| 750 |
+
)
|
| 751 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 752 |
+
assert get["responses"]["200"]["content"]["application/json"]["schema"] == {
|
| 753 |
+
combinator: [
|
| 754 |
+
build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 755 |
+
build_ref(spec_fixture.spec, "schema", "Sample"),
|
| 756 |
+
]
|
| 757 |
+
}
|
| 758 |
+
|
| 759 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 760 |
+
def test_schema_resolver_not_v2(self, spec_fixture):
|
| 761 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 762 |
+
spec_fixture.spec.path(
|
| 763 |
+
path="/pet",
|
| 764 |
+
operations={"get": {"responses": {200: {"schema": {"not": PetSchema}}}}},
|
| 765 |
+
)
|
| 766 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 767 |
+
assert get["responses"]["200"]["schema"] == {
|
| 768 |
+
"not": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 769 |
+
}
|
| 770 |
+
|
| 771 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 772 |
+
def test_schema_resolver_not_v3(self, spec_fixture):
|
| 773 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 774 |
+
spec_fixture.spec.path(
|
| 775 |
+
path="/pet",
|
| 776 |
+
operations={
|
| 777 |
+
"get": {
|
| 778 |
+
"responses": {
|
| 779 |
+
200: {
|
| 780 |
+
"content": {
|
| 781 |
+
"application/json": {"schema": {"not": PetSchema}}
|
| 782 |
+
}
|
| 783 |
+
}
|
| 784 |
+
}
|
| 785 |
+
}
|
| 786 |
+
},
|
| 787 |
+
)
|
| 788 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 789 |
+
assert get["responses"]["200"]["content"]["application/json"]["schema"] == {
|
| 790 |
+
"not": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 791 |
+
}
|
| 792 |
+
|
| 793 |
+
@pytest.mark.parametrize(
|
| 794 |
+
"pet_schema",
|
| 795 |
+
(PetSchema, PetSchema(), "tests.schemas.PetSchema"),
|
| 796 |
+
)
|
| 797 |
+
def test_schema_name_resolver_returns_none_v2(self, pet_schema):
|
| 798 |
+
def resolver(schema):
|
| 799 |
+
return None
|
| 800 |
+
|
| 801 |
+
spec = APISpec(
|
| 802 |
+
title="Test resolver returns None",
|
| 803 |
+
version="0.1",
|
| 804 |
+
openapi_version="2.0",
|
| 805 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 806 |
+
)
|
| 807 |
+
spec.path(
|
| 808 |
+
path="/pet",
|
| 809 |
+
operations={"get": {"responses": {200: {"schema": pet_schema}}}},
|
| 810 |
+
)
|
| 811 |
+
get = get_paths(spec)["/pet"]["get"]
|
| 812 |
+
assert "properties" in get["responses"]["200"]["schema"]
|
| 813 |
+
|
| 814 |
+
@pytest.mark.parametrize(
|
| 815 |
+
"pet_schema",
|
| 816 |
+
(PetSchema, PetSchema(), "tests.schemas.PetSchema"),
|
| 817 |
+
)
|
| 818 |
+
def test_schema_name_resolver_returns_none_v3(self, pet_schema):
|
| 819 |
+
def resolver(schema):
|
| 820 |
+
return None
|
| 821 |
+
|
| 822 |
+
spec = APISpec(
|
| 823 |
+
title="Test resolver returns None",
|
| 824 |
+
version="0.1",
|
| 825 |
+
openapi_version="3.0.0",
|
| 826 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 827 |
+
)
|
| 828 |
+
spec.path(
|
| 829 |
+
path="/pet",
|
| 830 |
+
operations={
|
| 831 |
+
"get": {
|
| 832 |
+
"responses": {
|
| 833 |
+
200: {"content": {"application/json": {"schema": pet_schema}}}
|
| 834 |
+
}
|
| 835 |
+
}
|
| 836 |
+
},
|
| 837 |
+
)
|
| 838 |
+
get = get_paths(spec)["/pet"]["get"]
|
| 839 |
+
assert (
|
| 840 |
+
"properties"
|
| 841 |
+
in get["responses"]["200"]["content"]["application/json"]["schema"]
|
| 842 |
+
)
|
| 843 |
+
|
| 844 |
+
def test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3(self):
|
| 845 |
+
def resolver(schema):
|
| 846 |
+
return None
|
| 847 |
+
|
| 848 |
+
spec = APISpec(
|
| 849 |
+
title="Test auto-reference",
|
| 850 |
+
version="0.1",
|
| 851 |
+
openapi_version="3.0.0",
|
| 852 |
+
plugins=(MarshmallowPlugin(schema_name_resolver=resolver),),
|
| 853 |
+
)
|
| 854 |
+
spec.components.schema("Pet", schema=PetSchema)
|
| 855 |
+
spec.path(
|
| 856 |
+
path="/pet",
|
| 857 |
+
operations={
|
| 858 |
+
"post": {
|
| 859 |
+
"callbacks": {
|
| 860 |
+
"petEvent": {
|
| 861 |
+
"petCallbackUrl": {
|
| 862 |
+
"get": {
|
| 863 |
+
"responses": {
|
| 864 |
+
"200": {
|
| 865 |
+
"content": {
|
| 866 |
+
"application/json": {
|
| 867 |
+
"schema": PetSchema
|
| 868 |
+
}
|
| 869 |
+
}
|
| 870 |
+
}
|
| 871 |
+
}
|
| 872 |
+
}
|
| 873 |
+
}
|
| 874 |
+
}
|
| 875 |
+
}
|
| 876 |
+
}
|
| 877 |
+
},
|
| 878 |
+
)
|
| 879 |
+
p = get_paths(spec)["/pet"]
|
| 880 |
+
c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"]
|
| 881 |
+
get = c["get"]
|
| 882 |
+
assert get["responses"]["200"]["content"]["application/json"][
|
| 883 |
+
"schema"
|
| 884 |
+
] == build_ref(spec, "schema", "Pet")
|
| 885 |
+
|
| 886 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 887 |
+
def test_schema_uses_ref_in_parameters_and_request_body_if_available_v2(
|
| 888 |
+
self, spec_fixture
|
| 889 |
+
):
|
| 890 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 891 |
+
spec_fixture.spec.path(
|
| 892 |
+
path="/pet",
|
| 893 |
+
operations={
|
| 894 |
+
"get": {"parameters": [{"in": "query", "schema": PetSchema}]},
|
| 895 |
+
"post": {"parameters": [{"in": "body", "schema": PetSchema}]},
|
| 896 |
+
},
|
| 897 |
+
)
|
| 898 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 899 |
+
assert "schema" not in p["get"]["parameters"][0]
|
| 900 |
+
post = p["post"]
|
| 901 |
+
assert len(post["parameters"]) == 1
|
| 902 |
+
assert post["parameters"][0]["schema"] == build_ref(
|
| 903 |
+
spec_fixture.spec, "schema", "Pet"
|
| 904 |
+
)
|
| 905 |
+
|
| 906 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 907 |
+
def test_schema_uses_ref_in_parameters_and_request_body_if_available_v3(
|
| 908 |
+
self, spec_fixture
|
| 909 |
+
):
|
| 910 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 911 |
+
spec_fixture.spec.path(
|
| 912 |
+
path="/pet",
|
| 913 |
+
operations={
|
| 914 |
+
"get": {"parameters": [{"in": "query", "schema": PetSchema}]},
|
| 915 |
+
"post": {
|
| 916 |
+
"requestBody": {
|
| 917 |
+
"content": {"application/json": {"schema": PetSchema}}
|
| 918 |
+
}
|
| 919 |
+
},
|
| 920 |
+
},
|
| 921 |
+
)
|
| 922 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 923 |
+
assert "schema" in p["get"]["parameters"][0]
|
| 924 |
+
post = p["post"]
|
| 925 |
+
schema_ref = post["requestBody"]["content"]["application/json"]["schema"]
|
| 926 |
+
assert schema_ref == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 927 |
+
|
| 928 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 929 |
+
def test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3(
|
| 930 |
+
self, make_pet_callback_spec
|
| 931 |
+
):
|
| 932 |
+
spec_fixture = make_pet_callback_spec(
|
| 933 |
+
{
|
| 934 |
+
"get": {"parameters": [{"in": "query", "schema": PetSchema}]},
|
| 935 |
+
"post": {
|
| 936 |
+
"requestBody": {
|
| 937 |
+
"content": {"application/json": {"schema": PetSchema}}
|
| 938 |
+
}
|
| 939 |
+
},
|
| 940 |
+
}
|
| 941 |
+
)
|
| 942 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 943 |
+
c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"]
|
| 944 |
+
assert "schema" in c["get"]["parameters"][0]
|
| 945 |
+
post = c["post"]
|
| 946 |
+
schema_ref = post["requestBody"]["content"]["application/json"]["schema"]
|
| 947 |
+
assert schema_ref == build_ref(spec_fixture.spec, "schema", "Pet")
|
| 948 |
+
|
| 949 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 950 |
+
def test_schema_array_uses_ref_if_available_v2(self, spec_fixture):
|
| 951 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 952 |
+
spec_fixture.spec.path(
|
| 953 |
+
path="/pet",
|
| 954 |
+
operations={
|
| 955 |
+
"get": {
|
| 956 |
+
"parameters": [
|
| 957 |
+
{
|
| 958 |
+
"name": "petSchema",
|
| 959 |
+
"in": "body",
|
| 960 |
+
"schema": {"type": "array", "items": PetSchema},
|
| 961 |
+
}
|
| 962 |
+
],
|
| 963 |
+
"responses": {
|
| 964 |
+
200: {"schema": {"type": "array", "items": PetSchema}}
|
| 965 |
+
},
|
| 966 |
+
}
|
| 967 |
+
},
|
| 968 |
+
)
|
| 969 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 970 |
+
assert len(get["parameters"]) == 1
|
| 971 |
+
resolved_schema = {
|
| 972 |
+
"type": "array",
|
| 973 |
+
"items": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 974 |
+
}
|
| 975 |
+
assert get["parameters"][0]["schema"] == resolved_schema
|
| 976 |
+
assert get["responses"]["200"]["schema"] == resolved_schema
|
| 977 |
+
|
| 978 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 979 |
+
def test_schema_array_uses_ref_if_available_v3(self, spec_fixture):
|
| 980 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 981 |
+
spec_fixture.spec.path(
|
| 982 |
+
path="/pet",
|
| 983 |
+
operations={
|
| 984 |
+
"get": {
|
| 985 |
+
"parameters": [
|
| 986 |
+
{
|
| 987 |
+
"name": "Pet",
|
| 988 |
+
"in": "query",
|
| 989 |
+
"content": {
|
| 990 |
+
"application/json": {
|
| 991 |
+
"schema": {"type": "array", "items": PetSchema}
|
| 992 |
+
}
|
| 993 |
+
},
|
| 994 |
+
}
|
| 995 |
+
],
|
| 996 |
+
"responses": {
|
| 997 |
+
200: {
|
| 998 |
+
"content": {
|
| 999 |
+
"application/json": {
|
| 1000 |
+
"schema": {"type": "array", "items": PetSchema}
|
| 1001 |
+
}
|
| 1002 |
+
}
|
| 1003 |
+
}
|
| 1004 |
+
},
|
| 1005 |
+
}
|
| 1006 |
+
},
|
| 1007 |
+
)
|
| 1008 |
+
get = get_paths(spec_fixture.spec)["/pet"]["get"]
|
| 1009 |
+
assert len(get["parameters"]) == 1
|
| 1010 |
+
resolved_schema = {
|
| 1011 |
+
"type": "array",
|
| 1012 |
+
"items": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1013 |
+
}
|
| 1014 |
+
request_schema = get["parameters"][0]["content"]["application/json"]["schema"]
|
| 1015 |
+
assert request_schema == resolved_schema
|
| 1016 |
+
response_schema = get["responses"]["200"]["content"]["application/json"][
|
| 1017 |
+
"schema"
|
| 1018 |
+
]
|
| 1019 |
+
assert response_schema == resolved_schema
|
| 1020 |
+
|
| 1021 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 1022 |
+
def test_callback_schema_array_uses_ref_if_available_v3(
|
| 1023 |
+
self, make_pet_callback_spec
|
| 1024 |
+
):
|
| 1025 |
+
spec_fixture = make_pet_callback_spec(
|
| 1026 |
+
{
|
| 1027 |
+
"get": {
|
| 1028 |
+
"parameters": [
|
| 1029 |
+
{
|
| 1030 |
+
"name": "Pet",
|
| 1031 |
+
"in": "query",
|
| 1032 |
+
"content": {
|
| 1033 |
+
"application/json": {
|
| 1034 |
+
"schema": {"type": "array", "items": PetSchema}
|
| 1035 |
+
}
|
| 1036 |
+
},
|
| 1037 |
+
}
|
| 1038 |
+
],
|
| 1039 |
+
"responses": {
|
| 1040 |
+
"200": {
|
| 1041 |
+
"content": {
|
| 1042 |
+
"application/json": {
|
| 1043 |
+
"schema": {"type": "array", "items": PetSchema}
|
| 1044 |
+
}
|
| 1045 |
+
}
|
| 1046 |
+
}
|
| 1047 |
+
},
|
| 1048 |
+
}
|
| 1049 |
+
}
|
| 1050 |
+
)
|
| 1051 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 1052 |
+
c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"]
|
| 1053 |
+
get = c["get"]
|
| 1054 |
+
assert len(get["parameters"]) == 1
|
| 1055 |
+
resolved_schema = {
|
| 1056 |
+
"type": "array",
|
| 1057 |
+
"items": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1058 |
+
}
|
| 1059 |
+
request_schema = get["parameters"][0]["content"]["application/json"]["schema"]
|
| 1060 |
+
assert request_schema == resolved_schema
|
| 1061 |
+
response_schema = get["responses"]["200"]["content"]["application/json"][
|
| 1062 |
+
"schema"
|
| 1063 |
+
]
|
| 1064 |
+
assert response_schema == resolved_schema
|
| 1065 |
+
|
| 1066 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0",), indirect=True)
|
| 1067 |
+
def test_schema_partially_v2(self, spec_fixture):
|
| 1068 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 1069 |
+
spec_fixture.spec.path(
|
| 1070 |
+
path="/parents",
|
| 1071 |
+
operations={
|
| 1072 |
+
"get": {
|
| 1073 |
+
"responses": {
|
| 1074 |
+
200: {
|
| 1075 |
+
"schema": {
|
| 1076 |
+
"type": "object",
|
| 1077 |
+
"properties": {
|
| 1078 |
+
"mother": PetSchema,
|
| 1079 |
+
"father": PetSchema,
|
| 1080 |
+
},
|
| 1081 |
+
}
|
| 1082 |
+
}
|
| 1083 |
+
}
|
| 1084 |
+
}
|
| 1085 |
+
},
|
| 1086 |
+
)
|
| 1087 |
+
get = get_paths(spec_fixture.spec)["/parents"]["get"]
|
| 1088 |
+
assert get["responses"]["200"]["schema"] == {
|
| 1089 |
+
"type": "object",
|
| 1090 |
+
"properties": {
|
| 1091 |
+
"mother": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1092 |
+
"father": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1093 |
+
},
|
| 1094 |
+
}
|
| 1095 |
+
|
| 1096 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 1097 |
+
def test_schema_partially_v3(self, spec_fixture):
|
| 1098 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 1099 |
+
spec_fixture.spec.path(
|
| 1100 |
+
path="/parents",
|
| 1101 |
+
operations={
|
| 1102 |
+
"get": {
|
| 1103 |
+
"responses": {
|
| 1104 |
+
200: {
|
| 1105 |
+
"content": {
|
| 1106 |
+
"application/json": {
|
| 1107 |
+
"schema": {
|
| 1108 |
+
"type": "object",
|
| 1109 |
+
"properties": {
|
| 1110 |
+
"mother": PetSchema,
|
| 1111 |
+
"father": PetSchema,
|
| 1112 |
+
},
|
| 1113 |
+
}
|
| 1114 |
+
}
|
| 1115 |
+
}
|
| 1116 |
+
}
|
| 1117 |
+
}
|
| 1118 |
+
}
|
| 1119 |
+
},
|
| 1120 |
+
)
|
| 1121 |
+
get = get_paths(spec_fixture.spec)["/parents"]["get"]
|
| 1122 |
+
assert get["responses"]["200"]["content"]["application/json"]["schema"] == {
|
| 1123 |
+
"type": "object",
|
| 1124 |
+
"properties": {
|
| 1125 |
+
"mother": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1126 |
+
"father": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1127 |
+
},
|
| 1128 |
+
}
|
| 1129 |
+
|
| 1130 |
+
@pytest.mark.parametrize("spec_fixture", ("3.0.0",), indirect=True)
|
| 1131 |
+
def test_callback_schema_partially_v3(self, make_pet_callback_spec):
|
| 1132 |
+
spec_fixture = make_pet_callback_spec(
|
| 1133 |
+
{
|
| 1134 |
+
"get": {
|
| 1135 |
+
"responses": {
|
| 1136 |
+
"200": {
|
| 1137 |
+
"content": {
|
| 1138 |
+
"application/json": {
|
| 1139 |
+
"schema": {
|
| 1140 |
+
"type": "object",
|
| 1141 |
+
"properties": {
|
| 1142 |
+
"mother": PetSchema,
|
| 1143 |
+
"father": PetSchema,
|
| 1144 |
+
},
|
| 1145 |
+
}
|
| 1146 |
+
}
|
| 1147 |
+
}
|
| 1148 |
+
}
|
| 1149 |
+
}
|
| 1150 |
+
}
|
| 1151 |
+
}
|
| 1152 |
+
)
|
| 1153 |
+
p = get_paths(spec_fixture.spec)["/pet"]
|
| 1154 |
+
c = p["post"]["callbacks"]["petEvent"]["petCallbackUrl"]
|
| 1155 |
+
get = c["get"]
|
| 1156 |
+
assert get["responses"]["200"]["content"]["application/json"]["schema"] == {
|
| 1157 |
+
"type": "object",
|
| 1158 |
+
"properties": {
|
| 1159 |
+
"mother": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1160 |
+
"father": build_ref(spec_fixture.spec, "schema", "Pet"),
|
| 1161 |
+
},
|
| 1162 |
+
}
|
| 1163 |
+
|
| 1164 |
+
def test_parameter_reference(self, spec_fixture):
|
| 1165 |
+
if spec_fixture.spec.openapi_version.major < 3:
|
| 1166 |
+
param = {"schema": PetSchema}
|
| 1167 |
+
else:
|
| 1168 |
+
param = {"content": {"application/json": {"schema": PetSchema}}}
|
| 1169 |
+
spec_fixture.spec.components.parameter("Pet", "body", param)
|
| 1170 |
+
spec_fixture.spec.path(
|
| 1171 |
+
path="/parents", operations={"get": {"parameters": ["Pet"]}}
|
| 1172 |
+
)
|
| 1173 |
+
get = get_paths(spec_fixture.spec)["/parents"]["get"]
|
| 1174 |
+
assert get["parameters"] == [build_ref(spec_fixture.spec, "parameter", "Pet")]
|
| 1175 |
+
|
| 1176 |
+
def test_response_reference(self, spec_fixture):
|
| 1177 |
+
if spec_fixture.spec.openapi_version.major < 3:
|
| 1178 |
+
resp = {"schema": PetSchema}
|
| 1179 |
+
else:
|
| 1180 |
+
resp = {"content": {"application/json": {"schema": PetSchema}}}
|
| 1181 |
+
spec_fixture.spec.components.response("Pet", resp)
|
| 1182 |
+
spec_fixture.spec.path(
|
| 1183 |
+
path="/parents", operations={"get": {"responses": {"200": "Pet"}}}
|
| 1184 |
+
)
|
| 1185 |
+
get = get_paths(spec_fixture.spec)["/parents"]["get"]
|
| 1186 |
+
assert get["responses"] == {
|
| 1187 |
+
"200": build_ref(spec_fixture.spec, "response", "Pet")
|
| 1188 |
+
}
|
| 1189 |
+
|
| 1190 |
+
def test_schema_global_state_untouched_2json(self, spec_fixture):
|
| 1191 |
+
assert get_nested_schema(RunSchema, "sample") is None
|
| 1192 |
+
data = spec_fixture.openapi.schema2jsonschema(RunSchema)
|
| 1193 |
+
json.dumps(data)
|
| 1194 |
+
assert get_nested_schema(RunSchema, "sample") is None
|
| 1195 |
+
|
| 1196 |
+
def test_schema_global_state_untouched_2parameters(self, spec_fixture):
|
| 1197 |
+
assert get_nested_schema(RunSchema, "sample") is None
|
| 1198 |
+
data = spec_fixture.openapi.schema2parameters(RunSchema, location="json")
|
| 1199 |
+
json.dumps(data)
|
| 1200 |
+
assert get_nested_schema(RunSchema, "sample") is None
|
| 1201 |
+
|
| 1202 |
+
def test_resolve_schema_dict_ref_as_string(self, spec):
|
| 1203 |
+
"""Test schema ref passed as string"""
|
| 1204 |
+
# The case tested here is a reference passed as string, not a
|
| 1205 |
+
# marshmallow Schema passed by name as string. We want to ensure the
|
| 1206 |
+
# MarshmallowPlugin does not interfere with the feature interpreting
|
| 1207 |
+
# strings as references. Therefore, we use a specific name to ensure
|
| 1208 |
+
# there is no Schema with that name in the marshmallow registry from
|
| 1209 |
+
# somewhere else in the tests.
|
| 1210 |
+
# e.g. PetSchema is in the registry already so it wouldn't work.
|
| 1211 |
+
schema = {"schema": "SomeSpecificPetSchema"}
|
| 1212 |
+
if spec.openapi_version.major >= 3:
|
| 1213 |
+
schema = {"content": {"application/json": schema}}
|
| 1214 |
+
spec.path("/pet/{petId}", operations={"get": {"responses": {"200": schema}}})
|
| 1215 |
+
resp = get_paths(spec)["/pet/{petId}"]["get"]["responses"]["200"]
|
| 1216 |
+
if spec.openapi_version.major < 3:
|
| 1217 |
+
schema = resp["schema"]
|
| 1218 |
+
else:
|
| 1219 |
+
schema = resp["content"]["application/json"]["schema"]
|
| 1220 |
+
assert schema == build_ref(spec, "schema", "SomeSpecificPetSchema")
|
| 1221 |
+
|
| 1222 |
+
|
| 1223 |
+
class TestCircularReference:
|
| 1224 |
+
def test_circular_referencing_schemas(self, spec):
|
| 1225 |
+
spec.components.schema("Analysis", schema=AnalysisSchema)
|
| 1226 |
+
definitions = get_schemas(spec)
|
| 1227 |
+
ref = definitions["Analysis"]["properties"]["sample"]
|
| 1228 |
+
assert ref == build_ref(spec, "schema", "Sample")
|
| 1229 |
+
|
| 1230 |
+
|
| 1231 |
+
# Regression tests for issue #55
|
| 1232 |
+
class TestSelfReference:
|
| 1233 |
+
def test_self_referencing_field_single(self, spec):
|
| 1234 |
+
spec.components.schema("SelfReference", schema=SelfReferencingSchema)
|
| 1235 |
+
definitions = get_schemas(spec)
|
| 1236 |
+
ref = definitions["SelfReference"]["properties"]["single"]
|
| 1237 |
+
assert ref == build_ref(spec, "schema", "SelfReference")
|
| 1238 |
+
|
| 1239 |
+
def test_self_referencing_field_many(self, spec):
|
| 1240 |
+
spec.components.schema("SelfReference", schema=SelfReferencingSchema)
|
| 1241 |
+
definitions = get_schemas(spec)
|
| 1242 |
+
result = definitions["SelfReference"]["properties"]["multiple"]
|
| 1243 |
+
assert result == {
|
| 1244 |
+
"type": "array",
|
| 1245 |
+
"items": build_ref(spec, "schema", "SelfReference"),
|
| 1246 |
+
}
|
| 1247 |
+
|
| 1248 |
+
|
| 1249 |
+
class TestOrderedSchema:
|
| 1250 |
+
def test_ordered_schema(self, spec):
|
| 1251 |
+
spec.components.schema("Ordered", schema=OrderedSchema)
|
| 1252 |
+
result = get_schemas(spec)["Ordered"]["properties"]
|
| 1253 |
+
assert list(result.keys()) == ["field1", "field2", "field3", "field4", "field5"]
|
| 1254 |
+
|
| 1255 |
+
|
| 1256 |
+
class TestFieldWithCustomProps:
|
| 1257 |
+
def test_field_with_custom_props(self, spec):
|
| 1258 |
+
spec.components.schema("PatternedObject", schema=PatternedObjectSchema)
|
| 1259 |
+
result = get_schemas(spec)["PatternedObject"]["properties"]["count"]
|
| 1260 |
+
assert "x-count" in result
|
| 1261 |
+
assert result["x-count"] == 1
|
| 1262 |
+
|
| 1263 |
+
def test_field_with_custom_props_passed_as_snake_case(self, spec):
|
| 1264 |
+
spec.components.schema("PatternedObject", schema=PatternedObjectSchema)
|
| 1265 |
+
result = get_schemas(spec)["PatternedObject"]["properties"]["count2"]
|
| 1266 |
+
assert "x-count2" in result
|
| 1267 |
+
assert result["x-count2"] == 2
|
| 1268 |
+
|
| 1269 |
+
|
| 1270 |
+
class TestSchemaWithDefaultValues:
|
| 1271 |
+
def test_schema_with_default_values(self, spec):
|
| 1272 |
+
spec.components.schema("DefaultValuesSchema", schema=DefaultValuesSchema)
|
| 1273 |
+
definitions = get_schemas(spec)
|
| 1274 |
+
props = definitions["DefaultValuesSchema"]["properties"]
|
| 1275 |
+
assert props["number_auto_default"]["default"] == 12
|
| 1276 |
+
assert props["number_manual_default"]["default"] == 42
|
| 1277 |
+
assert "default" not in props["string_callable_default"]
|
| 1278 |
+
assert props["string_manual_default"]["default"] == "Manual"
|
| 1279 |
+
assert "default" not in props["numbers"]
|
| 1280 |
+
|
| 1281 |
+
|
| 1282 |
+
class TestDictValues:
|
| 1283 |
+
def test_dict_values_resolve_to_additional_properties(self, spec):
|
| 1284 |
+
class SchemaWithDict(Schema):
|
| 1285 |
+
dict_field = Dict(values=String())
|
| 1286 |
+
|
| 1287 |
+
spec.components.schema("SchemaWithDict", schema=SchemaWithDict)
|
| 1288 |
+
result = get_schemas(spec)["SchemaWithDict"]["properties"]["dict_field"]
|
| 1289 |
+
assert result == {"type": "object", "additionalProperties": {"type": "string"}}
|
| 1290 |
+
|
| 1291 |
+
def test_dict_with_empty_values_field(self, spec):
|
| 1292 |
+
class SchemaWithDict(Schema):
|
| 1293 |
+
dict_field = Dict()
|
| 1294 |
+
|
| 1295 |
+
spec.components.schema("SchemaWithDict", schema=SchemaWithDict)
|
| 1296 |
+
result = get_schemas(spec)["SchemaWithDict"]["properties"]["dict_field"]
|
| 1297 |
+
assert result == {"type": "object", "additionalProperties": {}}
|
| 1298 |
+
|
| 1299 |
+
def test_dict_with_nested(self, spec):
|
| 1300 |
+
class SchemaWithDict(Schema):
|
| 1301 |
+
dict_field = Dict(values=Nested(PetSchema))
|
| 1302 |
+
|
| 1303 |
+
spec.components.schema("SchemaWithDict", schema=SchemaWithDict)
|
| 1304 |
+
|
| 1305 |
+
assert len(get_schemas(spec)) == 2
|
| 1306 |
+
|
| 1307 |
+
result = get_schemas(spec)["SchemaWithDict"]["properties"]["dict_field"]
|
| 1308 |
+
assert result == {
|
| 1309 |
+
"additionalProperties": build_ref(spec, "schema", "Pet"),
|
| 1310 |
+
"type": "object",
|
| 1311 |
+
}
|
| 1312 |
+
|
| 1313 |
+
|
| 1314 |
+
class TestList:
|
| 1315 |
+
def test_list_with_nested(self, spec):
|
| 1316 |
+
class SchemaWithList(Schema):
|
| 1317 |
+
list_field = List(Nested(PetSchema))
|
| 1318 |
+
|
| 1319 |
+
spec.components.schema("SchemaWithList", schema=SchemaWithList)
|
| 1320 |
+
|
| 1321 |
+
assert len(get_schemas(spec)) == 2
|
| 1322 |
+
|
| 1323 |
+
result = get_schemas(spec)["SchemaWithList"]["properties"]["list_field"]
|
| 1324 |
+
assert result == {"items": build_ref(spec, "schema", "Pet"), "type": "array"}
|
| 1325 |
+
|
| 1326 |
+
|
| 1327 |
+
class TestTimeDelta:
|
| 1328 |
+
def test_timedelta_x_unit(self, spec):
|
| 1329 |
+
class SchemaWithTimeDelta(Schema):
|
| 1330 |
+
sec = TimeDelta("seconds")
|
| 1331 |
+
day = TimeDelta("days")
|
| 1332 |
+
|
| 1333 |
+
spec.components.schema("SchemaWithTimeDelta", schema=SchemaWithTimeDelta)
|
| 1334 |
+
|
| 1335 |
+
assert (
|
| 1336 |
+
get_schemas(spec)["SchemaWithTimeDelta"]["properties"]["sec"]["x-unit"]
|
| 1337 |
+
== "seconds"
|
| 1338 |
+
)
|
| 1339 |
+
assert (
|
| 1340 |
+
get_schemas(spec)["SchemaWithTimeDelta"]["properties"]["day"]["x-unit"]
|
| 1341 |
+
== "days"
|
| 1342 |
+
)
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_common.py
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
from marshmallow import Schema, fields
|
| 3 |
+
|
| 4 |
+
from apispec.ext.marshmallow.common import (
|
| 5 |
+
get_fields,
|
| 6 |
+
get_unique_schema_name,
|
| 7 |
+
make_schema_key,
|
| 8 |
+
)
|
| 9 |
+
|
| 10 |
+
from .schemas import PetSchema, SampleSchema
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class TestMakeSchemaKey:
|
| 14 |
+
def test_raise_if_schema_class_passed(self):
|
| 15 |
+
with pytest.raises(TypeError, match="based on a Schema instance"):
|
| 16 |
+
make_schema_key(PetSchema)
|
| 17 |
+
|
| 18 |
+
def test_same_schemas_instances_equal(self):
|
| 19 |
+
assert make_schema_key(PetSchema()) == make_schema_key(PetSchema())
|
| 20 |
+
|
| 21 |
+
@pytest.mark.parametrize("structure", (list, set))
|
| 22 |
+
def test_same_schemas_instances_unhashable_modifiers_equal(self, structure):
|
| 23 |
+
modifier = [str(i) for i in range(1000)]
|
| 24 |
+
assert make_schema_key(
|
| 25 |
+
PetSchema(load_only=structure(modifier))
|
| 26 |
+
) == make_schema_key(PetSchema(load_only=structure(modifier[::-1])))
|
| 27 |
+
|
| 28 |
+
def test_different_schemas_not_equal(self):
|
| 29 |
+
assert make_schema_key(PetSchema()) != make_schema_key(SampleSchema())
|
| 30 |
+
|
| 31 |
+
def test_instances_with_different_modifiers_not_equal(self):
|
| 32 |
+
assert make_schema_key(PetSchema()) != make_schema_key(PetSchema(partial=True))
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
class TestUniqueName:
|
| 36 |
+
def test_unique_name(self, spec):
|
| 37 |
+
properties = {
|
| 38 |
+
"id": {"type": "integer", "format": "int64"},
|
| 39 |
+
"name": {"type": "string", "example": "doggie"},
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
name = get_unique_schema_name(spec.components, "Pet")
|
| 43 |
+
assert name == "Pet"
|
| 44 |
+
|
| 45 |
+
spec.components.schema("Pet", properties=properties)
|
| 46 |
+
with pytest.warns(
|
| 47 |
+
UserWarning, match="Multiple schemas resolved to the name Pet"
|
| 48 |
+
):
|
| 49 |
+
name_1 = get_unique_schema_name(spec.components, "Pet")
|
| 50 |
+
assert name_1 == "Pet1"
|
| 51 |
+
|
| 52 |
+
spec.components.schema("Pet1", properties=properties)
|
| 53 |
+
with pytest.warns(
|
| 54 |
+
UserWarning, match="Multiple schemas resolved to the name Pet"
|
| 55 |
+
):
|
| 56 |
+
name_2 = get_unique_schema_name(spec.components, "Pet")
|
| 57 |
+
assert name_2 == "Pet2"
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
class TestGetFields:
|
| 61 |
+
@pytest.mark.parametrize("exclude_type", (tuple, list))
|
| 62 |
+
@pytest.mark.parametrize("dump_only_type", (tuple, list))
|
| 63 |
+
def test_get_fields_meta_exclude_dump_only_as_list_and_tuple(
|
| 64 |
+
self, exclude_type, dump_only_type
|
| 65 |
+
):
|
| 66 |
+
class ExcludeSchema(Schema):
|
| 67 |
+
field1 = fields.Int()
|
| 68 |
+
field2 = fields.Int()
|
| 69 |
+
field3 = fields.Int()
|
| 70 |
+
field4 = fields.Int()
|
| 71 |
+
field5 = fields.Int()
|
| 72 |
+
|
| 73 |
+
class Meta:
|
| 74 |
+
ordered = True
|
| 75 |
+
exclude = exclude_type(("field1", "field2"))
|
| 76 |
+
dump_only = dump_only_type(("field3", "field4"))
|
| 77 |
+
|
| 78 |
+
assert list(get_fields(ExcludeSchema).keys()) == ["field3", "field4", "field5"]
|
| 79 |
+
assert list(get_fields(ExcludeSchema, exclude_dump_only=True).keys()) == [
|
| 80 |
+
"field5"
|
| 81 |
+
]
|
| 82 |
+
|
| 83 |
+
# regression test for https://github.com/marshmallow-code/apispec/issues/673
|
| 84 |
+
def test_schema_with_field_named_fields(self):
|
| 85 |
+
class TestSchema(Schema):
|
| 86 |
+
fields = fields.Int()
|
| 87 |
+
|
| 88 |
+
schema_fields = get_fields(TestSchema)
|
| 89 |
+
assert list(schema_fields.keys()) == ["fields"]
|
| 90 |
+
assert isinstance(schema_fields["fields"], fields.Int)
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_field.py
ADDED
|
@@ -0,0 +1,664 @@
|
|
|
|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| 8 |
+
from .schemas import CategorySchema, CustomIntegerField, CustomList, CustomStringField
|
| 9 |
+
from .utils import build_ref, get_schemas
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def test_field2choices_preserving_order(openapi):
|
| 13 |
+
choices = ["a", "b", "c", "aa", "0", "cc"]
|
| 14 |
+
field = fields.String(validate=validate.OneOf(choices))
|
| 15 |
+
assert openapi.field2choices(field) == {"enum": choices}
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
@pytest.mark.parametrize(
|
| 19 |
+
("FieldClass", "jsontype"),
|
| 20 |
+
[
|
| 21 |
+
(fields.Integer, "integer"),
|
| 22 |
+
(fields.Float, "number"),
|
| 23 |
+
(fields.String, "string"),
|
| 24 |
+
(fields.Str, "string"),
|
| 25 |
+
(fields.Boolean, "boolean"),
|
| 26 |
+
(fields.Bool, "boolean"),
|
| 27 |
+
(fields.UUID, "string"),
|
| 28 |
+
(fields.DateTime, "string"),
|
| 29 |
+
(fields.Date, "string"),
|
| 30 |
+
(fields.Time, "string"),
|
| 31 |
+
(fields.TimeDelta, "integer"),
|
| 32 |
+
(fields.Email, "string"),
|
| 33 |
+
(fields.URL, "string"),
|
| 34 |
+
(fields.IP, "string"),
|
| 35 |
+
(fields.IPv4, "string"),
|
| 36 |
+
(fields.IPv6, "string"),
|
| 37 |
+
# Custom fields inherit types from their parents
|
| 38 |
+
(CustomStringField, "string"),
|
| 39 |
+
(CustomIntegerField, "integer"),
|
| 40 |
+
],
|
| 41 |
+
)
|
| 42 |
+
def test_field2property_type(FieldClass, jsontype, spec_fixture):
|
| 43 |
+
field = FieldClass()
|
| 44 |
+
res = spec_fixture.openapi.field2property(field)
|
| 45 |
+
assert res["type"] == jsontype
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def test_field2property_no_type(spec_fixture):
|
| 49 |
+
field = fields.Raw()
|
| 50 |
+
res = spec_fixture.openapi.field2property(field)
|
| 51 |
+
assert "type" not in res
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
@pytest.mark.parametrize("ListClass", [fields.List, CustomList])
|
| 55 |
+
def test_formatted_field_translates_to_array(ListClass, spec_fixture):
|
| 56 |
+
field = ListClass(fields.String)
|
| 57 |
+
res = spec_fixture.openapi.field2property(field)
|
| 58 |
+
assert res["type"] == "array"
|
| 59 |
+
assert res["items"] == spec_fixture.openapi.field2property(fields.String())
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
@pytest.mark.parametrize(
|
| 63 |
+
("FieldClass", "expected_format"),
|
| 64 |
+
[
|
| 65 |
+
(fields.UUID, "uuid"),
|
| 66 |
+
(fields.DateTime, "date-time"),
|
| 67 |
+
(fields.Date, "date"),
|
| 68 |
+
(fields.Email, "email"),
|
| 69 |
+
(fields.URL, "url"),
|
| 70 |
+
(fields.IP, "ip"),
|
| 71 |
+
(fields.IPv4, "ipv4"),
|
| 72 |
+
(fields.IPv6, "ipv6"),
|
| 73 |
+
],
|
| 74 |
+
)
|
| 75 |
+
def test_field2property_formats(FieldClass, expected_format, spec_fixture):
|
| 76 |
+
field = FieldClass()
|
| 77 |
+
res = spec_fixture.openapi.field2property(field)
|
| 78 |
+
assert res["format"] == expected_format
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
def test_field_with_description(spec_fixture):
|
| 82 |
+
field = fields.Str(metadata={"description": "a username"})
|
| 83 |
+
res = spec_fixture.openapi.field2property(field)
|
| 84 |
+
assert res["description"] == "a username"
|
| 85 |
+
|
| 86 |
+
|
| 87 |
+
def test_field_with_load_default(spec_fixture):
|
| 88 |
+
field = fields.Str(dump_default="foo", load_default="bar")
|
| 89 |
+
res = spec_fixture.openapi.field2property(field)
|
| 90 |
+
assert res["default"] == "bar"
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
def test_boolean_field_with_false_load_default(spec_fixture):
|
| 94 |
+
field = fields.Boolean(dump_default=None, load_default=False)
|
| 95 |
+
res = spec_fixture.openapi.field2property(field)
|
| 96 |
+
assert res["default"] is False
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
def test_datetime_field_with_load_default(spec_fixture):
|
| 100 |
+
field = fields.Date(load_default=dt.date(2014, 7, 18))
|
| 101 |
+
res = spec_fixture.openapi.field2property(field)
|
| 102 |
+
assert res["default"] == dt.date(2014, 7, 18).isoformat()
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
def test_field_with_load_default_callable(spec_fixture):
|
| 106 |
+
field = fields.Str(load_default=lambda: "dummy")
|
| 107 |
+
res = spec_fixture.openapi.field2property(field)
|
| 108 |
+
assert "default" not in res
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
def test_field_with_default(spec_fixture):
|
| 112 |
+
field = fields.Str(metadata={"default": "Manual default"})
|
| 113 |
+
res = spec_fixture.openapi.field2property(field)
|
| 114 |
+
assert res["default"] == "Manual default"
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
def test_field_with_default_and_load_default(spec_fixture):
|
| 118 |
+
field = fields.Int(load_default=12, metadata={"default": 42})
|
| 119 |
+
res = spec_fixture.openapi.field2property(field)
|
| 120 |
+
assert res["default"] == 42
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
def test_field_with_choices(spec_fixture):
|
| 124 |
+
field = fields.Str(validate=validate.OneOf(["freddie", "brian", "john"]))
|
| 125 |
+
res = spec_fixture.openapi.field2property(field)
|
| 126 |
+
assert set(res["enum"]) == {"freddie", "brian", "john"}
|
| 127 |
+
|
| 128 |
+
|
| 129 |
+
def test_field_with_nullable_choices(spec_fixture):
|
| 130 |
+
field = fields.Str(
|
| 131 |
+
validate=validate.OneOf(["freddie", "brian", "john"]), allow_none=True
|
| 132 |
+
)
|
| 133 |
+
res = spec_fixture.openapi.field2property(field)
|
| 134 |
+
assert set(res["enum"]) == {"freddie", "brian", "john", None}
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
def test_field_with_nullable_choices_returns_only_one_none(spec_fixture):
|
| 138 |
+
field = fields.Str(
|
| 139 |
+
validate=validate.OneOf(["freddie", "brian", "john", None]), allow_none=True
|
| 140 |
+
)
|
| 141 |
+
res = spec_fixture.openapi.field2property(field)
|
| 142 |
+
assert res["enum"] == ["freddie", "brian", "john", None]
|
| 143 |
+
|
| 144 |
+
|
| 145 |
+
def test_field_with_equal(spec_fixture):
|
| 146 |
+
field = fields.Str(validate=validate.Equal("only choice"))
|
| 147 |
+
res = spec_fixture.openapi.field2property(field)
|
| 148 |
+
assert res["enum"] == ["only choice"]
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
def test_only_allows_valid_properties_in_metadata(spec_fixture):
|
| 152 |
+
field = fields.Str(
|
| 153 |
+
load_default="foo",
|
| 154 |
+
metadata={
|
| 155 |
+
"description": "foo",
|
| 156 |
+
"not_valid": "lol",
|
| 157 |
+
"allOf": ["bar"],
|
| 158 |
+
"enum": ["red", "blue"],
|
| 159 |
+
},
|
| 160 |
+
)
|
| 161 |
+
res = spec_fixture.openapi.field2property(field)
|
| 162 |
+
assert res["default"] == field.load_default
|
| 163 |
+
assert "description" in res
|
| 164 |
+
assert "enum" in res
|
| 165 |
+
assert "allOf" in res
|
| 166 |
+
assert "not_valid" not in res
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
def test_field_with_choices_multiple(spec_fixture):
|
| 170 |
+
field = fields.Str(
|
| 171 |
+
validate=[
|
| 172 |
+
validate.OneOf(["freddie", "brian", "john"]),
|
| 173 |
+
validate.OneOf(["brian", "john", "roger"]),
|
| 174 |
+
]
|
| 175 |
+
)
|
| 176 |
+
res = spec_fixture.openapi.field2property(field)
|
| 177 |
+
assert set(res["enum"]) == {"brian", "john"}
|
| 178 |
+
|
| 179 |
+
|
| 180 |
+
def test_field_with_additional_metadata(spec_fixture):
|
| 181 |
+
field = fields.Str(metadata={"minLength": 6, "maxLength": 100})
|
| 182 |
+
res = spec_fixture.openapi.field2property(field)
|
| 183 |
+
assert res["maxLength"] == 100
|
| 184 |
+
assert res["minLength"] == 6
|
| 185 |
+
|
| 186 |
+
|
| 187 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)
|
| 188 |
+
def test_field_with_allow_none(spec_fixture):
|
| 189 |
+
field = fields.Str(allow_none=True)
|
| 190 |
+
res = spec_fixture.openapi.field2property(field)
|
| 191 |
+
if spec_fixture.openapi.openapi_version.major < 3:
|
| 192 |
+
assert res["x-nullable"] is True
|
| 193 |
+
elif spec_fixture.openapi.openapi_version.minor < 1:
|
| 194 |
+
assert res["nullable"] is True
|
| 195 |
+
else:
|
| 196 |
+
assert "nullable" not in res
|
| 197 |
+
assert res["type"] == ["string", "null"]
|
| 198 |
+
|
| 199 |
+
|
| 200 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)
|
| 201 |
+
@pytest.mark.parametrize("field_class", [fields.Field, fields.Raw])
|
| 202 |
+
def test_nullable_field_with_no_type(spec_fixture, field_class):
|
| 203 |
+
field = field_class(allow_none=True)
|
| 204 |
+
res = spec_fixture.openapi.field2property(field)
|
| 205 |
+
if spec_fixture.openapi.openapi_version.major < 3:
|
| 206 |
+
assert res["x-nullable"] is True
|
| 207 |
+
elif spec_fixture.openapi.openapi_version.minor < 1:
|
| 208 |
+
assert res["nullable"] is True
|
| 209 |
+
else:
|
| 210 |
+
assert "nullable" not in res
|
| 211 |
+
assert "type" not in res
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)
|
| 215 |
+
def test_nested_nullable(spec_fixture):
|
| 216 |
+
class Child(Schema):
|
| 217 |
+
name = fields.Str()
|
| 218 |
+
|
| 219 |
+
field = fields.Nested(Child, allow_none=True)
|
| 220 |
+
res = spec_fixture.openapi.field2property(field)
|
| 221 |
+
version = spec_fixture.openapi.openapi_version
|
| 222 |
+
if version.major < 3:
|
| 223 |
+
assert res == {"$ref": "#/definitions/Child", "x-nullable": True}
|
| 224 |
+
elif version.major == 3 and version.minor < 1:
|
| 225 |
+
assert res == {
|
| 226 |
+
"anyOf": [
|
| 227 |
+
{"type": "object", "nullable": True},
|
| 228 |
+
{"$ref": "#/components/schemas/Child"},
|
| 229 |
+
]
|
| 230 |
+
}
|
| 231 |
+
else:
|
| 232 |
+
assert res == {
|
| 233 |
+
"anyOf": [{"$ref": "#/components/schemas/Child"}, {"type": "null"}]
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)
|
| 238 |
+
def test_nested_nullable_with_metadata(spec_fixture):
|
| 239 |
+
# Regression test for https://github.com/marshmallow-code/apispec/issues/955
|
| 240 |
+
class Child(Schema):
|
| 241 |
+
name = fields.Str()
|
| 242 |
+
|
| 243 |
+
field = fields.Nested(
|
| 244 |
+
Child,
|
| 245 |
+
allow_none=True,
|
| 246 |
+
metadata={"description": "foo"},
|
| 247 |
+
)
|
| 248 |
+
res = spec_fixture.openapi.field2property(field)
|
| 249 |
+
version = spec_fixture.openapi.openapi_version
|
| 250 |
+
if version.major < 3:
|
| 251 |
+
assert res == {
|
| 252 |
+
"allOf": [
|
| 253 |
+
{"$ref": "#/definitions/Child"},
|
| 254 |
+
],
|
| 255 |
+
"x-nullable": True,
|
| 256 |
+
"description": "foo",
|
| 257 |
+
}
|
| 258 |
+
elif version.major == 3 and version.minor < 1:
|
| 259 |
+
assert res == {
|
| 260 |
+
"anyOf": [
|
| 261 |
+
{"$ref": "#/components/schemas/Child"},
|
| 262 |
+
{"type": "object", "nullable": True},
|
| 263 |
+
],
|
| 264 |
+
"description": "foo",
|
| 265 |
+
}
|
| 266 |
+
else:
|
| 267 |
+
assert res == {
|
| 268 |
+
"anyOf": [{"$ref": "#/components/schemas/Child"}, {"type": "null"}],
|
| 269 |
+
"description": "foo",
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
|
| 273 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)
|
| 274 |
+
def test_nullable_pluck(spec_fixture):
|
| 275 |
+
class Example(Schema):
|
| 276 |
+
name = fields.Str()
|
| 277 |
+
|
| 278 |
+
field = fields.Pluck(Example, "name", allow_none=True)
|
| 279 |
+
res = spec_fixture.openapi.field2property(field)
|
| 280 |
+
version = spec_fixture.openapi.openapi_version
|
| 281 |
+
if version.major < 3:
|
| 282 |
+
assert res == {"type": "string", "x-nullable": True}
|
| 283 |
+
elif version.major == 3 and version.minor < 1:
|
| 284 |
+
assert res == {"type": "string", "nullable": True}
|
| 285 |
+
else:
|
| 286 |
+
assert res == {"type": ["string", "null"]}
|
| 287 |
+
|
| 288 |
+
|
| 289 |
+
def test_field_with_dump_only(spec_fixture):
|
| 290 |
+
field = fields.Str(dump_only=True)
|
| 291 |
+
res = spec_fixture.openapi.field2property(field)
|
| 292 |
+
assert res["readOnly"] is True
|
| 293 |
+
|
| 294 |
+
|
| 295 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)
|
| 296 |
+
def test_field_with_load_only(spec_fixture):
|
| 297 |
+
field = fields.Str(load_only=True)
|
| 298 |
+
res = spec_fixture.openapi.field2property(field)
|
| 299 |
+
if spec_fixture.openapi.openapi_version.major < 3:
|
| 300 |
+
assert "writeOnly" not in res
|
| 301 |
+
else:
|
| 302 |
+
assert res["writeOnly"] is True
|
| 303 |
+
|
| 304 |
+
|
| 305 |
+
def test_field_with_range_no_type(spec_fixture):
|
| 306 |
+
field = fields.Raw(validate=validate.Range(min=1, max=10))
|
| 307 |
+
res = spec_fixture.openapi.field2property(field)
|
| 308 |
+
assert res["x-minimum"] == 1
|
| 309 |
+
assert res["x-maximum"] == 10
|
| 310 |
+
assert "type" not in res
|
| 311 |
+
|
| 312 |
+
|
| 313 |
+
@pytest.mark.parametrize("field", (fields.Float, fields.Integer))
|
| 314 |
+
def test_field_with_range_string_type(spec_fixture, field):
|
| 315 |
+
field = field(validate=validate.Range(min=1, max=10))
|
| 316 |
+
res = spec_fixture.openapi.field2property(field)
|
| 317 |
+
assert res["minimum"] == 1
|
| 318 |
+
assert res["maximum"] == 10
|
| 319 |
+
assert isinstance(res["type"], str)
|
| 320 |
+
|
| 321 |
+
|
| 322 |
+
@pytest.mark.parametrize("spec_fixture", ("3.1.0",), indirect=True)
|
| 323 |
+
def test_field_with_range_type_list_with_number(spec_fixture):
|
| 324 |
+
class NullableInteger(fields.Field):
|
| 325 |
+
"""Nullable integer"""
|
| 326 |
+
|
| 327 |
+
spec_fixture.openapi.map_to_openapi_type(NullableInteger, ["integer", "null"], None)
|
| 328 |
+
|
| 329 |
+
field = NullableInteger(validate=validate.Range(min=1, max=10))
|
| 330 |
+
res = spec_fixture.openapi.field2property(field)
|
| 331 |
+
assert res["minimum"] == 1
|
| 332 |
+
assert res["maximum"] == 10
|
| 333 |
+
assert res["type"] == ["integer", "null"]
|
| 334 |
+
|
| 335 |
+
|
| 336 |
+
@pytest.mark.parametrize("spec_fixture", ("3.1.0",), indirect=True)
|
| 337 |
+
def test_field_with_range_type_list_without_number(spec_fixture):
|
| 338 |
+
class NullableInteger(fields.Field):
|
| 339 |
+
"""Nullable integer"""
|
| 340 |
+
|
| 341 |
+
spec_fixture.openapi.map_to_openapi_type(NullableInteger, ["string", "null"], None)
|
| 342 |
+
|
| 343 |
+
field = NullableInteger(validate=validate.Range(min=1, max=10))
|
| 344 |
+
res = spec_fixture.openapi.field2property(field)
|
| 345 |
+
assert res["x-minimum"] == 1
|
| 346 |
+
assert res["x-maximum"] == 10
|
| 347 |
+
assert res["type"] == ["string", "null"]
|
| 348 |
+
|
| 349 |
+
|
| 350 |
+
def test_field_with_range_datetime_type(spec_fixture):
|
| 351 |
+
field = fields.DateTime(
|
| 352 |
+
validate=validate.Range(
|
| 353 |
+
min=dt.datetime(1900, 1, 1),
|
| 354 |
+
max=dt.datetime(2000, 1, 1),
|
| 355 |
+
)
|
| 356 |
+
)
|
| 357 |
+
res = spec_fixture.openapi.field2property(field)
|
| 358 |
+
assert res["x-minimum"] == "1900-01-01T00:00:00"
|
| 359 |
+
assert res["x-maximum"] == "2000-01-01T00:00:00"
|
| 360 |
+
assert isinstance(res["type"], str)
|
| 361 |
+
|
| 362 |
+
|
| 363 |
+
def test_field_with_str_regex(spec_fixture):
|
| 364 |
+
regex_str = "^[a-zA-Z0-9]$"
|
| 365 |
+
field = fields.Str(validate=validate.Regexp(regex_str))
|
| 366 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 367 |
+
assert ret["pattern"] == regex_str
|
| 368 |
+
|
| 369 |
+
|
| 370 |
+
def test_field_with_pattern_obj_regex(spec_fixture):
|
| 371 |
+
regex_str = "^[a-zA-Z0-9]$"
|
| 372 |
+
field = fields.Str(validate=validate.Regexp(re.compile(regex_str)))
|
| 373 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 374 |
+
assert ret["pattern"] == regex_str
|
| 375 |
+
|
| 376 |
+
|
| 377 |
+
def test_field_with_no_pattern(spec_fixture):
|
| 378 |
+
field = fields.Str()
|
| 379 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 380 |
+
assert "pattern" not in ret
|
| 381 |
+
|
| 382 |
+
|
| 383 |
+
def test_field_with_multiple_patterns(recwarn, spec_fixture):
|
| 384 |
+
regex_validators = [validate.Regexp("winner"), validate.Regexp("loser")]
|
| 385 |
+
field = fields.Str(validate=regex_validators)
|
| 386 |
+
with pytest.warns(UserWarning, match="More than one regex validator"):
|
| 387 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 388 |
+
assert ret["pattern"] == "winner"
|
| 389 |
+
|
| 390 |
+
|
| 391 |
+
def test_enum_symbol_field(spec_fixture):
|
| 392 |
+
class MyEnum(Enum):
|
| 393 |
+
one = 1
|
| 394 |
+
two = 2
|
| 395 |
+
|
| 396 |
+
field = fields.Enum(MyEnum)
|
| 397 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 398 |
+
assert ret["type"] == "string"
|
| 399 |
+
assert ret["enum"] == ["one", "two"]
|
| 400 |
+
|
| 401 |
+
|
| 402 |
+
@pytest.mark.parametrize("by_value", [fields.Integer, True])
|
| 403 |
+
def test_enum_value_field(spec_fixture, by_value):
|
| 404 |
+
class MyEnum(Enum):
|
| 405 |
+
one = 1
|
| 406 |
+
two = 2
|
| 407 |
+
|
| 408 |
+
field = fields.Enum(MyEnum, by_value=by_value)
|
| 409 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 410 |
+
if by_value is True:
|
| 411 |
+
assert "type" not in ret
|
| 412 |
+
else:
|
| 413 |
+
assert ret["type"] == "integer"
|
| 414 |
+
assert ret["enum"] == [1, 2]
|
| 415 |
+
|
| 416 |
+
|
| 417 |
+
def test_nullable_enum(spec_fixture):
|
| 418 |
+
class MyEnum(Enum):
|
| 419 |
+
one = 1
|
| 420 |
+
two = 2
|
| 421 |
+
|
| 422 |
+
field = fields.Enum(MyEnum, allow_none=True, by_value=True)
|
| 423 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 424 |
+
assert ret["enum"] == [1, 2, None]
|
| 425 |
+
|
| 426 |
+
|
| 427 |
+
def test_nullable_enum_returns_only_one_none(spec_fixture):
|
| 428 |
+
class MyEnum(Enum):
|
| 429 |
+
one = 1
|
| 430 |
+
two = 2
|
| 431 |
+
three = None
|
| 432 |
+
|
| 433 |
+
field = fields.Enum(MyEnum, allow_none=True, by_value=True)
|
| 434 |
+
ret = spec_fixture.openapi.field2property(field)
|
| 435 |
+
assert ret["enum"] == [1, 2, None]
|
| 436 |
+
|
| 437 |
+
|
| 438 |
+
@pytest.mark.parametrize("spec_fixture", ("2.0", "3.0.0", "3.1.0"), indirect=True)
|
| 439 |
+
def test_field2property_nested_spec_metadatas(spec_fixture):
|
| 440 |
+
class Child(Schema):
|
| 441 |
+
name = fields.Str()
|
| 442 |
+
|
| 443 |
+
category = fields.Nested(
|
| 444 |
+
Child,
|
| 445 |
+
metadata={
|
| 446 |
+
"description": "A category",
|
| 447 |
+
"invalid_property": "not in the result",
|
| 448 |
+
"x_extension": "A great extension",
|
| 449 |
+
},
|
| 450 |
+
)
|
| 451 |
+
result = spec_fixture.openapi.field2property(category)
|
| 452 |
+
version = spec_fixture.openapi.openapi_version
|
| 453 |
+
if version.major < 3 or version.minor < 1:
|
| 454 |
+
assert result == {
|
| 455 |
+
"allOf": [build_ref(spec_fixture.spec, "schema", "Child")],
|
| 456 |
+
"description": "A category",
|
| 457 |
+
"x-extension": "A great extension",
|
| 458 |
+
}
|
| 459 |
+
else:
|
| 460 |
+
assert result == {
|
| 461 |
+
**build_ref(spec_fixture.spec, "schema", "Child"),
|
| 462 |
+
"description": "A category",
|
| 463 |
+
"x-extension": "A great extension",
|
| 464 |
+
}
|
| 465 |
+
|
| 466 |
+
|
| 467 |
+
def test_field2property_nested_spec(spec_fixture):
|
| 468 |
+
spec_fixture.spec.components.schema("Category", schema=CategorySchema)
|
| 469 |
+
category = fields.Nested(CategorySchema)
|
| 470 |
+
assert spec_fixture.openapi.field2property(category) == build_ref(
|
| 471 |
+
spec_fixture.spec, "schema", "Category"
|
| 472 |
+
)
|
| 473 |
+
|
| 474 |
+
|
| 475 |
+
def test_field2property_nested_many_spec(spec_fixture):
|
| 476 |
+
spec_fixture.spec.components.schema("Category", schema=CategorySchema)
|
| 477 |
+
category = fields.Nested(CategorySchema, many=True)
|
| 478 |
+
ret = spec_fixture.openapi.field2property(category)
|
| 479 |
+
assert ret["type"] == "array"
|
| 480 |
+
assert ret["items"] == build_ref(spec_fixture.spec, "schema", "Category")
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
def test_field2property_nested_ref(spec_fixture):
|
| 484 |
+
category = fields.Nested(CategorySchema)
|
| 485 |
+
ref = spec_fixture.openapi.field2property(category)
|
| 486 |
+
assert ref == build_ref(spec_fixture.spec, "schema", "Category")
|
| 487 |
+
|
| 488 |
+
|
| 489 |
+
def test_field2property_nested_many(spec_fixture):
|
| 490 |
+
categories = fields.Nested(CategorySchema, many=True)
|
| 491 |
+
res = spec_fixture.openapi.field2property(categories)
|
| 492 |
+
assert res["type"] == "array"
|
| 493 |
+
assert res["items"] == build_ref(spec_fixture.spec, "schema", "Category")
|
| 494 |
+
|
| 495 |
+
|
| 496 |
+
def test_nested_field_with_property(spec_fixture):
|
| 497 |
+
category_1 = fields.Nested(CategorySchema)
|
| 498 |
+
category_2 = fields.Nested(CategorySchema, dump_only=True)
|
| 499 |
+
category_3 = fields.Nested(CategorySchema, many=True)
|
| 500 |
+
category_4 = fields.Nested(CategorySchema, many=True, dump_only=True)
|
| 501 |
+
spec_fixture.spec.components.schema("Category", schema=CategorySchema)
|
| 502 |
+
|
| 503 |
+
assert spec_fixture.openapi.field2property(category_1) == build_ref(
|
| 504 |
+
spec_fixture.spec, "schema", "Category"
|
| 505 |
+
)
|
| 506 |
+
assert spec_fixture.openapi.field2property(category_2) == {
|
| 507 |
+
"allOf": [build_ref(spec_fixture.spec, "schema", "Category")],
|
| 508 |
+
"readOnly": True,
|
| 509 |
+
}
|
| 510 |
+
assert spec_fixture.openapi.field2property(category_3) == {
|
| 511 |
+
"items": build_ref(spec_fixture.spec, "schema", "Category"),
|
| 512 |
+
"type": "array",
|
| 513 |
+
}
|
| 514 |
+
assert spec_fixture.openapi.field2property(category_4) == {
|
| 515 |
+
"items": build_ref(spec_fixture.spec, "schema", "Category"),
|
| 516 |
+
"readOnly": True,
|
| 517 |
+
"type": "array",
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
|
| 521 |
+
def test_datetime2property_iso(spec_fixture):
|
| 522 |
+
field = fields.DateTime(format="iso")
|
| 523 |
+
res = spec_fixture.openapi.field2property(field)
|
| 524 |
+
assert res == {
|
| 525 |
+
"type": "string",
|
| 526 |
+
"format": "date-time",
|
| 527 |
+
}
|
| 528 |
+
|
| 529 |
+
|
| 530 |
+
def test_datetime2property_rfc(spec_fixture):
|
| 531 |
+
field = fields.DateTime(format="rfc")
|
| 532 |
+
res = spec_fixture.openapi.field2property(field)
|
| 533 |
+
assert res == {
|
| 534 |
+
"type": "string",
|
| 535 |
+
"format": None,
|
| 536 |
+
"example": "Wed, 02 Oct 2002 13:00:00 GMT",
|
| 537 |
+
"pattern": r"((Mon|Tue|Wed|Thu|Fri|Sat|Sun), ){0,1}\d{2} "
|
| 538 |
+
+ r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} \d{2}:\d{2}:\d{2} "
|
| 539 |
+
+ r"(UT|GMT|EST|EDT|CST|CDT|MST|MDT|PST|PDT|(Z|A|M|N)|(\+|-)\d{4})",
|
| 540 |
+
}
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
def test_datetime2property_timestamp(spec_fixture):
|
| 544 |
+
field = fields.DateTime(format="timestamp")
|
| 545 |
+
res = spec_fixture.openapi.field2property(field)
|
| 546 |
+
assert res == {
|
| 547 |
+
"type": "number",
|
| 548 |
+
"format": "float",
|
| 549 |
+
"min": "0",
|
| 550 |
+
"example": "1676451245.596",
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
|
| 554 |
+
def test_datetime2property_timestamp_ms(spec_fixture):
|
| 555 |
+
field = fields.DateTime(format="timestamp_ms")
|
| 556 |
+
res = spec_fixture.openapi.field2property(field)
|
| 557 |
+
assert res == {
|
| 558 |
+
"type": "number",
|
| 559 |
+
"format": "float",
|
| 560 |
+
"min": "0",
|
| 561 |
+
"example": "1676451277514.654",
|
| 562 |
+
}
|
| 563 |
+
|
| 564 |
+
|
| 565 |
+
def test_datetime2property_custom_format(spec_fixture):
|
| 566 |
+
field = fields.DateTime(
|
| 567 |
+
format="%d-%m%Y %H:%M:%S",
|
| 568 |
+
metadata={
|
| 569 |
+
"pattern": r"^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$"
|
| 570 |
+
},
|
| 571 |
+
)
|
| 572 |
+
res = spec_fixture.openapi.field2property(field)
|
| 573 |
+
assert res == {
|
| 574 |
+
"type": "string",
|
| 575 |
+
"format": None,
|
| 576 |
+
"pattern": r"^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$",
|
| 577 |
+
}
|
| 578 |
+
|
| 579 |
+
|
| 580 |
+
def test_datetime2property_custom_format_missing_regex(spec_fixture):
|
| 581 |
+
field = fields.DateTime(format="%d-%m%Y %H:%M:%S")
|
| 582 |
+
res = spec_fixture.openapi.field2property(field)
|
| 583 |
+
assert res == {
|
| 584 |
+
"type": "string",
|
| 585 |
+
"format": None,
|
| 586 |
+
"pattern": None,
|
| 587 |
+
}
|
| 588 |
+
|
| 589 |
+
|
| 590 |
+
class TestField2PropertyPluck:
|
| 591 |
+
@pytest.fixture(autouse=True)
|
| 592 |
+
def _setup(self, spec_fixture):
|
| 593 |
+
self.field2property = spec_fixture.openapi.field2property
|
| 594 |
+
|
| 595 |
+
self.spec = spec_fixture.spec
|
| 596 |
+
self.spec.components.schema("Category", schema=CategorySchema)
|
| 597 |
+
self.unplucked = get_schemas(self.spec)["Category"]["properties"]["breed"]
|
| 598 |
+
|
| 599 |
+
def test_spec(self, spec_fixture):
|
| 600 |
+
breed = fields.Pluck(CategorySchema, "breed")
|
| 601 |
+
assert self.field2property(breed) == self.unplucked
|
| 602 |
+
|
| 603 |
+
def test_with_property(self):
|
| 604 |
+
breed = fields.Pluck(CategorySchema, "breed", dump_only=True)
|
| 605 |
+
assert self.field2property(breed) == {**self.unplucked, "readOnly": True}
|
| 606 |
+
|
| 607 |
+
def test_metadata(self):
|
| 608 |
+
breed = fields.Pluck(
|
| 609 |
+
CategorySchema,
|
| 610 |
+
"breed",
|
| 611 |
+
metadata={
|
| 612 |
+
"description": "Category breed",
|
| 613 |
+
"invalid_property": "not in the result",
|
| 614 |
+
"x_extension": "A great extension",
|
| 615 |
+
},
|
| 616 |
+
)
|
| 617 |
+
assert self.field2property(breed) == {
|
| 618 |
+
**self.unplucked,
|
| 619 |
+
"description": "Category breed",
|
| 620 |
+
"x-extension": "A great extension",
|
| 621 |
+
}
|
| 622 |
+
|
| 623 |
+
def test_many(self):
|
| 624 |
+
breed = fields.Pluck(CategorySchema, "breed", many=True)
|
| 625 |
+
assert self.field2property(breed) == {"type": "array", "items": self.unplucked}
|
| 626 |
+
|
| 627 |
+
def test_many_with_property(self):
|
| 628 |
+
breed = fields.Pluck(CategorySchema, "breed", many=True, dump_only=True)
|
| 629 |
+
assert self.field2property(breed) == {
|
| 630 |
+
"items": self.unplucked,
|
| 631 |
+
"type": "array",
|
| 632 |
+
"readOnly": True,
|
| 633 |
+
}
|
| 634 |
+
|
| 635 |
+
|
| 636 |
+
def test_custom_properties_for_custom_fields(spec_fixture):
|
| 637 |
+
def custom_string2properties(self, field, **kwargs):
|
| 638 |
+
ret = {}
|
| 639 |
+
if isinstance(field, CustomStringField):
|
| 640 |
+
if self.openapi_version.major == 2:
|
| 641 |
+
ret["x-customString"] = True
|
| 642 |
+
else:
|
| 643 |
+
ret["x-customString"] = False
|
| 644 |
+
return ret
|
| 645 |
+
|
| 646 |
+
spec_fixture.marshmallow_plugin.converter.add_attribute_function(
|
| 647 |
+
custom_string2properties
|
| 648 |
+
)
|
| 649 |
+
properties = spec_fixture.marshmallow_plugin.converter.field2property(
|
| 650 |
+
CustomStringField()
|
| 651 |
+
)
|
| 652 |
+
assert properties["x-customString"] == (
|
| 653 |
+
spec_fixture.openapi.openapi_version.major == 2
|
| 654 |
+
)
|
| 655 |
+
|
| 656 |
+
|
| 657 |
+
def test_field2property_with_non_string_metadata_keys(spec_fixture):
|
| 658 |
+
class _DesertSentinel:
|
| 659 |
+
pass
|
| 660 |
+
|
| 661 |
+
field = fields.Boolean(metadata={"description": "A description"})
|
| 662 |
+
field.metadata[_DesertSentinel()] = "to be ignored"
|
| 663 |
+
result = spec_fixture.openapi.field2property(field)
|
| 664 |
+
assert result == {"description": "A description", "type": "boolean"}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_ext_marshmallow_openapi.py
ADDED
|
@@ -0,0 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from datetime import datetime
|
| 2 |
+
|
| 3 |
+
import pytest
|
| 4 |
+
from marshmallow import EXCLUDE, INCLUDE, RAISE, Schema, fields, validate
|
| 5 |
+
from packaging.version import Version
|
| 6 |
+
|
| 7 |
+
from apispec import APISpec, exceptions
|
| 8 |
+
from apispec.ext.marshmallow import MarshmallowPlugin, OpenAPIConverter
|
| 9 |
+
|
| 10 |
+
from .schemas import CustomList, CustomStringField
|
| 11 |
+
from .utils import build_ref, get_schemas, validate_spec
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class TestMarshmallowFieldToOpenAPI:
|
| 15 |
+
def test_fields_with_load_default_load(self, openapi):
|
| 16 |
+
class MySchema(Schema):
|
| 17 |
+
field = fields.Str(dump_default="foo", load_default="bar")
|
| 18 |
+
|
| 19 |
+
res = openapi.schema2parameters(MySchema, location="query")
|
| 20 |
+
if openapi.openapi_version.major < 3:
|
| 21 |
+
assert res[0]["default"] == "bar"
|
| 22 |
+
else:
|
| 23 |
+
assert res[0]["schema"]["default"] == "bar"
|
| 24 |
+
|
| 25 |
+
# json/body is invalid for OpenAPI 3
|
| 26 |
+
@pytest.mark.parametrize("openapi", ("2.0",), indirect=True)
|
| 27 |
+
def test_fields_default_location_mapping_if_schema_many(self, openapi):
|
| 28 |
+
class ExampleSchema(Schema):
|
| 29 |
+
id = fields.Int()
|
| 30 |
+
|
| 31 |
+
schema = ExampleSchema(many=True)
|
| 32 |
+
res = openapi.schema2parameters(schema=schema, location="json")
|
| 33 |
+
assert res[0]["in"] == "body"
|
| 34 |
+
|
| 35 |
+
def test_fields_with_dump_only(self, openapi):
|
| 36 |
+
class UserSchema(Schema):
|
| 37 |
+
name = fields.Str(dump_only=True)
|
| 38 |
+
|
| 39 |
+
res = openapi.schema2parameters(schema=UserSchema(), location="query")
|
| 40 |
+
assert len(res) == 0
|
| 41 |
+
|
| 42 |
+
class UserSchema2(Schema):
|
| 43 |
+
name = fields.Str()
|
| 44 |
+
|
| 45 |
+
class Meta:
|
| 46 |
+
dump_only = ("name",)
|
| 47 |
+
|
| 48 |
+
res = openapi.schema2parameters(schema=UserSchema2(), location="query")
|
| 49 |
+
assert len(res) == 0
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
class TestMarshmallowSchemaToModelDefinition:
|
| 53 |
+
def test_schema2jsonschema_with_explicit_fields(self, openapi):
|
| 54 |
+
class UserSchema(Schema):
|
| 55 |
+
_id = fields.Int()
|
| 56 |
+
email = fields.Email(metadata={"description": "email address of the user"})
|
| 57 |
+
name = fields.Str()
|
| 58 |
+
|
| 59 |
+
class Meta:
|
| 60 |
+
title = "User"
|
| 61 |
+
|
| 62 |
+
res = openapi.schema2jsonschema(UserSchema)
|
| 63 |
+
assert res["title"] == "User"
|
| 64 |
+
assert res["type"] == "object"
|
| 65 |
+
props = res["properties"]
|
| 66 |
+
assert props["_id"]["type"] == "integer"
|
| 67 |
+
assert props["email"]["type"] == "string"
|
| 68 |
+
assert props["email"]["format"] == "email"
|
| 69 |
+
assert props["email"]["description"] == "email address of the user"
|
| 70 |
+
|
| 71 |
+
def test_schema2jsonschema_override_name(self, openapi):
|
| 72 |
+
class ExampleSchema(Schema):
|
| 73 |
+
_id = fields.Int(data_key="id")
|
| 74 |
+
_global = fields.Int(data_key="global")
|
| 75 |
+
|
| 76 |
+
class Meta:
|
| 77 |
+
exclude = ("_global",)
|
| 78 |
+
|
| 79 |
+
res = openapi.schema2jsonschema(ExampleSchema)
|
| 80 |
+
assert res["type"] == "object"
|
| 81 |
+
props = res["properties"]
|
| 82 |
+
# `_id` renamed to `id`
|
| 83 |
+
assert "_id" not in props and props["id"]["type"] == "integer"
|
| 84 |
+
# `_global` excluded correctly
|
| 85 |
+
assert "_global" not in props and "global" not in props
|
| 86 |
+
|
| 87 |
+
def test_required_fields(self, openapi):
|
| 88 |
+
class BandSchema(Schema):
|
| 89 |
+
drummer = fields.Str(required=True)
|
| 90 |
+
bassist = fields.Str()
|
| 91 |
+
|
| 92 |
+
res = openapi.schema2jsonschema(BandSchema)
|
| 93 |
+
assert res["required"] == ["drummer"]
|
| 94 |
+
|
| 95 |
+
def test_partial(self, openapi):
|
| 96 |
+
class BandSchema(Schema):
|
| 97 |
+
drummer = fields.Str(required=True)
|
| 98 |
+
bassist = fields.Str(required=True)
|
| 99 |
+
|
| 100 |
+
res = openapi.schema2jsonschema(BandSchema(partial=True))
|
| 101 |
+
assert "required" not in res
|
| 102 |
+
|
| 103 |
+
res = openapi.schema2jsonschema(BandSchema(partial=("drummer",)))
|
| 104 |
+
assert res["required"] == ["bassist"]
|
| 105 |
+
|
| 106 |
+
def test_no_required_fields(self, openapi):
|
| 107 |
+
class BandSchema(Schema):
|
| 108 |
+
drummer = fields.Str()
|
| 109 |
+
bassist = fields.Str()
|
| 110 |
+
|
| 111 |
+
res = openapi.schema2jsonschema(BandSchema)
|
| 112 |
+
assert "required" not in res
|
| 113 |
+
|
| 114 |
+
def test_title_and_description_may_be_added(self, openapi):
|
| 115 |
+
class UserSchema(Schema):
|
| 116 |
+
class Meta:
|
| 117 |
+
title = "User"
|
| 118 |
+
description = "A registered user"
|
| 119 |
+
|
| 120 |
+
res = openapi.schema2jsonschema(UserSchema)
|
| 121 |
+
assert res["description"] == "A registered user"
|
| 122 |
+
assert res["title"] == "User"
|
| 123 |
+
|
| 124 |
+
def test_excluded_fields(self, openapi):
|
| 125 |
+
class WhiteStripesSchema(Schema):
|
| 126 |
+
class Meta:
|
| 127 |
+
exclude = ("bassist",)
|
| 128 |
+
|
| 129 |
+
guitarist = fields.Str()
|
| 130 |
+
drummer = fields.Str()
|
| 131 |
+
bassist = fields.Str()
|
| 132 |
+
|
| 133 |
+
res = openapi.schema2jsonschema(WhiteStripesSchema)
|
| 134 |
+
assert set(res["properties"].keys()) == {"guitarist", "drummer"}
|
| 135 |
+
|
| 136 |
+
def test_unknown_values_disallow(self, openapi):
|
| 137 |
+
class UnknownRaiseSchema(Schema):
|
| 138 |
+
class Meta:
|
| 139 |
+
unknown = RAISE
|
| 140 |
+
|
| 141 |
+
first = fields.Str()
|
| 142 |
+
|
| 143 |
+
res = openapi.schema2jsonschema(UnknownRaiseSchema)
|
| 144 |
+
assert res["additionalProperties"] is False
|
| 145 |
+
|
| 146 |
+
def test_unknown_values_allow(self, openapi):
|
| 147 |
+
class UnknownIncludeSchema(Schema):
|
| 148 |
+
class Meta:
|
| 149 |
+
unknown = INCLUDE
|
| 150 |
+
|
| 151 |
+
first = fields.Str()
|
| 152 |
+
|
| 153 |
+
res = openapi.schema2jsonschema(UnknownIncludeSchema)
|
| 154 |
+
assert res["additionalProperties"] is True
|
| 155 |
+
|
| 156 |
+
def test_unknown_values_ignore(self, openapi):
|
| 157 |
+
class UnknownExcludeSchema(Schema):
|
| 158 |
+
class Meta:
|
| 159 |
+
unknown = EXCLUDE
|
| 160 |
+
|
| 161 |
+
first = fields.Str()
|
| 162 |
+
|
| 163 |
+
res = openapi.schema2jsonschema(UnknownExcludeSchema)
|
| 164 |
+
assert "additionalProperties" not in res
|
| 165 |
+
|
| 166 |
+
def test_only_explicitly_declared_fields_are_translated(self, openapi):
|
| 167 |
+
class UserSchema(Schema):
|
| 168 |
+
_id = fields.Int()
|
| 169 |
+
|
| 170 |
+
class Meta:
|
| 171 |
+
title = "User"
|
| 172 |
+
fields = ("_id", "email")
|
| 173 |
+
|
| 174 |
+
with pytest.warns(
|
| 175 |
+
UserWarning,
|
| 176 |
+
match="Only explicitly-declared fields will be included in the Schema Object.",
|
| 177 |
+
):
|
| 178 |
+
res = openapi.schema2jsonschema(UserSchema)
|
| 179 |
+
assert res["type"] == "object"
|
| 180 |
+
props = res["properties"]
|
| 181 |
+
assert "_id" in props
|
| 182 |
+
assert "email" not in props
|
| 183 |
+
|
| 184 |
+
def test_observed_field_name_for_required_field(self, openapi):
|
| 185 |
+
fields_dict = {"user_id": fields.Int(data_key="id", required=True)}
|
| 186 |
+
res = openapi.fields2jsonschema(fields_dict)
|
| 187 |
+
assert res["required"] == ["id"]
|
| 188 |
+
|
| 189 |
+
@pytest.mark.parametrize("many", (True, False))
|
| 190 |
+
def test_schema_instance_inspection(self, openapi, many):
|
| 191 |
+
class UserSchema(Schema):
|
| 192 |
+
_id = fields.Int()
|
| 193 |
+
|
| 194 |
+
res = openapi.schema2jsonschema(UserSchema(many=many))
|
| 195 |
+
assert res["type"] == "object"
|
| 196 |
+
props = res["properties"]
|
| 197 |
+
assert "_id" in props
|
| 198 |
+
|
| 199 |
+
def test_raises_error_if_no_declared_fields(self, openapi):
|
| 200 |
+
class NotASchema:
|
| 201 |
+
pass
|
| 202 |
+
|
| 203 |
+
expected_error = (
|
| 204 |
+
f"{NotASchema!r} is neither a Schema class nor a Schema instance."
|
| 205 |
+
)
|
| 206 |
+
with pytest.raises(ValueError, match=expected_error):
|
| 207 |
+
openapi.schema2jsonschema(NotASchema)
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
class TestMarshmallowSchemaToParameters:
|
| 211 |
+
def test_custom_properties_for_custom_fields(self, spec_fixture):
|
| 212 |
+
class DelimitedList(fields.List):
|
| 213 |
+
"""Delimited list field"""
|
| 214 |
+
|
| 215 |
+
def delimited_list2param(self, field: fields.Field, **kwargs) -> dict:
|
| 216 |
+
ret: dict = {}
|
| 217 |
+
if isinstance(field, DelimitedList):
|
| 218 |
+
if self.openapi_version.major < 3:
|
| 219 |
+
ret["collectionFormat"] = "csv"
|
| 220 |
+
else:
|
| 221 |
+
ret["explode"] = False
|
| 222 |
+
ret["style"] = "form"
|
| 223 |
+
return ret
|
| 224 |
+
|
| 225 |
+
spec_fixture.marshmallow_plugin.converter.add_parameter_attribute_function(
|
| 226 |
+
delimited_list2param
|
| 227 |
+
)
|
| 228 |
+
|
| 229 |
+
class MySchema(Schema):
|
| 230 |
+
delimited_list = DelimitedList(fields.Int)
|
| 231 |
+
|
| 232 |
+
param = spec_fixture.marshmallow_plugin.converter.schema2parameters(
|
| 233 |
+
MySchema(), location="query"
|
| 234 |
+
)[0]
|
| 235 |
+
|
| 236 |
+
if spec_fixture.openapi.openapi_version.major < 3:
|
| 237 |
+
assert param["collectionFormat"] == "csv"
|
| 238 |
+
else:
|
| 239 |
+
assert param["explode"] is False
|
| 240 |
+
assert param["style"] == "form"
|
| 241 |
+
|
| 242 |
+
def test_field_required(self, openapi):
|
| 243 |
+
field = fields.Str(required=True)
|
| 244 |
+
res = openapi._field2parameter(field, name="field", location="query")
|
| 245 |
+
assert res["required"] is True
|
| 246 |
+
|
| 247 |
+
def test_field_deprecated(self, openapi):
|
| 248 |
+
field = fields.Str(metadata={"deprecated": True})
|
| 249 |
+
res = openapi._field2parameter(field, name="field", location="query")
|
| 250 |
+
assert res["deprecated"] is True
|
| 251 |
+
|
| 252 |
+
def test_schema_partial(self, openapi):
|
| 253 |
+
class UserSchema(Schema):
|
| 254 |
+
field = fields.Str(required=True)
|
| 255 |
+
|
| 256 |
+
res_nodump = openapi.schema2parameters(
|
| 257 |
+
UserSchema(partial=True), location="query"
|
| 258 |
+
)
|
| 259 |
+
|
| 260 |
+
param = res_nodump[0]
|
| 261 |
+
assert param["required"] is False
|
| 262 |
+
|
| 263 |
+
def test_schema_partial_list(self, openapi):
|
| 264 |
+
class UserSchema(Schema):
|
| 265 |
+
field = fields.Str(required=True)
|
| 266 |
+
partial_field = fields.Str(required=True)
|
| 267 |
+
|
| 268 |
+
res_nodump = openapi.schema2parameters(
|
| 269 |
+
UserSchema(partial=("partial_field",)), location="query"
|
| 270 |
+
)
|
| 271 |
+
|
| 272 |
+
param = next(p for p in res_nodump if p["name"] == "field")
|
| 273 |
+
assert param["required"] is True
|
| 274 |
+
param = next(p for p in res_nodump if p["name"] == "partial_field")
|
| 275 |
+
assert param["required"] is False
|
| 276 |
+
|
| 277 |
+
@pytest.mark.parametrize("ListClass", [fields.List, CustomList])
|
| 278 |
+
def test_field_list(self, ListClass, openapi):
|
| 279 |
+
field = ListClass(fields.Str)
|
| 280 |
+
res = openapi._field2parameter(field, name="field", location="query")
|
| 281 |
+
assert res["in"] == "query"
|
| 282 |
+
if openapi.openapi_version.major < 3:
|
| 283 |
+
assert res["type"] == "array"
|
| 284 |
+
assert res["items"]["type"] == "string"
|
| 285 |
+
assert res["collectionFormat"] == "multi"
|
| 286 |
+
else:
|
| 287 |
+
assert res["schema"]["type"] == "array"
|
| 288 |
+
assert res["schema"]["items"]["type"] == "string"
|
| 289 |
+
assert res["style"] == "form"
|
| 290 |
+
assert res["explode"] is True
|
| 291 |
+
|
| 292 |
+
# json/body is invalid for OpenAPI 3
|
| 293 |
+
@pytest.mark.parametrize("openapi", ("2.0",), indirect=True)
|
| 294 |
+
def test_schema_body(self, openapi):
|
| 295 |
+
class UserSchema(Schema):
|
| 296 |
+
name = fields.Str()
|
| 297 |
+
email = fields.Email()
|
| 298 |
+
|
| 299 |
+
res = openapi.schema2parameters(UserSchema, location="body")
|
| 300 |
+
assert len(res) == 1
|
| 301 |
+
param = res[0]
|
| 302 |
+
assert param["in"] == "body"
|
| 303 |
+
assert param["schema"] == {"$ref": "#/definitions/User"}
|
| 304 |
+
|
| 305 |
+
# json/body is invalid for OpenAPI 3
|
| 306 |
+
@pytest.mark.parametrize("openapi", ("2.0",), indirect=True)
|
| 307 |
+
def test_schema_body_with_dump_only(self, openapi):
|
| 308 |
+
class UserSchema(Schema):
|
| 309 |
+
name = fields.Str()
|
| 310 |
+
email = fields.Email(dump_only=True)
|
| 311 |
+
|
| 312 |
+
res_nodump = openapi.schema2parameters(UserSchema, location="body")
|
| 313 |
+
assert len(res_nodump) == 1
|
| 314 |
+
param = res_nodump[0]
|
| 315 |
+
assert param["in"] == "body"
|
| 316 |
+
assert param["schema"] == build_ref(openapi.spec, "schema", "User")
|
| 317 |
+
|
| 318 |
+
# json/body is invalid for OpenAPI 3
|
| 319 |
+
@pytest.mark.parametrize("openapi", ("2.0",), indirect=True)
|
| 320 |
+
def test_schema_body_many(self, openapi):
|
| 321 |
+
class UserSchema(Schema):
|
| 322 |
+
name = fields.Str()
|
| 323 |
+
email = fields.Email()
|
| 324 |
+
|
| 325 |
+
res = openapi.schema2parameters(UserSchema(many=True), location="body")
|
| 326 |
+
assert len(res) == 1
|
| 327 |
+
param = res[0]
|
| 328 |
+
assert param["in"] == "body"
|
| 329 |
+
assert param["schema"]["type"] == "array"
|
| 330 |
+
assert param["schema"]["items"] == {"$ref": "#/definitions/User"}
|
| 331 |
+
|
| 332 |
+
def test_schema_query(self, openapi):
|
| 333 |
+
class UserSchema(Schema):
|
| 334 |
+
name = fields.Str()
|
| 335 |
+
email = fields.Email()
|
| 336 |
+
|
| 337 |
+
res = openapi.schema2parameters(UserSchema, location="query")
|
| 338 |
+
assert len(res) == 2
|
| 339 |
+
res.sort(key=lambda param: param["name"])
|
| 340 |
+
assert res[0]["name"] == "email"
|
| 341 |
+
assert res[0]["in"] == "query"
|
| 342 |
+
assert res[1]["name"] == "name"
|
| 343 |
+
assert res[1]["in"] == "query"
|
| 344 |
+
|
| 345 |
+
def test_schema_query_instance(self, openapi):
|
| 346 |
+
class UserSchema(Schema):
|
| 347 |
+
name = fields.Str()
|
| 348 |
+
email = fields.Email()
|
| 349 |
+
|
| 350 |
+
res = openapi.schema2parameters(UserSchema(), location="query")
|
| 351 |
+
assert len(res) == 2
|
| 352 |
+
res.sort(key=lambda param: param["name"])
|
| 353 |
+
assert res[0]["name"] == "email"
|
| 354 |
+
assert res[0]["in"] == "query"
|
| 355 |
+
assert res[1]["name"] == "name"
|
| 356 |
+
assert res[1]["in"] == "query"
|
| 357 |
+
|
| 358 |
+
def test_schema_query_instance_many_should_raise_exception(self, openapi):
|
| 359 |
+
class UserSchema(Schema):
|
| 360 |
+
name = fields.Str()
|
| 361 |
+
email = fields.Email()
|
| 362 |
+
|
| 363 |
+
with pytest.raises(AssertionError):
|
| 364 |
+
openapi.schema2parameters(UserSchema(many=True), location="query")
|
| 365 |
+
|
| 366 |
+
def test_fields_query(self, openapi):
|
| 367 |
+
class MySchema(Schema):
|
| 368 |
+
name = fields.Str()
|
| 369 |
+
email = fields.Email()
|
| 370 |
+
|
| 371 |
+
res = openapi.schema2parameters(MySchema, location="query")
|
| 372 |
+
assert len(res) == 2
|
| 373 |
+
res.sort(key=lambda param: param["name"])
|
| 374 |
+
assert res[0]["name"] == "email"
|
| 375 |
+
assert res[0]["in"] == "query"
|
| 376 |
+
assert res[1]["name"] == "name"
|
| 377 |
+
assert res[1]["in"] == "query"
|
| 378 |
+
|
| 379 |
+
def test_raises_error_if_not_a_schema(self, openapi):
|
| 380 |
+
class NotASchema:
|
| 381 |
+
pass
|
| 382 |
+
|
| 383 |
+
expected_error = (
|
| 384 |
+
f"{NotASchema!r} is neither a Schema class nor a Schema instance."
|
| 385 |
+
)
|
| 386 |
+
with pytest.raises(ValueError, match=expected_error):
|
| 387 |
+
openapi.schema2jsonschema(NotASchema)
|
| 388 |
+
|
| 389 |
+
|
| 390 |
+
class CategorySchema(Schema):
|
| 391 |
+
id = fields.Int()
|
| 392 |
+
name = fields.Str(required=True)
|
| 393 |
+
breed = fields.Str(dump_only=True)
|
| 394 |
+
|
| 395 |
+
|
| 396 |
+
class PageSchema(Schema):
|
| 397 |
+
offset = fields.Int()
|
| 398 |
+
limit = fields.Int()
|
| 399 |
+
|
| 400 |
+
|
| 401 |
+
class PetSchema(Schema):
|
| 402 |
+
category = fields.Nested(CategorySchema, many=True)
|
| 403 |
+
name = fields.Str()
|
| 404 |
+
|
| 405 |
+
|
| 406 |
+
class TestNesting:
|
| 407 |
+
def test_schema2jsonschema_with_nested_fields(self, spec_fixture):
|
| 408 |
+
res = spec_fixture.openapi.schema2jsonschema(PetSchema)
|
| 409 |
+
props = res["properties"]
|
| 410 |
+
|
| 411 |
+
assert props["category"]["items"] == build_ref(
|
| 412 |
+
spec_fixture.spec, "schema", "Category"
|
| 413 |
+
)
|
| 414 |
+
|
| 415 |
+
@pytest.mark.parametrize("modifier", ("only", "exclude"))
|
| 416 |
+
def test_schema2jsonschema_with_nested_fields_only_exclude(
|
| 417 |
+
self, spec_fixture, modifier
|
| 418 |
+
):
|
| 419 |
+
class Child(Schema):
|
| 420 |
+
i = fields.Int()
|
| 421 |
+
j = fields.Int()
|
| 422 |
+
|
| 423 |
+
class Parent(Schema):
|
| 424 |
+
child = fields.Nested(Child, **{modifier: ("i",)})
|
| 425 |
+
|
| 426 |
+
spec_fixture.openapi.schema2jsonschema(Parent)
|
| 427 |
+
props = get_schemas(spec_fixture.spec)["Child"]["properties"]
|
| 428 |
+
assert ("i" in props) == (modifier == "only")
|
| 429 |
+
assert ("j" not in props) == (modifier == "only")
|
| 430 |
+
|
| 431 |
+
def test_schema2jsonschema_with_plucked_field(self, spec_fixture):
|
| 432 |
+
class PetSchema(Schema):
|
| 433 |
+
breed = fields.Pluck(CategorySchema, "breed")
|
| 434 |
+
|
| 435 |
+
category_schema = spec_fixture.openapi.schema2jsonschema(CategorySchema)
|
| 436 |
+
pet_schema = spec_fixture.openapi.schema2jsonschema(PetSchema)
|
| 437 |
+
assert (
|
| 438 |
+
pet_schema["properties"]["breed"] == category_schema["properties"]["breed"]
|
| 439 |
+
)
|
| 440 |
+
|
| 441 |
+
def test_schema2jsonschema_with_nested_fields_with_adhoc_changes(
|
| 442 |
+
self, spec_fixture
|
| 443 |
+
):
|
| 444 |
+
category_schema = CategorySchema()
|
| 445 |
+
category_schema.fields["id"].required = True
|
| 446 |
+
|
| 447 |
+
class PetSchema(Schema):
|
| 448 |
+
category = fields.Nested(category_schema, many=True)
|
| 449 |
+
name = fields.Str()
|
| 450 |
+
|
| 451 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 452 |
+
props = get_schemas(spec_fixture.spec)
|
| 453 |
+
|
| 454 |
+
assert props["Category"] == spec_fixture.openapi.schema2jsonschema(
|
| 455 |
+
category_schema
|
| 456 |
+
)
|
| 457 |
+
assert set(props["Category"]["required"]) == {"id", "name"}
|
| 458 |
+
|
| 459 |
+
props["Category"]["required"] = ["name"]
|
| 460 |
+
assert props["Category"] == spec_fixture.openapi.schema2jsonschema(
|
| 461 |
+
CategorySchema
|
| 462 |
+
)
|
| 463 |
+
|
| 464 |
+
def test_schema2jsonschema_with_plucked_fields_with_adhoc_changes(
|
| 465 |
+
self, spec_fixture
|
| 466 |
+
):
|
| 467 |
+
category_schema = CategorySchema()
|
| 468 |
+
category_schema.fields["breed"].dump_only = True
|
| 469 |
+
|
| 470 |
+
class PetSchema(Schema):
|
| 471 |
+
breed = fields.Pluck(category_schema, "breed", many=True)
|
| 472 |
+
|
| 473 |
+
spec_fixture.spec.components.schema("Pet", schema=PetSchema)
|
| 474 |
+
props = get_schemas(spec_fixture.spec)["Pet"]["properties"]
|
| 475 |
+
|
| 476 |
+
assert props["breed"]["items"]["readOnly"] is True
|
| 477 |
+
|
| 478 |
+
def test_schema2jsonschema_with_nested_excluded_fields(self, spec):
|
| 479 |
+
category_schema = CategorySchema(exclude=("breed",))
|
| 480 |
+
|
| 481 |
+
class PetSchema(Schema):
|
| 482 |
+
category = fields.Nested(category_schema)
|
| 483 |
+
|
| 484 |
+
spec.components.schema("Pet", schema=PetSchema)
|
| 485 |
+
|
| 486 |
+
category_props = get_schemas(spec)["Category"]["properties"]
|
| 487 |
+
assert "breed" not in category_props
|
| 488 |
+
|
| 489 |
+
|
| 490 |
+
def test_openapi_tools_validate_v2():
|
| 491 |
+
ma_plugin = MarshmallowPlugin()
|
| 492 |
+
spec = APISpec(
|
| 493 |
+
title="Pets", version="0.1", plugins=(ma_plugin,), openapi_version="2.0"
|
| 494 |
+
)
|
| 495 |
+
openapi = ma_plugin.converter
|
| 496 |
+
assert openapi is not None
|
| 497 |
+
|
| 498 |
+
spec.components.schema("Category", schema=CategorySchema)
|
| 499 |
+
spec.components.schema("Pet", {"discriminator": "name"}, schema=PetSchema)
|
| 500 |
+
|
| 501 |
+
spec.path(
|
| 502 |
+
view=None,
|
| 503 |
+
path="/category/{category_id}",
|
| 504 |
+
operations={
|
| 505 |
+
"get": {
|
| 506 |
+
"parameters": [
|
| 507 |
+
{"name": "q", "in": "query", "type": "string"},
|
| 508 |
+
{
|
| 509 |
+
"name": "category_id",
|
| 510 |
+
"in": "path",
|
| 511 |
+
"required": True,
|
| 512 |
+
"type": "string",
|
| 513 |
+
},
|
| 514 |
+
openapi._field2parameter(
|
| 515 |
+
field=fields.List(
|
| 516 |
+
fields.Str(),
|
| 517 |
+
validate=validate.OneOf(["freddie", "roger"]),
|
| 518 |
+
),
|
| 519 |
+
location="query",
|
| 520 |
+
name="body",
|
| 521 |
+
),
|
| 522 |
+
]
|
| 523 |
+
+ openapi.schema2parameters(PageSchema, location="query"),
|
| 524 |
+
"responses": {200: {"schema": PetSchema, "description": "A pet"}},
|
| 525 |
+
},
|
| 526 |
+
"post": {
|
| 527 |
+
"parameters": (
|
| 528 |
+
[
|
| 529 |
+
{
|
| 530 |
+
"name": "category_id",
|
| 531 |
+
"in": "path",
|
| 532 |
+
"required": True,
|
| 533 |
+
"type": "string",
|
| 534 |
+
}
|
| 535 |
+
]
|
| 536 |
+
+ openapi.schema2parameters(CategorySchema, location="body")
|
| 537 |
+
),
|
| 538 |
+
"responses": {201: {"schema": PetSchema, "description": "A pet"}},
|
| 539 |
+
},
|
| 540 |
+
},
|
| 541 |
+
)
|
| 542 |
+
try:
|
| 543 |
+
validate_spec(spec)
|
| 544 |
+
except exceptions.OpenAPIError as error:
|
| 545 |
+
pytest.fail(str(error))
|
| 546 |
+
|
| 547 |
+
|
| 548 |
+
def test_openapi_tools_validate_v3():
|
| 549 |
+
ma_plugin = MarshmallowPlugin()
|
| 550 |
+
spec = APISpec(
|
| 551 |
+
title="Pets", version="0.1", plugins=(ma_plugin,), openapi_version="3.0.0"
|
| 552 |
+
)
|
| 553 |
+
openapi = ma_plugin.converter
|
| 554 |
+
assert openapi is not None
|
| 555 |
+
|
| 556 |
+
spec.components.schema("Category", schema=CategorySchema)
|
| 557 |
+
spec.components.schema("Pet", schema=PetSchema)
|
| 558 |
+
|
| 559 |
+
spec.path(
|
| 560 |
+
view=None,
|
| 561 |
+
path="/category/{category_id}",
|
| 562 |
+
operations={
|
| 563 |
+
"get": {
|
| 564 |
+
"parameters": [
|
| 565 |
+
{"name": "q", "in": "query", "schema": {"type": "string"}},
|
| 566 |
+
{
|
| 567 |
+
"name": "category_id",
|
| 568 |
+
"in": "path",
|
| 569 |
+
"required": True,
|
| 570 |
+
"schema": {"type": "string"},
|
| 571 |
+
},
|
| 572 |
+
openapi._field2parameter(
|
| 573 |
+
field=fields.List(
|
| 574 |
+
fields.Str(),
|
| 575 |
+
validate=validate.OneOf(["freddie", "roger"]),
|
| 576 |
+
),
|
| 577 |
+
location="query",
|
| 578 |
+
name="body",
|
| 579 |
+
),
|
| 580 |
+
]
|
| 581 |
+
+ openapi.schema2parameters(PageSchema, location="query"),
|
| 582 |
+
"responses": {
|
| 583 |
+
200: {
|
| 584 |
+
"description": "success",
|
| 585 |
+
"content": {"application/json": {"schema": PetSchema}},
|
| 586 |
+
}
|
| 587 |
+
},
|
| 588 |
+
},
|
| 589 |
+
"post": {
|
| 590 |
+
"parameters": (
|
| 591 |
+
[
|
| 592 |
+
{
|
| 593 |
+
"name": "category_id",
|
| 594 |
+
"in": "path",
|
| 595 |
+
"required": True,
|
| 596 |
+
"schema": {"type": "string"},
|
| 597 |
+
}
|
| 598 |
+
]
|
| 599 |
+
),
|
| 600 |
+
"requestBody": {
|
| 601 |
+
"content": {"application/json": {"schema": CategorySchema}}
|
| 602 |
+
},
|
| 603 |
+
"responses": {
|
| 604 |
+
201: {
|
| 605 |
+
"description": "created",
|
| 606 |
+
"content": {"application/json": {"schema": PetSchema}},
|
| 607 |
+
}
|
| 608 |
+
},
|
| 609 |
+
},
|
| 610 |
+
},
|
| 611 |
+
)
|
| 612 |
+
try:
|
| 613 |
+
validate_spec(spec)
|
| 614 |
+
except exceptions.OpenAPIError as error:
|
| 615 |
+
pytest.fail(str(error))
|
| 616 |
+
|
| 617 |
+
|
| 618 |
+
def test_openapi_converter_openapi_version_types():
|
| 619 |
+
spec = APISpec(title="Pets", version="0.1", openapi_version="2.0")
|
| 620 |
+
converter_with_version = OpenAPIConverter(Version("3.1"), None, spec)
|
| 621 |
+
converter_with_str_version = OpenAPIConverter("3.1", None, spec)
|
| 622 |
+
assert (
|
| 623 |
+
converter_with_version.openapi_version
|
| 624 |
+
== converter_with_str_version.openapi_version
|
| 625 |
+
)
|
| 626 |
+
|
| 627 |
+
|
| 628 |
+
class TestFieldValidation:
|
| 629 |
+
class ValidationSchema(Schema):
|
| 630 |
+
id = fields.Int(dump_only=True)
|
| 631 |
+
range = fields.Int(validate=validate.Range(min=1, max=10))
|
| 632 |
+
range_no_upper = fields.Float(validate=validate.Range(min=1))
|
| 633 |
+
multiple_ranges = fields.Int(
|
| 634 |
+
validate=[
|
| 635 |
+
validate.Range(min=1),
|
| 636 |
+
validate.Range(min=3),
|
| 637 |
+
validate.Range(max=10),
|
| 638 |
+
validate.Range(max=7),
|
| 639 |
+
]
|
| 640 |
+
)
|
| 641 |
+
list_length = fields.List(fields.Str, validate=validate.Length(min=1, max=10))
|
| 642 |
+
custom_list_length = CustomList(
|
| 643 |
+
fields.Str, validate=validate.Length(min=1, max=10)
|
| 644 |
+
)
|
| 645 |
+
string_length = fields.Str(validate=validate.Length(min=1, max=10))
|
| 646 |
+
custom_field_length = CustomStringField(validate=validate.Length(min=1, max=10))
|
| 647 |
+
multiple_lengths = fields.Str(
|
| 648 |
+
validate=[
|
| 649 |
+
validate.Length(min=1),
|
| 650 |
+
validate.Length(min=3),
|
| 651 |
+
validate.Length(max=10),
|
| 652 |
+
validate.Length(max=7),
|
| 653 |
+
]
|
| 654 |
+
)
|
| 655 |
+
equal_length = fields.Str(
|
| 656 |
+
validate=[validate.Length(equal=5), validate.Length(min=1, max=10)]
|
| 657 |
+
)
|
| 658 |
+
date_range = fields.DateTime(
|
| 659 |
+
validate=validate.Range(
|
| 660 |
+
min=datetime(1900, 1, 1),
|
| 661 |
+
)
|
| 662 |
+
)
|
| 663 |
+
|
| 664 |
+
@pytest.mark.parametrize(
|
| 665 |
+
("field", "properties"),
|
| 666 |
+
[
|
| 667 |
+
("range", {"minimum": 1, "maximum": 10}),
|
| 668 |
+
("range_no_upper", {"minimum": 1}),
|
| 669 |
+
("multiple_ranges", {"minimum": 3, "maximum": 7}),
|
| 670 |
+
("list_length", {"minItems": 1, "maxItems": 10}),
|
| 671 |
+
("custom_list_length", {"minItems": 1, "maxItems": 10}),
|
| 672 |
+
("string_length", {"minLength": 1, "maxLength": 10}),
|
| 673 |
+
("custom_field_length", {"minLength": 1, "maxLength": 10}),
|
| 674 |
+
("multiple_lengths", {"minLength": 3, "maxLength": 7}),
|
| 675 |
+
("equal_length", {"minLength": 5, "maxLength": 5}),
|
| 676 |
+
("date_range", {"x-minimum": "1900-01-01T00:00:00"}),
|
| 677 |
+
],
|
| 678 |
+
)
|
| 679 |
+
def test_properties(self, field, properties, spec):
|
| 680 |
+
spec.components.schema("Validation", schema=self.ValidationSchema)
|
| 681 |
+
result = get_schemas(spec)["Validation"]["properties"][field]
|
| 682 |
+
|
| 683 |
+
for attr, expected_value in properties.items():
|
| 684 |
+
assert attr in result
|
| 685 |
+
assert result[attr] == expected_value
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_utils.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from apispec import utils
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def test_build_reference():
|
| 5 |
+
assert utils.build_reference("schema", 2, "Test") == {"$ref": "#/definitions/Test"}
|
| 6 |
+
assert utils.build_reference("parameter", 2, "Test") == {
|
| 7 |
+
"$ref": "#/parameters/Test"
|
| 8 |
+
}
|
| 9 |
+
assert utils.build_reference("response", 2, "Test") == {"$ref": "#/responses/Test"}
|
| 10 |
+
assert utils.build_reference("security_scheme", 2, "Test") == {
|
| 11 |
+
"$ref": "#/securityDefinitions/Test"
|
| 12 |
+
}
|
| 13 |
+
assert utils.build_reference("schema", 3, "Test") == {
|
| 14 |
+
"$ref": "#/components/schemas/Test"
|
| 15 |
+
}
|
| 16 |
+
assert utils.build_reference("parameter", 3, "Test") == {
|
| 17 |
+
"$ref": "#/components/parameters/Test"
|
| 18 |
+
}
|
| 19 |
+
assert utils.build_reference("response", 3, "Test") == {
|
| 20 |
+
"$ref": "#/components/responses/Test"
|
| 21 |
+
}
|
| 22 |
+
assert utils.build_reference("security_scheme", 3, "Test") == {
|
| 23 |
+
"$ref": "#/components/securitySchemes/Test"
|
| 24 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/test_yaml_utils.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
|
| 3 |
+
from apispec import yaml_utils
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def test_load_yaml_from_docstring():
|
| 7 |
+
def f():
|
| 8 |
+
"""
|
| 9 |
+
Foo
|
| 10 |
+
bar
|
| 11 |
+
baz quux
|
| 12 |
+
|
| 13 |
+
---
|
| 14 |
+
herp: 1
|
| 15 |
+
derp: 2
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
result = yaml_utils.load_yaml_from_docstring(f.__doc__)
|
| 19 |
+
assert result == {"herp": 1, "derp": 2}
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
@pytest.mark.parametrize("docstring", (None, "", "---"))
|
| 23 |
+
def test_load_yaml_from_docstring_empty_docstring(docstring):
|
| 24 |
+
assert yaml_utils.load_yaml_from_docstring(docstring) == {}
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
@pytest.mark.parametrize("docstring", (None, "", "---"))
|
| 28 |
+
def test_load_operations_from_docstring_empty_docstring(docstring):
|
| 29 |
+
assert yaml_utils.load_operations_from_docstring(docstring) == {}
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def test_dict_to_yaml_unicode():
|
| 33 |
+
assert yaml_utils.dict_to_yaml({"가": "나"}) == '"\\uAC00": "\\uB098"\n'
|
| 34 |
+
assert yaml_utils.dict_to_yaml({"가": "나"}, {"allow_unicode": True}) == "가: 나\n"
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def test_dict_to_yaml_keys_are_not_sorted_by_default():
|
| 38 |
+
assert yaml_utils.dict_to_yaml({"herp": 1, "derp": 2}) == "herp: 1\nderp: 2\n"
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
def test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs():
|
| 42 |
+
assert (
|
| 43 |
+
yaml_utils.dict_to_yaml(
|
| 44 |
+
{"herp": 1, "derp": 2}, yaml_dump_kwargs={"sort_keys": True}
|
| 45 |
+
)
|
| 46 |
+
== "derp: 2\nherp: 1\n"
|
| 47 |
+
)
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tests/utils.py
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Utilities to get elements of generated spec"""
|
| 2 |
+
|
| 3 |
+
import openapi_spec_validator
|
| 4 |
+
from openapi_spec_validator.exceptions import OpenAPISpecValidatorError
|
| 5 |
+
|
| 6 |
+
from apispec import exceptions
|
| 7 |
+
from apispec.core import APISpec
|
| 8 |
+
from apispec.utils import build_reference
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def get_schemas(spec):
|
| 12 |
+
if spec.openapi_version.major < 3:
|
| 13 |
+
return spec.to_dict()["definitions"]
|
| 14 |
+
return spec.to_dict()["components"]["schemas"]
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def get_responses(spec):
|
| 18 |
+
if spec.openapi_version.major < 3:
|
| 19 |
+
return spec.to_dict()["responses"]
|
| 20 |
+
return spec.to_dict()["components"]["responses"]
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def get_parameters(spec):
|
| 24 |
+
if spec.openapi_version.major < 3:
|
| 25 |
+
return spec.to_dict()["parameters"]
|
| 26 |
+
return spec.to_dict()["components"]["parameters"]
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def get_headers(spec):
|
| 30 |
+
if spec.openapi_version.major < 3:
|
| 31 |
+
return spec.to_dict()["headers"]
|
| 32 |
+
return spec.to_dict()["components"]["headers"]
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def get_examples(spec):
|
| 36 |
+
return spec.to_dict()["components"]["examples"]
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def get_security_schemes(spec):
|
| 40 |
+
if spec.openapi_version.major < 3:
|
| 41 |
+
return spec.to_dict()["securityDefinitions"]
|
| 42 |
+
return spec.to_dict()["components"]["securitySchemes"]
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
def get_paths(spec):
|
| 46 |
+
return spec.to_dict()["paths"]
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def build_ref(spec, component_type, obj):
|
| 50 |
+
return build_reference(component_type, spec.openapi_version.major, obj)
|
| 51 |
+
|
| 52 |
+
|
| 53 |
+
def validate_spec(spec: APISpec) -> bool:
|
| 54 |
+
"""Validate the output of an :class:`APISpec` object against the
|
| 55 |
+
OpenAPI specification.
|
| 56 |
+
|
| 57 |
+
:raise: apispec.exceptions.OpenAPIError if validation fails.
|
| 58 |
+
"""
|
| 59 |
+
try:
|
| 60 |
+
# Coerce to dict to satisfy Pyright
|
| 61 |
+
openapi_spec_validator.validate(dict(spec.to_dict()))
|
| 62 |
+
except OpenAPISpecValidatorError as err:
|
| 63 |
+
raise exceptions.OpenAPIError(*err.args) from err
|
| 64 |
+
else:
|
| 65 |
+
return True
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/tests/trusted/tox.ini
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[tox]
|
| 2 |
+
envlist=
|
| 3 |
+
lint
|
| 4 |
+
py{39,310,311,312,313}-marshmallow3
|
| 5 |
+
py313-marshmallowdev
|
| 6 |
+
docs
|
| 7 |
+
|
| 8 |
+
[testenv]
|
| 9 |
+
extras = tests
|
| 10 |
+
deps =
|
| 11 |
+
marshmallow3: marshmallow>=3.10.0,<4.0.0
|
| 12 |
+
marshmallowdev: https://github.com/marshmallow-code/marshmallow/archive/dev.tar.gz
|
| 13 |
+
commands = pytest {posargs}
|
| 14 |
+
|
| 15 |
+
[testenv:lint]
|
| 16 |
+
deps = pre-commit~=3.5
|
| 17 |
+
skip_install = true
|
| 18 |
+
commands = pre-commit run --all-files
|
| 19 |
+
|
| 20 |
+
[testenv:docs]
|
| 21 |
+
extras = docs
|
| 22 |
+
commands = sphinx-build docs/ docs/_build {posargs}
|
| 23 |
+
|
| 24 |
+
; Below tasks are for development only (not run in CI)
|
| 25 |
+
|
| 26 |
+
[testenv:watch-docs]
|
| 27 |
+
deps = sphinx-autobuild
|
| 28 |
+
extras = docs
|
| 29 |
+
commands = sphinx-autobuild --open-browser docs/ docs/_build {posargs} --watch src/apispec --delay 2
|
| 30 |
+
|
| 31 |
+
[testenv:watch-readme]
|
| 32 |
+
deps = restview
|
| 33 |
+
skip_install = true
|
| 34 |
+
commands = restview README.rst
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/first-hunk-only.sh
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
cd /testbed/repo
|
| 4 |
+
cat > /tmp/openenv-reference.diff <<'OPENENV_PARTIAL'
|
| 5 |
+
diff --git a/src/apispec/ext/marshmallow/common.py b/src/apispec/ext/marshmallow/common.py
|
| 6 |
+
index 874cc4c4c63773177ad06bd0d75fdf851eaadec4..e5373771ab017e6b7dc138515139ab992c19cfe0 100644
|
| 7 |
+
--- a/src/apispec/ext/marshmallow/common.py
|
| 8 |
+
+++ b/src/apispec/ext/marshmallow/common.py
|
| 9 |
+
@@ -119,14 +119,14 @@
|
| 10 |
+
hash(attribute)
|
| 11 |
+
except TypeError:
|
| 12 |
+
# Unhashable iterable (list, set)
|
| 13 |
+
- attribute = list(attribute) # Change from frozenset to list
|
| 14 |
+
- modifiers.insert(0, attribute) # Change from append to insert at position 0
|
| 15 |
+
- return tuple([schema.__class__, *reversed(modifiers)]) # Reverse the modifiers to their original order
|
| 16 |
+
+ attribute = frozenset(attribute)
|
| 17 |
+
+ modifiers.append(attribute)
|
| 18 |
+
+ return tuple([schema.__class__, *modifiers])
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
def get_unique_schema_name(components: Components, name: str, counter: int = 0) -> str:
|
| 22 |
+
"""Function to generate a unique name based on the provided name and names
|
| 23 |
+
- already in the spec. Will append a number to the name to make it unique if
|
| 24 |
+
+ already in the spec. Will append a number to the name to make it unique if
|
| 25 |
+
the name is already in the spec.
|
| 26 |
+
|
| 27 |
+
:param Components components: instance of the components of the spec
|
| 28 |
+
OPENENV_PARTIAL
|
| 29 |
+
/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/canaries/original-bug.sh
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
:
|
tasks/marshmallow-code__apispec.8b421526.combine_file__sw95y0ye/validation/openenv.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"canaries": "validation/canaries",
|
| 3 |
+
"profile": "harbor-semantic-v1",
|
| 4 |
+
"requires_credentials": false,
|
| 5 |
+
"resources": {
|
| 6 |
+
"cpu": 2,
|
| 7 |
+
"disk_mb": 16384,
|
| 8 |
+
"episode_timeout_s": 1800,
|
| 9 |
+
"memory_mb": 8192
|
| 10 |
+
},
|
| 11 |
+
"reward": {
|
| 12 |
+
"floor_margin": 0.1,
|
| 13 |
+
"oracle_tolerance": 0,
|
| 14 |
+
"range": [
|
| 15 |
+
0,
|
| 16 |
+
1
|
| 17 |
+
]
|
| 18 |
+
},
|
| 19 |
+
"reward_key": "reward",
|
| 20 |
+
"types": {
|
| 21 |
+
"tags": [
|
| 22 |
+
"swe",
|
| 23 |
+
"python",
|
| 24 |
+
"mutation-repair"
|
| 25 |
+
]
|
| 26 |
+
}
|
| 27 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/LICENSE.source
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright Steven Loria, Jérôme Lafréchoux, and contributors
|
| 2 |
+
|
| 3 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 4 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 5 |
+
in the Software without restriction, including without limitation the rights
|
| 6 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 7 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 8 |
+
furnished to do so, subject to the following conditions:
|
| 9 |
+
|
| 10 |
+
The above copyright notice and this permission notice shall be included in
|
| 11 |
+
all copies or substantial portions of the Software.
|
| 12 |
+
|
| 13 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 14 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 15 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 16 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 17 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 18 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 19 |
+
THE SOFTWARE.
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/adapter.json
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"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.",
|
| 3 |
+
"collector_sha256": "352e555112f2de8a1393f939903e4971c9ace0e944843762b707a725c5c72481",
|
| 4 |
+
"dependency_installation_pinned": false,
|
| 5 |
+
"dependency_setup_sha256": "213839c53a312d83a5569a18303cecdb03befd5a43f54c1af2e7afcf93ea1ac5",
|
| 6 |
+
"gold_patch_sha256": "ec036495f24bdfc187e0075606bb1302ea32f79002282ab5f371e9977f625deb",
|
| 7 |
+
"hostile_code_isolation_established": false,
|
| 8 |
+
"known_wrong_semantic_implementations": 0,
|
| 9 |
+
"native_inventory_sha256": "dd3448c2eb820abf9ea82f0dabef7a7d301586f5320119e3512798095802fc0e",
|
| 10 |
+
"new_files_deletions_and_executable_modes_supported": true,
|
| 11 |
+
"official_profile": {
|
| 12 |
+
"eval_sets": [],
|
| 13 |
+
"profile_class": "Apispec8b421526",
|
| 14 |
+
"profile_lines": [
|
| 15 |
+
127,
|
| 16 |
+
131
|
| 17 |
+
],
|
| 18 |
+
"profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f",
|
| 19 |
+
"profile_source_path": "swesmith/profiles/python.py",
|
| 20 |
+
"profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286",
|
| 21 |
+
"upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 22 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 23 |
+
},
|
| 24 |
+
"original_bug_canary_nop_equivalent": true,
|
| 25 |
+
"original_bug_runtime_wrongness_established": false,
|
| 26 |
+
"partial_repair_canary": true,
|
| 27 |
+
"partial_repair_sha256": "1f693dde54b5b5e7965825988a40442799c5b5cc6177da325e1e9b0244792f9a",
|
| 28 |
+
"partial_repair_wrongness_established": false,
|
| 29 |
+
"provided_original_bug_control": true,
|
| 30 |
+
"repo_url": "https://github.com/swesmith/marshmallow-code__apispec.8b421526.git",
|
| 31 |
+
"runtime_image": null,
|
| 32 |
+
"runtime_ready": false,
|
| 33 |
+
"runtime_recipe": {
|
| 34 |
+
"dependency_installation_pinned": false,
|
| 35 |
+
"official_install_cmds": [
|
| 36 |
+
"pip install -e .[dev]"
|
| 37 |
+
],
|
| 38 |
+
"official_pytest_argv": [
|
| 39 |
+
"pytest",
|
| 40 |
+
"--disable-warnings",
|
| 41 |
+
"--color=no",
|
| 42 |
+
"--tb=no",
|
| 43 |
+
"--verbose"
|
| 44 |
+
],
|
| 45 |
+
"official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose",
|
| 46 |
+
"panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.",
|
| 47 |
+
"python_version": "3.10",
|
| 48 |
+
"source_bound_test_dependency_cmds": [
|
| 49 |
+
"python -m pip install 'marshmallow>=3.10.0,<4.0.0'"
|
| 50 |
+
],
|
| 51 |
+
"test_dependency_source_sha256": {
|
| 52 |
+
"pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4",
|
| 53 |
+
"tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7"
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"runtime_resource_review_required": false,
|
| 57 |
+
"schema": "python-git-patch-jobs-v1",
|
| 58 |
+
"source_base_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da",
|
| 59 |
+
"source_completion_sha256": "2ef340184cc1d9dfcd2cbc9bb05622525f817bc4a8e7dc4790232a42c6108cc0",
|
| 60 |
+
"source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876",
|
| 61 |
+
"source_pr_url": null,
|
| 62 |
+
"source_record": {
|
| 63 |
+
"anti_training_canary": false,
|
| 64 |
+
"anti_training_reviewed": true,
|
| 65 |
+
"candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 66 |
+
"cloud_launch_ready": false,
|
| 67 |
+
"eligibility": {
|
| 68 |
+
"reasons": [],
|
| 69 |
+
"semantic_nonoverlap_established": false,
|
| 70 |
+
"status": "eligible_for_controls",
|
| 71 |
+
"training_admissible": false,
|
| 72 |
+
"warnings": []
|
| 73 |
+
},
|
| 74 |
+
"healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 75 |
+
"instruction_sha256": "58e450f9279684eedad9ec4d60c7843ea4f327a7b998dec18d6f185a07ef320a",
|
| 76 |
+
"is_fork": true,
|
| 77 |
+
"learner_path": "tasks/b491c0d8099392581ef57f79/learner",
|
| 78 |
+
"license_evidence": {
|
| 79 |
+
"source_code": {
|
| 80 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 81 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 82 |
+
"reviewed": true,
|
| 83 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 84 |
+
"spdx": "MIT",
|
| 85 |
+
"training_allowed": true,
|
| 86 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE"
|
| 87 |
+
},
|
| 88 |
+
"task_bundle": {
|
| 89 |
+
"reviewed": true,
|
| 90 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 91 |
+
"spdx": "MIT",
|
| 92 |
+
"training_allowed": true,
|
| 93 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 94 |
+
}
|
| 95 |
+
},
|
| 96 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 97 |
+
"patch_sha256": "9f63a2eaa5b2a77d4e0a4bd4406001c92d391be96abbf626ca370ad0f9e616ed",
|
| 98 |
+
"provenance_path": "tasks/b491c0d8099392581ef57f79/source-proof.json",
|
| 99 |
+
"repository_lineage": [
|
| 100 |
+
"swesmith/marshmallow-code__apispec.8b421526",
|
| 101 |
+
"marshmallow-code/apispec"
|
| 102 |
+
],
|
| 103 |
+
"rfc008_complete": false,
|
| 104 |
+
"runtime_qualified": false,
|
| 105 |
+
"semantic_nonoverlap_established": false,
|
| 106 |
+
"source_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da",
|
| 107 |
+
"source_dataset": "SWE-bench/SWE-smith-py",
|
| 108 |
+
"source_head_commit": "24e2ab1be595b648135a3e70b7b5bc2784273669",
|
| 109 |
+
"source_kind": "mutation",
|
| 110 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 111 |
+
"source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e",
|
| 112 |
+
"source_split": "train",
|
| 113 |
+
"target_model_calibrated": false,
|
| 114 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 115 |
+
"task_sha256": "8c5ba9cccfd4e92bfe3ba985908417f3b97bd5e79e3b2b9fcd09d924b37c76b4",
|
| 116 |
+
"training_admissible": false,
|
| 117 |
+
"upstream_identity_reviewed": true,
|
| 118 |
+
"upstream_repo": "marshmallow-code/apispec",
|
| 119 |
+
"usage": "quarantine_only"
|
| 120 |
+
},
|
| 121 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 122 |
+
"symlink_submodule_changes_supported": false,
|
| 123 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 124 |
+
"transfer": "index-independent-worktree-to-Git-binary-patch",
|
| 125 |
+
"transfer_path": "/testbed/submission.patch",
|
| 126 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 127 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/dependency-setup.sh
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
source /opt/miniconda3/bin/activate
|
| 4 |
+
conda activate testbed
|
| 5 |
+
cd /testbed/repo
|
| 6 |
+
python -c 'import sys; assert sys.version_info[:2] == (3, 10)'
|
| 7 |
+
pip install -e .[dev]
|
| 8 |
+
python -m pip install 'marshmallow>=3.10.0,<4.0.0'
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/environment/Dockerfile
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Runtime is selected only by an independently qualified immutable amd64 receipt.
|
| 2 |
+
FROM ubuntu:22.04
|
| 3 |
+
RUN false
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/instruction.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
APISpec.to_yaml() method fails with TypeError after recent changes
|
| 2 |
+
|
| 3 |
+
#### Description
|
| 4 |
+
|
| 5 |
+
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.
|
| 6 |
+
|
| 7 |
+
#### Steps/Code to Reproduce
|
| 8 |
+
|
| 9 |
+
```python
|
| 10 |
+
from apispec import APISpec
|
| 11 |
+
|
| 12 |
+
spec = APISpec(
|
| 13 |
+
title="Test API",
|
| 14 |
+
version="1.0.0",
|
| 15 |
+
openapi_version="3.0.0"
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
# This should work but throws an error
|
| 19 |
+
yaml_output = spec.to_yaml()
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
#### Error
|
| 23 |
+
|
| 24 |
+
```
|
| 25 |
+
TypeError: dict_to_yaml() missing 1 required positional argument: 'data'
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
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.
|
| 29 |
+
|
| 30 |
+
## Environment
|
| 31 |
+
|
| 32 |
+
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.
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/metadata.json
ADDED
|
@@ -0,0 +1,746 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"all_runtime_and_training_flags": false,
|
| 3 |
+
"official_profile": {
|
| 4 |
+
"eval_sets": [],
|
| 5 |
+
"profile_class": "Apispec8b421526",
|
| 6 |
+
"profile_lines": [
|
| 7 |
+
127,
|
| 8 |
+
131
|
| 9 |
+
],
|
| 10 |
+
"profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f",
|
| 11 |
+
"profile_source_path": "swesmith/profiles/python.py",
|
| 12 |
+
"profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286",
|
| 13 |
+
"upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 14 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 15 |
+
},
|
| 16 |
+
"source_healthy_reference_proof": {
|
| 17 |
+
"FAIL_TO_PASS": [
|
| 18 |
+
"tests/test_core.py::TestComponents::test_to_yaml[2.0]",
|
| 19 |
+
"tests/test_core.py::TestComponents::test_to_yaml[3.0.0]",
|
| 20 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]",
|
| 21 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]",
|
| 22 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]",
|
| 23 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]",
|
| 24 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]",
|
| 25 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]",
|
| 26 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]",
|
| 27 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]",
|
| 28 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[2.0]",
|
| 29 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]",
|
| 30 |
+
"tests/test_core.py::TestComponents::test_response_lazy[2.0]",
|
| 31 |
+
"tests/test_core.py::TestComponents::test_response_lazy[3.0.0]",
|
| 32 |
+
"tests/test_core.py::TestComponents::test_header_lazy[3.0.0]",
|
| 33 |
+
"tests/test_core.py::TestComponents::test_example_lazy[3.0.0]",
|
| 34 |
+
"tests/test_core.py::TestPath::test_path[2.0]",
|
| 35 |
+
"tests/test_core.py::TestPath::test_path[3.0.0]",
|
| 36 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]",
|
| 37 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]",
|
| 38 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[2.0]",
|
| 39 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]",
|
| 40 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]",
|
| 41 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]",
|
| 42 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]",
|
| 43 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]",
|
| 44 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]",
|
| 45 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]",
|
| 46 |
+
"tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]",
|
| 47 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]",
|
| 48 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]",
|
| 49 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]",
|
| 50 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]",
|
| 51 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]",
|
| 52 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]",
|
| 53 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]",
|
| 54 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]",
|
| 55 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]",
|
| 56 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]",
|
| 57 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]",
|
| 58 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]",
|
| 59 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]",
|
| 60 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]",
|
| 61 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]",
|
| 62 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]",
|
| 63 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]",
|
| 64 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]",
|
| 65 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]",
|
| 66 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]",
|
| 67 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 68 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]",
|
| 69 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]",
|
| 70 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2",
|
| 71 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 72 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]",
|
| 73 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]",
|
| 74 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]",
|
| 75 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]",
|
| 76 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]",
|
| 77 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]",
|
| 78 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]",
|
| 79 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]",
|
| 80 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]",
|
| 81 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]",
|
| 82 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]",
|
| 83 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]",
|
| 84 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]",
|
| 85 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 86 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]",
|
| 87 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]",
|
| 88 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]",
|
| 89 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]",
|
| 90 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]",
|
| 91 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]",
|
| 92 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2",
|
| 93 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3"
|
| 94 |
+
],
|
| 95 |
+
"PASS_TO_PASS": [
|
| 96 |
+
"tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version",
|
| 97 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]",
|
| 98 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]",
|
| 99 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]",
|
| 100 |
+
"tests/test_core.py::TestTags::test_tag[2.0]",
|
| 101 |
+
"tests/test_core.py::TestTags::test_tag[3.0.0]",
|
| 102 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[2.0]",
|
| 103 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]",
|
| 104 |
+
"tests/test_core.py::TestComponents::test_schema[2.0]",
|
| 105 |
+
"tests/test_core.py::TestComponents::test_schema[3.0.0]",
|
| 106 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]",
|
| 107 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]",
|
| 108 |
+
"tests/test_core.py::TestComponents::test_schema_description[2.0]",
|
| 109 |
+
"tests/test_core.py::TestComponents::test_schema_description[3.0.0]",
|
| 110 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]",
|
| 111 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]",
|
| 112 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[2.0]",
|
| 113 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]",
|
| 114 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]",
|
| 115 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]",
|
| 116 |
+
"tests/test_core.py::TestComponents::test_response[2.0]",
|
| 117 |
+
"tests/test_core.py::TestComponents::test_response[3.0.0]",
|
| 118 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[2.0]",
|
| 119 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]",
|
| 120 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]",
|
| 121 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]",
|
| 122 |
+
"tests/test_core.py::TestComponents::test_parameter[2.0]",
|
| 123 |
+
"tests/test_core.py::TestComponents::test_parameter[3.0.0]",
|
| 124 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]",
|
| 125 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]",
|
| 126 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]",
|
| 127 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]",
|
| 128 |
+
"tests/test_core.py::TestComponents::test_header[3.0.0]",
|
| 129 |
+
"tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]",
|
| 130 |
+
"tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]",
|
| 131 |
+
"tests/test_core.py::TestComponents::test_example[3.0.0]",
|
| 132 |
+
"tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]",
|
| 133 |
+
"tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]",
|
| 134 |
+
"tests/test_core.py::TestComponents::test_security_scheme[2.0]",
|
| 135 |
+
"tests/test_core.py::TestComponents::test_security_scheme[3.0.0]",
|
| 136 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]",
|
| 137 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]",
|
| 138 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]",
|
| 139 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]",
|
| 140 |
+
"tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec",
|
| 141 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]",
|
| 142 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]",
|
| 143 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]",
|
| 144 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]",
|
| 145 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]",
|
| 146 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]",
|
| 147 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]",
|
| 148 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]",
|
| 149 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]",
|
| 150 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]",
|
| 151 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]",
|
| 152 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]",
|
| 153 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[2.0]",
|
| 154 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]",
|
| 155 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[2.0]",
|
| 156 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]",
|
| 157 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[2.0]",
|
| 158 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]",
|
| 159 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]",
|
| 160 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]",
|
| 161 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[2.0]",
|
| 162 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]",
|
| 163 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]",
|
| 164 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]",
|
| 165 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]",
|
| 166 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]",
|
| 167 |
+
"tests/test_core.py::TestPath::test_path_summary_description[2.0]",
|
| 168 |
+
"tests/test_core.py::TestPath::test_path_summary_description[3.0.0]",
|
| 169 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]",
|
| 170 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]",
|
| 171 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]",
|
| 172 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]",
|
| 173 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]",
|
| 174 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]",
|
| 175 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[2.0]",
|
| 176 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]",
|
| 177 |
+
"tests/test_core.py::TestPath::test_global_parameters[2.0]",
|
| 178 |
+
"tests/test_core.py::TestPath::test_global_parameters[3.0.0]",
|
| 179 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]",
|
| 180 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]",
|
| 181 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]",
|
| 182 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]",
|
| 183 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]",
|
| 184 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]",
|
| 185 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]",
|
| 186 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]",
|
| 187 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]",
|
| 188 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]",
|
| 189 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]",
|
| 190 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]",
|
| 191 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]",
|
| 192 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]",
|
| 193 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]",
|
| 194 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]",
|
| 195 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]",
|
| 196 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]",
|
| 197 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]",
|
| 198 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]",
|
| 199 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]",
|
| 200 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]",
|
| 201 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]",
|
| 202 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]",
|
| 203 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]",
|
| 204 |
+
"tests/test_core.py::TestPluginsOrder::test_plugins_order",
|
| 205 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]",
|
| 206 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]",
|
| 207 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]",
|
| 208 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]",
|
| 209 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]",
|
| 210 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]",
|
| 211 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]",
|
| 212 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]",
|
| 213 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]",
|
| 214 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]",
|
| 215 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]",
|
| 216 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]",
|
| 217 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]",
|
| 218 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]",
|
| 219 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]",
|
| 220 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]",
|
| 221 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]",
|
| 222 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]",
|
| 223 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver",
|
| 224 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]",
|
| 225 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]",
|
| 226 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none",
|
| 227 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]",
|
| 228 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]",
|
| 229 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]",
|
| 230 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]",
|
| 231 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]",
|
| 232 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]",
|
| 233 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]",
|
| 234 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]",
|
| 235 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]",
|
| 236 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]",
|
| 237 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]",
|
| 238 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]",
|
| 239 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]",
|
| 240 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]",
|
| 241 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]",
|
| 242 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]",
|
| 243 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]",
|
| 244 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]",
|
| 245 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]",
|
| 246 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]",
|
| 247 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]",
|
| 248 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]",
|
| 249 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 250 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]",
|
| 251 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]",
|
| 252 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]",
|
| 253 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]",
|
| 254 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 255 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]",
|
| 256 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 257 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 258 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 259 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]",
|
| 260 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]",
|
| 261 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]",
|
| 262 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]",
|
| 263 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]",
|
| 264 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]",
|
| 265 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]",
|
| 266 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]",
|
| 267 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]",
|
| 268 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]",
|
| 269 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]",
|
| 270 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]",
|
| 271 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]",
|
| 272 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]",
|
| 273 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]",
|
| 274 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]",
|
| 275 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]",
|
| 276 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]",
|
| 277 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]",
|
| 278 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]",
|
| 279 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]",
|
| 280 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]",
|
| 281 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]",
|
| 282 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]",
|
| 283 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]",
|
| 284 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]",
|
| 285 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]",
|
| 286 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]",
|
| 287 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]",
|
| 288 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]",
|
| 289 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]",
|
| 290 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed",
|
| 291 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal",
|
| 292 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]",
|
| 293 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]",
|
| 294 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal",
|
| 295 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal",
|
| 296 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]",
|
| 297 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]",
|
| 298 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]",
|
| 299 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]",
|
| 300 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]",
|
| 301 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]",
|
| 302 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields",
|
| 303 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]",
|
| 304 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]",
|
| 305 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]",
|
| 306 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]",
|
| 307 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]",
|
| 308 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]",
|
| 309 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]",
|
| 310 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]",
|
| 311 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]",
|
| 312 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]",
|
| 313 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]",
|
| 314 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]",
|
| 315 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]",
|
| 316 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]",
|
| 317 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]",
|
| 318 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]",
|
| 319 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]",
|
| 320 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]",
|
| 321 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]",
|
| 322 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]",
|
| 323 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]",
|
| 324 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]",
|
| 325 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]",
|
| 326 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]",
|
| 327 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]",
|
| 328 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]",
|
| 329 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]",
|
| 330 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]",
|
| 331 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]",
|
| 332 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]",
|
| 333 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]",
|
| 334 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]",
|
| 335 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]",
|
| 336 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]",
|
| 337 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]",
|
| 338 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]",
|
| 339 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]",
|
| 340 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]",
|
| 341 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]",
|
| 342 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]",
|
| 343 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]",
|
| 344 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]",
|
| 345 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]",
|
| 346 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]",
|
| 347 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]",
|
| 348 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]",
|
| 349 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]",
|
| 350 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]",
|
| 351 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]",
|
| 352 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]",
|
| 353 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]",
|
| 354 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]",
|
| 355 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]",
|
| 356 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]",
|
| 357 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]",
|
| 358 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]",
|
| 359 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]",
|
| 360 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]",
|
| 361 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]",
|
| 362 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]",
|
| 363 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]",
|
| 364 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]",
|
| 365 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]",
|
| 366 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]",
|
| 367 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]",
|
| 368 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]",
|
| 369 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]",
|
| 370 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]",
|
| 371 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]",
|
| 372 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]",
|
| 373 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]",
|
| 374 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]",
|
| 375 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]",
|
| 376 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]",
|
| 377 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]",
|
| 378 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]",
|
| 379 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]",
|
| 380 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]",
|
| 381 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]",
|
| 382 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]",
|
| 383 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]",
|
| 384 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]",
|
| 385 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]",
|
| 386 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]",
|
| 387 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]",
|
| 388 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]",
|
| 389 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]",
|
| 390 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]",
|
| 391 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]",
|
| 392 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]",
|
| 393 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]",
|
| 394 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]",
|
| 395 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]",
|
| 396 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]",
|
| 397 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]",
|
| 398 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]",
|
| 399 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]",
|
| 400 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]",
|
| 401 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]",
|
| 402 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]",
|
| 403 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]",
|
| 404 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]",
|
| 405 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]",
|
| 406 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]",
|
| 407 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]",
|
| 408 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]",
|
| 409 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]",
|
| 410 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]",
|
| 411 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]",
|
| 412 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]",
|
| 413 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]",
|
| 414 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]",
|
| 415 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]",
|
| 416 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]",
|
| 417 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]",
|
| 418 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]",
|
| 419 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]",
|
| 420 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]",
|
| 421 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]",
|
| 422 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]",
|
| 423 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]",
|
| 424 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]",
|
| 425 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]",
|
| 426 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]",
|
| 427 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]",
|
| 428 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]",
|
| 429 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]",
|
| 430 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]",
|
| 431 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]",
|
| 432 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]",
|
| 433 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]",
|
| 434 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]",
|
| 435 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]",
|
| 436 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]",
|
| 437 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]",
|
| 438 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]",
|
| 439 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]",
|
| 440 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]",
|
| 441 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]",
|
| 442 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]",
|
| 443 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]",
|
| 444 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]",
|
| 445 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]",
|
| 446 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]",
|
| 447 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]",
|
| 448 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]",
|
| 449 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]",
|
| 450 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]",
|
| 451 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]",
|
| 452 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]",
|
| 453 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]",
|
| 454 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]",
|
| 455 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]",
|
| 456 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]",
|
| 457 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]",
|
| 458 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]",
|
| 459 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]",
|
| 460 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]",
|
| 461 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]",
|
| 462 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]",
|
| 463 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]",
|
| 464 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]",
|
| 465 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]",
|
| 466 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]",
|
| 467 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[2.0]",
|
| 468 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[3.0.0]",
|
| 469 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[2.0]",
|
| 470 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[3.0.0]",
|
| 471 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[2.0]",
|
| 472 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[3.0.0]",
|
| 473 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[2.0]",
|
| 474 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[3.0.0]",
|
| 475 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[2.0]",
|
| 476 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[3.0.0]",
|
| 477 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]",
|
| 478 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]",
|
| 479 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]",
|
| 480 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]",
|
| 481 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]",
|
| 482 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]",
|
| 483 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]",
|
| 484 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]",
|
| 485 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]",
|
| 486 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]",
|
| 487 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]",
|
| 488 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]",
|
| 489 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]",
|
| 490 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]",
|
| 491 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]",
|
| 492 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]",
|
| 493 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]",
|
| 494 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]",
|
| 495 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]",
|
| 496 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]",
|
| 497 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]",
|
| 498 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]",
|
| 499 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]",
|
| 500 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]",
|
| 501 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]",
|
| 502 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]",
|
| 503 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]",
|
| 504 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]",
|
| 505 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]",
|
| 506 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]",
|
| 507 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]",
|
| 508 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]",
|
| 509 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]",
|
| 510 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]",
|
| 511 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]",
|
| 512 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]",
|
| 513 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]",
|
| 514 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]",
|
| 515 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]",
|
| 516 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]",
|
| 517 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]",
|
| 518 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]",
|
| 519 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]",
|
| 520 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]",
|
| 521 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]",
|
| 522 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]",
|
| 523 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]",
|
| 524 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]",
|
| 525 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]",
|
| 526 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]",
|
| 527 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]",
|
| 528 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]",
|
| 529 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]",
|
| 530 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]",
|
| 531 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]",
|
| 532 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]",
|
| 533 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]",
|
| 534 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]",
|
| 535 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]",
|
| 536 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]",
|
| 537 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]",
|
| 538 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]",
|
| 539 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]",
|
| 540 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]",
|
| 541 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]",
|
| 542 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]",
|
| 543 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]",
|
| 544 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]",
|
| 545 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]",
|
| 546 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]",
|
| 547 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]",
|
| 548 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]",
|
| 549 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]",
|
| 550 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]",
|
| 551 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]",
|
| 552 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]",
|
| 553 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]",
|
| 554 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]",
|
| 555 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]",
|
| 556 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]",
|
| 557 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types",
|
| 558 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]",
|
| 559 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]",
|
| 560 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]",
|
| 561 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]",
|
| 562 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]",
|
| 563 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]",
|
| 564 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]",
|
| 565 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]",
|
| 566 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]",
|
| 567 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]",
|
| 568 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]",
|
| 569 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]",
|
| 570 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]",
|
| 571 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]",
|
| 572 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]",
|
| 573 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]",
|
| 574 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]",
|
| 575 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]",
|
| 576 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]",
|
| 577 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]",
|
| 578 |
+
"tests/test_utils.py::test_build_reference",
|
| 579 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring",
|
| 580 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]",
|
| 581 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]",
|
| 582 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]",
|
| 583 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]",
|
| 584 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]",
|
| 585 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]",
|
| 586 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_unicode",
|
| 587 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default",
|
| 588 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs"
|
| 589 |
+
],
|
| 590 |
+
"all_git_blobs_modes_verified": true,
|
| 591 |
+
"cloud_launch_ready": false,
|
| 592 |
+
"commits": {
|
| 593 |
+
"bug": "24e2ab1be595b648135a3e70b7b5bc2784273669",
|
| 594 |
+
"healthy": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 595 |
+
"learner": "04112d2ca1b131c061608fbb5c54b8e6189c39da"
|
| 596 |
+
},
|
| 597 |
+
"existing_squirrel_snapshot_reused": false,
|
| 598 |
+
"full_transfer_allowlist": [
|
| 599 |
+
"/testbed/.github/FUNDING.yml",
|
| 600 |
+
"/testbed/.github/dependabot.yml",
|
| 601 |
+
"/testbed/.gitignore",
|
| 602 |
+
"/testbed/.pre-commit-config.yaml",
|
| 603 |
+
"/testbed/AUTHORS.rst",
|
| 604 |
+
"/testbed/CHANGELOG.rst",
|
| 605 |
+
"/testbed/CONTRIBUTING.rst",
|
| 606 |
+
"/testbed/LICENSE",
|
| 607 |
+
"/testbed/README.rst",
|
| 608 |
+
"/testbed/RELEASING.md",
|
| 609 |
+
"/testbed/SECURITY.md",
|
| 610 |
+
"/testbed/docs/Makefile",
|
| 611 |
+
"/testbed/docs/api_core.rst",
|
| 612 |
+
"/testbed/docs/api_ext.rst",
|
| 613 |
+
"/testbed/docs/authors.rst",
|
| 614 |
+
"/testbed/docs/changelog.rst",
|
| 615 |
+
"/testbed/docs/conf.py",
|
| 616 |
+
"/testbed/docs/contributing.rst",
|
| 617 |
+
"/testbed/docs/ecosystem.rst",
|
| 618 |
+
"/testbed/docs/index.rst",
|
| 619 |
+
"/testbed/docs/install.rst",
|
| 620 |
+
"/testbed/docs/license.rst",
|
| 621 |
+
"/testbed/docs/make.bat",
|
| 622 |
+
"/testbed/docs/quickstart.rst",
|
| 623 |
+
"/testbed/docs/special_topics.rst",
|
| 624 |
+
"/testbed/docs/upgrading.rst",
|
| 625 |
+
"/testbed/docs/using_plugins.rst",
|
| 626 |
+
"/testbed/docs/writing_plugins.rst",
|
| 627 |
+
"/testbed/pyproject.toml",
|
| 628 |
+
"/testbed/readthedocs.yml",
|
| 629 |
+
"/testbed/src/apispec/__init__.py",
|
| 630 |
+
"/testbed/src/apispec/core.py",
|
| 631 |
+
"/testbed/src/apispec/exceptions.py",
|
| 632 |
+
"/testbed/src/apispec/ext/__init__.py",
|
| 633 |
+
"/testbed/src/apispec/ext/marshmallow/__init__.py",
|
| 634 |
+
"/testbed/src/apispec/ext/marshmallow/common.py",
|
| 635 |
+
"/testbed/src/apispec/ext/marshmallow/field_converter.py",
|
| 636 |
+
"/testbed/src/apispec/ext/marshmallow/openapi.py",
|
| 637 |
+
"/testbed/src/apispec/ext/marshmallow/schema_resolver.py",
|
| 638 |
+
"/testbed/src/apispec/plugin.py",
|
| 639 |
+
"/testbed/src/apispec/py.typed",
|
| 640 |
+
"/testbed/src/apispec/utils.py",
|
| 641 |
+
"/testbed/src/apispec/yaml_utils.py",
|
| 642 |
+
"/testbed/tests/__init__.py",
|
| 643 |
+
"/testbed/tests/conftest.py",
|
| 644 |
+
"/testbed/tests/schemas.py",
|
| 645 |
+
"/testbed/tests/test_ext_marshmallow_common.py",
|
| 646 |
+
"/testbed/tests/test_ext_marshmallow_field.py",
|
| 647 |
+
"/testbed/tests/test_utils.py",
|
| 648 |
+
"/testbed/tests/test_yaml_utils.py",
|
| 649 |
+
"/testbed/tests/utils.py",
|
| 650 |
+
"/testbed/tox.ini"
|
| 651 |
+
],
|
| 652 |
+
"healthy_stage_meaning": "Direct parent of the mutation; no source or test execution has been performed",
|
| 653 |
+
"mutation_matches_dataset_and_git_blobs": true,
|
| 654 |
+
"official_profile": {
|
| 655 |
+
"eval_sets": [],
|
| 656 |
+
"profile_class": "Apispec8b421526",
|
| 657 |
+
"profile_lines": [
|
| 658 |
+
127,
|
| 659 |
+
131
|
| 660 |
+
],
|
| 661 |
+
"profile_source_commit": "9b74ac08118a85c39c356802f7961893af73e07f",
|
| 662 |
+
"profile_source_path": "swesmith/profiles/python.py",
|
| 663 |
+
"profile_source_sha256": "eadf29551ca2e706950d3f2311b47a3d08c2ccee3c8dd217fa299014a08e4286",
|
| 664 |
+
"upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 665 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 666 |
+
},
|
| 667 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 668 |
+
"private_test_paths": [
|
| 669 |
+
"tests/test_core.py",
|
| 670 |
+
"tests/test_ext_marshmallow.py",
|
| 671 |
+
"tests/test_ext_marshmallow_openapi.py"
|
| 672 |
+
],
|
| 673 |
+
"private_tests_unchanged": true,
|
| 674 |
+
"profile_mapping_basis": "Explicit upstream repo and full commit fields parsed from pinned official Python profile AST, not basename inference",
|
| 675 |
+
"qwen_calibrated": false,
|
| 676 |
+
"runtime_qualified": false,
|
| 677 |
+
"source_paths": [
|
| 678 |
+
"src/apispec/core.py"
|
| 679 |
+
],
|
| 680 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 681 |
+
"source_stages_bytes": 993593,
|
| 682 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 683 |
+
"transfer_limitation": "Existing regular files only; new arbitrary file additions need a qualified patch adapter",
|
| 684 |
+
"upstream_repo": "marshmallow-code/apispec"
|
| 685 |
+
},
|
| 686 |
+
"source_record": {
|
| 687 |
+
"anti_training_canary": false,
|
| 688 |
+
"anti_training_reviewed": true,
|
| 689 |
+
"candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 690 |
+
"cloud_launch_ready": false,
|
| 691 |
+
"eligibility": {
|
| 692 |
+
"reasons": [],
|
| 693 |
+
"semantic_nonoverlap_established": false,
|
| 694 |
+
"status": "eligible_for_controls",
|
| 695 |
+
"training_admissible": false,
|
| 696 |
+
"warnings": []
|
| 697 |
+
},
|
| 698 |
+
"healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 699 |
+
"instruction_sha256": "58e450f9279684eedad9ec4d60c7843ea4f327a7b998dec18d6f185a07ef320a",
|
| 700 |
+
"is_fork": true,
|
| 701 |
+
"learner_path": "tasks/b491c0d8099392581ef57f79/learner",
|
| 702 |
+
"license_evidence": {
|
| 703 |
+
"source_code": {
|
| 704 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 705 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 706 |
+
"reviewed": true,
|
| 707 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 708 |
+
"spdx": "MIT",
|
| 709 |
+
"training_allowed": true,
|
| 710 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE"
|
| 711 |
+
},
|
| 712 |
+
"task_bundle": {
|
| 713 |
+
"reviewed": true,
|
| 714 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 715 |
+
"spdx": "MIT",
|
| 716 |
+
"training_allowed": true,
|
| 717 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 718 |
+
}
|
| 719 |
+
},
|
| 720 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 721 |
+
"patch_sha256": "9f63a2eaa5b2a77d4e0a4bd4406001c92d391be96abbf626ca370ad0f9e616ed",
|
| 722 |
+
"provenance_path": "tasks/b491c0d8099392581ef57f79/source-proof.json",
|
| 723 |
+
"repository_lineage": [
|
| 724 |
+
"swesmith/marshmallow-code__apispec.8b421526",
|
| 725 |
+
"marshmallow-code/apispec"
|
| 726 |
+
],
|
| 727 |
+
"rfc008_complete": false,
|
| 728 |
+
"runtime_qualified": false,
|
| 729 |
+
"semantic_nonoverlap_established": false,
|
| 730 |
+
"source_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da",
|
| 731 |
+
"source_dataset": "SWE-bench/SWE-smith-py",
|
| 732 |
+
"source_head_commit": "24e2ab1be595b648135a3e70b7b5bc2784273669",
|
| 733 |
+
"source_kind": "mutation",
|
| 734 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 735 |
+
"source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e",
|
| 736 |
+
"source_split": "train",
|
| 737 |
+
"target_model_calibrated": false,
|
| 738 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 739 |
+
"task_sha256": "8c5ba9cccfd4e92bfe3ba985908417f3b97bd5e79e3b2b9fcd09d924b37c76b4",
|
| 740 |
+
"training_admissible": false,
|
| 741 |
+
"upstream_identity_reviewed": true,
|
| 742 |
+
"upstream_repo": "marshmallow-code/apispec",
|
| 743 |
+
"usage": "quarantine_only"
|
| 744 |
+
},
|
| 745 |
+
"task_kind": "original-source-mutation"
|
| 746 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provenance.json
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"generated_reference": false,
|
| 3 |
+
"healthy_reference_delta_sha256": "ec036495f24bdfc187e0075606bb1302ea32f79002282ab5f371e9977f625deb",
|
| 4 |
+
"native_pytest_ids_preserved": true,
|
| 5 |
+
"original_source_code_license": {
|
| 6 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 7 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 8 |
+
"reviewed": true,
|
| 9 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 10 |
+
"spdx": "MIT",
|
| 11 |
+
"training_allowed": true,
|
| 12 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE"
|
| 13 |
+
},
|
| 14 |
+
"provided_reference": true,
|
| 15 |
+
"qwen_calibrated": false,
|
| 16 |
+
"runtime_qualified": false,
|
| 17 |
+
"source_completion_sha256": "2ef340184cc1d9dfcd2cbc9bb05622525f817bc4a8e7dc4790232a42c6108cc0",
|
| 18 |
+
"source_index_sha256": "a8bacb23b190ac8227d8d322773176a10ed65e6b16cccd869cb625a465522876",
|
| 19 |
+
"source_proof_sha256": "2c968127a5889bc8a89a49adaacdeca97e704272c704ba9868f328aac0ea4bf5",
|
| 20 |
+
"source_record": {
|
| 21 |
+
"anti_training_canary": false,
|
| 22 |
+
"anti_training_reviewed": true,
|
| 23 |
+
"candidate_id": "swesmith-py:marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 24 |
+
"cloud_launch_ready": false,
|
| 25 |
+
"eligibility": {
|
| 26 |
+
"reasons": [],
|
| 27 |
+
"semantic_nonoverlap_established": false,
|
| 28 |
+
"status": "eligible_for_controls",
|
| 29 |
+
"training_admissible": false,
|
| 30 |
+
"warnings": []
|
| 31 |
+
},
|
| 32 |
+
"healthy_mirror_commit": "d8b6184dbd502b9824e83fe8b294552f31ee754e",
|
| 33 |
+
"instruction_sha256": "58e450f9279684eedad9ec4d60c7843ea4f327a7b998dec18d6f185a07ef320a",
|
| 34 |
+
"is_fork": true,
|
| 35 |
+
"learner_path": "tasks/b491c0d8099392581ef57f79/learner",
|
| 36 |
+
"license_evidence": {
|
| 37 |
+
"source_code": {
|
| 38 |
+
"actual_upstream_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 39 |
+
"actual_upstream_url": "https://raw.githubusercontent.com/marshmallow-code/apispec/8b421526ea1015046de42599dd93da6a3473fe44/LICENSE",
|
| 40 |
+
"reviewed": true,
|
| 41 |
+
"sha256": "f345555ff39d6b573342781a6346a5202a8f14bce424fee41f910c6c5379cc7d",
|
| 42 |
+
"spdx": "MIT",
|
| 43 |
+
"training_allowed": true,
|
| 44 |
+
"url": "https://raw.githubusercontent.com/swesmith/marshmallow-code__apispec.8b421526/04112d2ca1b131c061608fbb5c54b8e6189c39da/LICENSE"
|
| 45 |
+
},
|
| 46 |
+
"task_bundle": {
|
| 47 |
+
"reviewed": true,
|
| 48 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 49 |
+
"spdx": "MIT",
|
| 50 |
+
"training_allowed": true,
|
| 51 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 52 |
+
}
|
| 53 |
+
},
|
| 54 |
+
"original_source_commit": "8b421526ea1015046de42599dd93da6a3473fe44",
|
| 55 |
+
"patch_sha256": "9f63a2eaa5b2a77d4e0a4bd4406001c92d391be96abbf626ca370ad0f9e616ed",
|
| 56 |
+
"provenance_path": "tasks/b491c0d8099392581ef57f79/source-proof.json",
|
| 57 |
+
"repository_lineage": [
|
| 58 |
+
"swesmith/marshmallow-code__apispec.8b421526",
|
| 59 |
+
"marshmallow-code/apispec"
|
| 60 |
+
],
|
| 61 |
+
"rfc008_complete": false,
|
| 62 |
+
"runtime_qualified": false,
|
| 63 |
+
"semantic_nonoverlap_established": false,
|
| 64 |
+
"source_commit": "04112d2ca1b131c061608fbb5c54b8e6189c39da",
|
| 65 |
+
"source_dataset": "SWE-bench/SWE-smith-py",
|
| 66 |
+
"source_head_commit": "24e2ab1be595b648135a3e70b7b5bc2784273669",
|
| 67 |
+
"source_kind": "mutation",
|
| 68 |
+
"source_repo": "swesmith/marshmallow-code__apispec.8b421526",
|
| 69 |
+
"source_revision": "77cab9055d42ab4a5c25c89a8f937096db13558e",
|
| 70 |
+
"source_split": "train",
|
| 71 |
+
"target_model_calibrated": false,
|
| 72 |
+
"task_id": "marshmallow-code__apispec.8b421526.combine_file__t5dh0iap",
|
| 73 |
+
"task_sha256": "8c5ba9cccfd4e92bfe3ba985908417f3b97bd5e79e3b2b9fcd09d924b37c76b4",
|
| 74 |
+
"training_admissible": false,
|
| 75 |
+
"upstream_identity_reviewed": true,
|
| 76 |
+
"upstream_repo": "marshmallow-code/apispec",
|
| 77 |
+
"usage": "quarantine_only"
|
| 78 |
+
},
|
| 79 |
+
"task_bundle_license": {
|
| 80 |
+
"reviewed": true,
|
| 81 |
+
"sha256": "18afda407941c9d3c65ff530bedd3bc93f3a13d9504ee5728e959fb43ffce808",
|
| 82 |
+
"spdx": "MIT",
|
| 83 |
+
"training_allowed": true,
|
| 84 |
+
"url": "https://huggingface.co/datasets/SWE-bench/SWE-smith-py/raw/77cab9055d42ab4a5c25c89a8f937096db13558e/README.md"
|
| 85 |
+
},
|
| 86 |
+
"training_admissible": false,
|
| 87 |
+
"trusted_tests_sha256": "800ba7da08ca9ff402906f2c3f0f85c4f500c385020e3e6b6d0a029e65c0654e"
|
| 88 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/provided-gold.diff
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
diff --git a/src/apispec/core.py b/src/apispec/core.py
|
| 2 |
+
index c7bdf463986b005f8254bc85691b59c972a45f6c..e9ccb40635faff1ceb3d7234d7458cb6db4ae67d 100644
|
| 3 |
+
--- a/src/apispec/core.py
|
| 4 |
+
+++ b/src/apispec/core.py
|
| 5 |
+
@@ -331,9 +331,15 @@
|
| 6 |
+
if "items" in schema:
|
| 7 |
+
schema["items"] = self.get_ref("schema", schema["items"])
|
| 8 |
+
self._resolve_refs_in_schema(schema["items"])
|
| 9 |
+
+ for key in ("allOf", "oneOf", "anyOf"):
|
| 10 |
+
+ if key in schema:
|
| 11 |
+
+ schema[key] = [self.get_ref("schema", s) for s in schema[key]]
|
| 12 |
+
+ for sch in schema[key]:
|
| 13 |
+
+ self._resolve_refs_in_schema(sch)
|
| 14 |
+
if "not" in schema:
|
| 15 |
+
schema["not"] = self.get_ref("schema", schema["not"])
|
| 16 |
+
self._resolve_refs_in_schema(schema["not"])
|
| 17 |
+
+
|
| 18 |
+
def _resolve_refs_in_parameter_or_header(self, parameter_or_header) -> None:
|
| 19 |
+
self._resolve_schema(parameter_or_header)
|
| 20 |
+
self._resolve_examples(parameter_or_header)
|
| 21 |
+
@@ -370,12 +376,18 @@
|
| 22 |
+
if "callbacks" in operation:
|
| 23 |
+
for callback in operation["callbacks"].values():
|
| 24 |
+
if isinstance(callback, dict):
|
| 25 |
+
- pass
|
| 26 |
+
+ for path in callback.values():
|
| 27 |
+
+ self.resolve_refs_in_path(path)
|
| 28 |
+
if "requestBody" in operation:
|
| 29 |
+
self._resolve_refs_in_request_body(operation["requestBody"])
|
| 30 |
+
if "responses" in operation:
|
| 31 |
+
responses = {}
|
| 32 |
+
+ for code, response in operation["responses"].items():
|
| 33 |
+
+ response = self.get_ref("response", response)
|
| 34 |
+
+ self._resolve_refs_in_response(response)
|
| 35 |
+
+ responses[code] = response
|
| 36 |
+
operation["responses"] = responses
|
| 37 |
+
+
|
| 38 |
+
def resolve_refs_in_path(self, path) -> None:
|
| 39 |
+
if "parameters" in path:
|
| 40 |
+
parameters = []
|
| 41 |
+
@@ -467,8 +479,7 @@
|
| 42 |
+
"""
|
| 43 |
+
from .yaml_utils import dict_to_yaml
|
| 44 |
+
|
| 45 |
+
- # Swapping the argument order and providing both as positional arguments instead of using a keyword argument.
|
| 46 |
+
- return dict_to_yaml(yaml_dump_kwargs, self.to_dict())
|
| 47 |
+
+ return dict_to_yaml(self.to_dict(), yaml_dump_kwargs)
|
| 48 |
+
|
| 49 |
+
def tag(self, tag: dict) -> APISpec:
|
| 50 |
+
"""Store information about a tag.
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/solution/solve.sh
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
cd /testbed/repo
|
| 4 |
+
cat > /tmp/openenv-reference.diff <<'OPENENV_REFERENCE'
|
| 5 |
+
diff --git a/src/apispec/core.py b/src/apispec/core.py
|
| 6 |
+
index c7bdf463986b005f8254bc85691b59c972a45f6c..e9ccb40635faff1ceb3d7234d7458cb6db4ae67d 100644
|
| 7 |
+
--- a/src/apispec/core.py
|
| 8 |
+
+++ b/src/apispec/core.py
|
| 9 |
+
@@ -331,9 +331,15 @@
|
| 10 |
+
if "items" in schema:
|
| 11 |
+
schema["items"] = self.get_ref("schema", schema["items"])
|
| 12 |
+
self._resolve_refs_in_schema(schema["items"])
|
| 13 |
+
+ for key in ("allOf", "oneOf", "anyOf"):
|
| 14 |
+
+ if key in schema:
|
| 15 |
+
+ schema[key] = [self.get_ref("schema", s) for s in schema[key]]
|
| 16 |
+
+ for sch in schema[key]:
|
| 17 |
+
+ self._resolve_refs_in_schema(sch)
|
| 18 |
+
if "not" in schema:
|
| 19 |
+
schema["not"] = self.get_ref("schema", schema["not"])
|
| 20 |
+
self._resolve_refs_in_schema(schema["not"])
|
| 21 |
+
+
|
| 22 |
+
def _resolve_refs_in_parameter_or_header(self, parameter_or_header) -> None:
|
| 23 |
+
self._resolve_schema(parameter_or_header)
|
| 24 |
+
self._resolve_examples(parameter_or_header)
|
| 25 |
+
@@ -370,12 +376,18 @@
|
| 26 |
+
if "callbacks" in operation:
|
| 27 |
+
for callback in operation["callbacks"].values():
|
| 28 |
+
if isinstance(callback, dict):
|
| 29 |
+
- pass
|
| 30 |
+
+ for path in callback.values():
|
| 31 |
+
+ self.resolve_refs_in_path(path)
|
| 32 |
+
if "requestBody" in operation:
|
| 33 |
+
self._resolve_refs_in_request_body(operation["requestBody"])
|
| 34 |
+
if "responses" in operation:
|
| 35 |
+
responses = {}
|
| 36 |
+
+ for code, response in operation["responses"].items():
|
| 37 |
+
+ response = self.get_ref("response", response)
|
| 38 |
+
+ self._resolve_refs_in_response(response)
|
| 39 |
+
+ responses[code] = response
|
| 40 |
+
operation["responses"] = responses
|
| 41 |
+
+
|
| 42 |
+
def resolve_refs_in_path(self, path) -> None:
|
| 43 |
+
if "parameters" in path:
|
| 44 |
+
parameters = []
|
| 45 |
+
@@ -467,8 +479,7 @@
|
| 46 |
+
"""
|
| 47 |
+
from .yaml_utils import dict_to_yaml
|
| 48 |
+
|
| 49 |
+
- # Swapping the argument order and providing both as positional arguments instead of using a keyword argument.
|
| 50 |
+
- return dict_to_yaml(yaml_dump_kwargs, self.to_dict())
|
| 51 |
+
+ return dict_to_yaml(self.to_dict(), yaml_dump_kwargs)
|
| 52 |
+
|
| 53 |
+
def tag(self, tag: dict) -> APISpec:
|
| 54 |
+
"""Store information about a tag.
|
| 55 |
+
OPENENV_REFERENCE
|
| 56 |
+
/usr/bin/git -c core.hooksPath=/dev/null -c core.fsmonitor=false apply --whitespace=nowarn /tmp/openenv-reference.diff
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/task.toml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version = "1.0"
|
| 2 |
+
|
| 3 |
+
[agent]
|
| 4 |
+
timeout_sec = 1800.0
|
| 5 |
+
|
| 6 |
+
[verifier]
|
| 7 |
+
timeout_sec = 900.0
|
| 8 |
+
|
| 9 |
+
[environment]
|
| 10 |
+
docker_image = "ghcr.io/younesbelkada/scale800@sha256:764c60a55750844cbf153977b51a42456df522f4355353cafb526be09d5ae9f0"
|
| 11 |
+
build_timeout_sec = 600.0
|
| 12 |
+
cpus = 2
|
| 13 |
+
memory_mb = 8192
|
| 14 |
+
storage_mb = 16384
|
| 15 |
+
|
| 16 |
+
[metadata]
|
| 17 |
+
author_name = "SWE-smith source adapter"
|
| 18 |
+
category = "bugfix"
|
| 19 |
+
tags = ["swe", "python", "mutation-repair"]
|
| 20 |
+
|
| 21 |
+
[environment.env]
|
| 22 |
+
# The image's PATH with the testbed env first: the project and pytest are installed there, and the agent's
|
| 23 |
+
# non-interactive shells never run `conda activate`
|
| 24 |
+
PATH = "/opt/miniconda3/envs/testbed/bin:/opt/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/check_pytest.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Distinguish real pytest failures from missing/setup/verifier evidence."""
|
| 2 |
+
|
| 3 |
+
import argparse
|
| 4 |
+
import json
|
| 5 |
+
import re
|
| 6 |
+
import xml.etree.ElementTree as ET
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def matches(case, target):
|
| 11 |
+
parts = target.split("::")
|
| 12 |
+
module = parts[0].removesuffix(".py").replace("/", ".")
|
| 13 |
+
classname = case.get("classname", "")
|
| 14 |
+
name = case.get("name", "")
|
| 15 |
+
if not (classname == module or classname.startswith(module + ".")):
|
| 16 |
+
return False
|
| 17 |
+
selector = parts[-1] if len(parts) > 1 else ""
|
| 18 |
+
classes = parts[1:-1]
|
| 19 |
+
if classes and classname != module + "." + ".".join(classes):
|
| 20 |
+
return False
|
| 21 |
+
return (
|
| 22 |
+
not selector
|
| 23 |
+
or name == selector
|
| 24 |
+
or ("[" not in selector and name.startswith(selector + "["))
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def assess(root, expected, native_exit):
|
| 29 |
+
all_cases = []
|
| 30 |
+
actual_failure = False
|
| 31 |
+
for group in ("pass-to-pass", "fail-to-pass"):
|
| 32 |
+
path = Path(root) / (group + ".xml")
|
| 33 |
+
if not path.exists():
|
| 34 |
+
if actual_failure:
|
| 35 |
+
continue
|
| 36 |
+
raise ValueError("Missing preceding pytest panel")
|
| 37 |
+
if actual_failure:
|
| 38 |
+
raise ValueError(
|
| 39 |
+
"Pytest evidence continued after the native stop-on-failure"
|
| 40 |
+
)
|
| 41 |
+
raw = path.read_bytes()
|
| 42 |
+
if not 0 < len(raw) <= 4 * 1024**2 or re.search(
|
| 43 |
+
rb"<!\s*(?:DOCTYPE|ENTITY)", raw, re.I
|
| 44 |
+
):
|
| 45 |
+
raise ValueError("Unbounded or unsafe pytest XML")
|
| 46 |
+
tree = ET.fromstring(raw)
|
| 47 |
+
cases = list(tree.iter("testcase"))
|
| 48 |
+
if len(cases) > 20000:
|
| 49 |
+
raise ValueError("Too many pytest cases")
|
| 50 |
+
identities = [(c.get("classname"), c.get("name")) for c in cases]
|
| 51 |
+
if len(identities) != len(set(identities)):
|
| 52 |
+
raise ValueError("Duplicate pytest case evidence")
|
| 53 |
+
targets = expected[group]
|
| 54 |
+
if any(not any(matches(case, t) for t in targets) for case in cases):
|
| 55 |
+
raise ValueError("Unexpected pytest case")
|
| 56 |
+
all_cases.extend(cases)
|
| 57 |
+
failures = [c for c in cases if c.find("failure") is not None]
|
| 58 |
+
if any(
|
| 59 |
+
c.find("error") is not None or c.find("skipped") is not None for c in cases
|
| 60 |
+
):
|
| 61 |
+
raise ValueError("Pytest collection/error/skip is not a completed panel")
|
| 62 |
+
actual_failure = actual_failure or bool(failures)
|
| 63 |
+
if not failures and any(
|
| 64 |
+
not any(matches(case, t) for case in cases) for t in targets
|
| 65 |
+
):
|
| 66 |
+
raise ValueError("Declared pytest target never ran")
|
| 67 |
+
if actual_failure:
|
| 68 |
+
if native_exit == 0:
|
| 69 |
+
raise ValueError("Native verifier exit disagrees with pytest failure")
|
| 70 |
+
return {"reward": 0, "valid_test_failure": True, "cases": len(all_cases)}
|
| 71 |
+
if native_exit != 0:
|
| 72 |
+
raise ValueError("Setup or native verifier failed without a real test failure")
|
| 73 |
+
for group in ("pass-to-pass", "fail-to-pass"):
|
| 74 |
+
if not (Path(root) / (group + ".xml")).is_file():
|
| 75 |
+
raise ValueError("Missing completed pytest panel")
|
| 76 |
+
return {"reward": 1, "valid_test_failure": False, "cases": len(all_cases)}
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
if __name__ == "__main__":
|
| 80 |
+
p = argparse.ArgumentParser()
|
| 81 |
+
p.add_argument("--root", required=True)
|
| 82 |
+
p.add_argument("--expected", required=True)
|
| 83 |
+
p.add_argument("--native-exit", type=int, required=True)
|
| 84 |
+
a = p.parse_args()
|
| 85 |
+
result = assess(a.root, json.loads(Path(a.expected).read_text()), a.native_exit)
|
| 86 |
+
reward = Path(a.root) / "reward.txt"
|
| 87 |
+
if reward.read_text().strip() != str(result["reward"]):
|
| 88 |
+
raise ValueError("Native raw reward disagrees with pytest evidence")
|
| 89 |
+
(Path(a.root) / "pytest-evidence.json").write_text(
|
| 90 |
+
json.dumps(result, sort_keys=True) + "\n"
|
| 91 |
+
)
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/expected-panels.json
ADDED
|
@@ -0,0 +1,575 @@
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fail-to-pass": [
|
| 3 |
+
"tests/test_core.py::TestComponents::test_to_yaml[2.0]",
|
| 4 |
+
"tests/test_core.py::TestComponents::test_to_yaml[3.0.0]",
|
| 5 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[2.0]",
|
| 6 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_schema[3.0.0]",
|
| 7 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[2.0]",
|
| 8 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_schema[3.0.0]",
|
| 9 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_response_header_schema[3.0.0]",
|
| 10 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[2.0]",
|
| 11 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_parameter_schema[3.0.0]",
|
| 12 |
+
"tests/test_core.py::TestComponents::test_components_resolve_refs_in_header_schema[3.0.0]",
|
| 13 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[2.0]",
|
| 14 |
+
"tests/test_core.py::TestComponents::test_schema_lazy[3.0.0]",
|
| 15 |
+
"tests/test_core.py::TestComponents::test_response_lazy[2.0]",
|
| 16 |
+
"tests/test_core.py::TestComponents::test_response_lazy[3.0.0]",
|
| 17 |
+
"tests/test_core.py::TestComponents::test_header_lazy[3.0.0]",
|
| 18 |
+
"tests/test_core.py::TestComponents::test_example_lazy[3.0.0]",
|
| 19 |
+
"tests/test_core.py::TestPath::test_path[2.0]",
|
| 20 |
+
"tests/test_core.py::TestPath::test_path[3.0.0]",
|
| 21 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[2.0]",
|
| 22 |
+
"tests/test_core.py::TestPath::test_path_called_twice_with_same_operations_parameters[3.0.0]",
|
| 23 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[2.0]",
|
| 24 |
+
"tests/test_core.py::TestPath::test_path_resolves_response[3.0.0]",
|
| 25 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[2.0]",
|
| 26 |
+
"tests/test_core.py::TestPath::test_path_response_with_HTTPStatus_code[3.0.0]",
|
| 27 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[2.0]",
|
| 28 |
+
"tests/test_core.py::TestPath::test_path_response_with_status_code_range[3.0.0]",
|
| 29 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[2.0]",
|
| 30 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_schema[3.0.0]",
|
| 31 |
+
"tests/test_core.py::TestPath::test_path_resolve_callbacks[3.0.0]",
|
| 32 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header[3.0.0]",
|
| 33 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_schema[3.0.0]",
|
| 34 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_header_examples[3.0.0]",
|
| 35 |
+
"tests/test_core.py::TestPath::test_path_resolve_response_examples[3.0.0]",
|
| 36 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[2.0]",
|
| 37 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_response_schema[3.0.0]",
|
| 38 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[2.0]",
|
| 39 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_parameter_schema[3.0.0]",
|
| 40 |
+
"tests/test_core.py::TestPath::test_path_resolve_refs_in_request_body_schema[3.0.0]",
|
| 41 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-2.0]",
|
| 42 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[False-3.0.0]",
|
| 43 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[2.0]",
|
| 44 |
+
"tests/test_core.py::TestPlugins::test_plugin_operation_helper_is_used[3.0.0]",
|
| 45 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-PetSchema]",
|
| 46 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema1]",
|
| 47 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-pet_schema2]",
|
| 48 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v2[2.0-tests.schemas.PetSchema]",
|
| 49 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-PetSchema]",
|
| 50 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema1]",
|
| 51 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-pet_schema2]",
|
| 52 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 53 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v2[2.0]",
|
| 54 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_v3[3.0.0]",
|
| 55 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v2",
|
| 56 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 57 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_allof_v2[2.0]",
|
| 58 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[oneOf-3.0.0]",
|
| 59 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[anyOf-3.0.0]",
|
| 60 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_oneof_anyof_allof_v3[allOf-3.0.0]",
|
| 61 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v2[2.0]",
|
| 62 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_resolver_not_v3[3.0.0]",
|
| 63 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[PetSchema]",
|
| 64 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[pet_schema1]",
|
| 65 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v2[tests.schemas.PetSchema]",
|
| 66 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[PetSchema]",
|
| 67 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[pet_schema1]",
|
| 68 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_name_resolver_returns_none_v3[tests.schemas.PetSchema]",
|
| 69 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v2[2.0]",
|
| 70 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 71 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v2[2.0]",
|
| 72 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_partially_v3[3.0.0]",
|
| 73 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[2.0]",
|
| 74 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_response_reference[3.0.0]",
|
| 75 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[2.0]",
|
| 76 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_resolve_schema_dict_ref_as_string[3.0.0]",
|
| 77 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v2",
|
| 78 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_tools_validate_v3"
|
| 79 |
+
],
|
| 80 |
+
"pass-to-pass": [
|
| 81 |
+
"tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version",
|
| 82 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]",
|
| 83 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]",
|
| 84 |
+
"tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]",
|
| 85 |
+
"tests/test_core.py::TestTags::test_tag[2.0]",
|
| 86 |
+
"tests/test_core.py::TestTags::test_tag[3.0.0]",
|
| 87 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[2.0]",
|
| 88 |
+
"tests/test_core.py::TestTags::test_tag_is_chainable[3.0.0]",
|
| 89 |
+
"tests/test_core.py::TestComponents::test_schema[2.0]",
|
| 90 |
+
"tests/test_core.py::TestComponents::test_schema[3.0.0]",
|
| 91 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[2.0]",
|
| 92 |
+
"tests/test_core.py::TestComponents::test_schema_is_chainable[3.0.0]",
|
| 93 |
+
"tests/test_core.py::TestComponents::test_schema_description[2.0]",
|
| 94 |
+
"tests/test_core.py::TestComponents::test_schema_description[3.0.0]",
|
| 95 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[2.0]",
|
| 96 |
+
"tests/test_core.py::TestComponents::test_schema_stores_enum[3.0.0]",
|
| 97 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[2.0]",
|
| 98 |
+
"tests/test_core.py::TestComponents::test_schema_discriminator[3.0.0]",
|
| 99 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[2.0]",
|
| 100 |
+
"tests/test_core.py::TestComponents::test_schema_duplicate_name[3.0.0]",
|
| 101 |
+
"tests/test_core.py::TestComponents::test_response[2.0]",
|
| 102 |
+
"tests/test_core.py::TestComponents::test_response[3.0.0]",
|
| 103 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[2.0]",
|
| 104 |
+
"tests/test_core.py::TestComponents::test_response_is_chainable[3.0.0]",
|
| 105 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[2.0]",
|
| 106 |
+
"tests/test_core.py::TestComponents::test_response_duplicate_name[3.0.0]",
|
| 107 |
+
"tests/test_core.py::TestComponents::test_parameter[2.0]",
|
| 108 |
+
"tests/test_core.py::TestComponents::test_parameter[3.0.0]",
|
| 109 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]",
|
| 110 |
+
"tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]",
|
| 111 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[2.0]",
|
| 112 |
+
"tests/test_core.py::TestComponents::test_parameter_duplicate_name[3.0.0]",
|
| 113 |
+
"tests/test_core.py::TestComponents::test_header[3.0.0]",
|
| 114 |
+
"tests/test_core.py::TestComponents::test_header_is_chainable[3.0.0]",
|
| 115 |
+
"tests/test_core.py::TestComponents::test_header_duplicate_name[3.0.0]",
|
| 116 |
+
"tests/test_core.py::TestComponents::test_example[3.0.0]",
|
| 117 |
+
"tests/test_core.py::TestComponents::test_example_is_chainable[3.0.0]",
|
| 118 |
+
"tests/test_core.py::TestComponents::test_example_duplicate_name[3.0.0]",
|
| 119 |
+
"tests/test_core.py::TestComponents::test_security_scheme[2.0]",
|
| 120 |
+
"tests/test_core.py::TestComponents::test_security_scheme[3.0.0]",
|
| 121 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[2.0]",
|
| 122 |
+
"tests/test_core.py::TestComponents::test_security_scheme_is_chainable[3.0.0]",
|
| 123 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[2.0]",
|
| 124 |
+
"tests/test_core.py::TestComponents::test_security_scheme_duplicate_name[3.0.0]",
|
| 125 |
+
"tests/test_core.py::TestComponents::test_components_can_be_accessed_by_plugin_in_init_spec",
|
| 126 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[2.0]",
|
| 127 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_schema[3.0.0]",
|
| 128 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header[3.0.0]",
|
| 129 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_schema[3.0.0]",
|
| 130 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_header_examples[3.0.0]",
|
| 131 |
+
"tests/test_core.py::TestComponents::test_components_resolve_response_examples[3.0.0]",
|
| 132 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_examples[3.0.0]",
|
| 133 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[2.0]",
|
| 134 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas[3.0.0]",
|
| 135 |
+
"tests/test_core.py::TestComponents::test_components_resolve_parameter_schemas_v3[3.0.0]",
|
| 136 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_schema[3.0.0]",
|
| 137 |
+
"tests/test_core.py::TestComponents::test_components_resolve_header_examples[3.0.0]",
|
| 138 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[2.0]",
|
| 139 |
+
"tests/test_core.py::TestComponents::test_parameter_lazy[3.0.0]",
|
| 140 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[2.0]",
|
| 141 |
+
"tests/test_core.py::TestPath::test_paths_maintain_order[3.0.0]",
|
| 142 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[2.0]",
|
| 143 |
+
"tests/test_core.py::TestPath::test_path_is_chainable[3.0.0]",
|
| 144 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[2.0]",
|
| 145 |
+
"tests/test_core.py::TestPath::test_path_methods_maintain_order[3.0.0]",
|
| 146 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[2.0]",
|
| 147 |
+
"tests/test_core.py::TestPath::test_path_merges_paths[3.0.0]",
|
| 148 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[2.0]",
|
| 149 |
+
"tests/test_core.py::TestPath::test_path_ensures_path_parameters_required[3.0.0]",
|
| 150 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[2.0]",
|
| 151 |
+
"tests/test_core.py::TestPath::test_path_with_no_path_raises_error[3.0.0]",
|
| 152 |
+
"tests/test_core.py::TestPath::test_path_summary_description[2.0]",
|
| 153 |
+
"tests/test_core.py::TestPath::test_path_summary_description[3.0.0]",
|
| 154 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[2.0]",
|
| 155 |
+
"tests/test_core.py::TestPath::test_path_resolves_parameter[3.0.0]",
|
| 156 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters0]",
|
| 157 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[2.0-parameters1]",
|
| 158 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters0]",
|
| 159 |
+
"tests/test_core.py::TestPath::test_path_invalid_parameter[3.0.0-parameters1]",
|
| 160 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[2.0]",
|
| 161 |
+
"tests/test_core.py::TestPath::test_parameter_duplicate[3.0.0]",
|
| 162 |
+
"tests/test_core.py::TestPath::test_global_parameters[2.0]",
|
| 163 |
+
"tests/test_core.py::TestPath::test_global_parameters[3.0.0]",
|
| 164 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[2.0]",
|
| 165 |
+
"tests/test_core.py::TestPath::test_global_parameter_duplicate[3.0.0]",
|
| 166 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[2.0]",
|
| 167 |
+
"tests/test_core.py::TestPath::test_path_check_invalid_http_method[3.0.0]",
|
| 168 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body[3.0.0]",
|
| 169 |
+
"tests/test_core.py::TestPath::test_path_resolve_request_body_examples[3.0.0]",
|
| 170 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_examples[3.0.0]",
|
| 171 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[2.0]",
|
| 172 |
+
"tests/test_core.py::TestPath::test_path_resolve_parameter_schemas[3.0.0]",
|
| 173 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-2.0]",
|
| 174 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[True-3.0.0]",
|
| 175 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-2.0]",
|
| 176 |
+
"tests/test_core.py::TestPlugins::test_plugin_schema_helper_is_used[False-3.0.0]",
|
| 177 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-2.0]",
|
| 178 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[True-3.0.0]",
|
| 179 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-2.0]",
|
| 180 |
+
"tests/test_core.py::TestPlugins::test_plugin_parameter_helper_is_used[False-3.0.0]",
|
| 181 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-2.0]",
|
| 182 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[True-3.0.0]",
|
| 183 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-2.0]",
|
| 184 |
+
"tests/test_core.py::TestPlugins::test_plugin_response_helper_is_used[False-3.0.0]",
|
| 185 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[True-3.0.0]",
|
| 186 |
+
"tests/test_core.py::TestPlugins::test_plugin_header_helper_is_used[False-3.0.0]",
|
| 187 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-2.0]",
|
| 188 |
+
"tests/test_core.py::TestPlugins::test_plugin_path_helper_is_used[True-3.0.0]",
|
| 189 |
+
"tests/test_core.py::TestPluginsOrder::test_plugins_order",
|
| 190 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-PetSchema]",
|
| 191 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[2.0-schema1]",
|
| 192 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-PetSchema]",
|
| 193 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_can_use_schema_as_definition[3.0.0-schema1]",
|
| 194 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[2.0]",
|
| 195 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_helper_without_schema[3.0.0]",
|
| 196 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]",
|
| 197 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]",
|
| 198 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[AnalysisWithListSchema]",
|
| 199 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[schema1]",
|
| 200 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[AnalysisSchema]",
|
| 201 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_return_none[schema1]",
|
| 202 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-AnalysisSchema]",
|
| 203 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[2.0-schema1]",
|
| 204 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-AnalysisSchema]",
|
| 205 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_warning_when_schema_added_twice[3.0.0-schema1]",
|
| 206 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[2.0]",
|
| 207 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instances_with_different_modifiers_added[3.0.0]",
|
| 208 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_instance_with_different_modifers_custom_resolver",
|
| 209 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[2.0]",
|
| 210 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_schema_with_clashing_names[3.0.0]",
|
| 211 |
+
"tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_nested_schema_many_true_resolver_return_none",
|
| 212 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-PetSchema]",
|
| 213 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[2.0-schema1]",
|
| 214 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-PetSchema]",
|
| 215 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter[3.0.0-schema1]",
|
| 216 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[PetSchema-3.0.0]",
|
| 217 |
+
"tests/test_ext_marshmallow.py::TestComponentParameterHelper::test_can_use_schema_in_parameter_with_content[schema1-3.0.0]",
|
| 218 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-PetSchema]",
|
| 219 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[2.0-schema1]",
|
| 220 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-PetSchema]",
|
| 221 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response[3.0.0-schema1]",
|
| 222 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-PetSchema]",
|
| 223 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[2.0-schema1]",
|
| 224 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-PetSchema]",
|
| 225 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_can_use_schema_in_response_header[3.0.0-schema1]",
|
| 226 |
+
"tests/test_ext_marshmallow.py::TestComponentResponseHelper::test_content_without_schema[3.0.0]",
|
| 227 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[PetSchema-3.0.0]",
|
| 228 |
+
"tests/test_ext_marshmallow.py::TestComponentHeaderHelper::test_can_use_schema_in_header[schema1-3.0.0]",
|
| 229 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[2.0]",
|
| 230 |
+
"tests/test_ext_marshmallow.py::TestCustomField::test_can_use_custom_field_decorator[3.0.0]",
|
| 231 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-PetSchema]",
|
| 232 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema1]",
|
| 233 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-pet_schema2]",
|
| 234 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_v3[3.0.0-tests.schemas.PetSchema]",
|
| 235 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v2[2.0]",
|
| 236 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_expand_parameters_v3[3.0.0]",
|
| 237 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_expand_parameters_v3[3.0.0]",
|
| 238 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_v3[3.0.0]",
|
| 239 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_if_available_name_resolver_returns_none_v3",
|
| 240 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v2[2.0]",
|
| 241 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 242 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_uses_ref_in_parameters_and_request_body_if_available_v3[3.0.0]",
|
| 243 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_array_uses_ref_if_available_v3[3.0.0]",
|
| 244 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_callback_schema_partially_v3[3.0.0]",
|
| 245 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[2.0]",
|
| 246 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_parameter_reference[3.0.0]",
|
| 247 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[2.0]",
|
| 248 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2json[3.0.0]",
|
| 249 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[2.0]",
|
| 250 |
+
"tests/test_ext_marshmallow.py::TestOperationHelper::test_schema_global_state_untouched_2parameters[3.0.0]",
|
| 251 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[2.0]",
|
| 252 |
+
"tests/test_ext_marshmallow.py::TestCircularReference::test_circular_referencing_schemas[3.0.0]",
|
| 253 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[2.0]",
|
| 254 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_single[3.0.0]",
|
| 255 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[2.0]",
|
| 256 |
+
"tests/test_ext_marshmallow.py::TestSelfReference::test_self_referencing_field_many[3.0.0]",
|
| 257 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[2.0]",
|
| 258 |
+
"tests/test_ext_marshmallow.py::TestOrderedSchema::test_ordered_schema[3.0.0]",
|
| 259 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[2.0]",
|
| 260 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props[3.0.0]",
|
| 261 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[2.0]",
|
| 262 |
+
"tests/test_ext_marshmallow.py::TestFieldWithCustomProps::test_field_with_custom_props_passed_as_snake_case[3.0.0]",
|
| 263 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[2.0]",
|
| 264 |
+
"tests/test_ext_marshmallow.py::TestSchemaWithDefaultValues::test_schema_with_default_values[3.0.0]",
|
| 265 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[2.0]",
|
| 266 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_values_resolve_to_additional_properties[3.0.0]",
|
| 267 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[2.0]",
|
| 268 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_empty_values_field[3.0.0]",
|
| 269 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[2.0]",
|
| 270 |
+
"tests/test_ext_marshmallow.py::TestDictValues::test_dict_with_nested[3.0.0]",
|
| 271 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[2.0]",
|
| 272 |
+
"tests/test_ext_marshmallow.py::TestList::test_list_with_nested[3.0.0]",
|
| 273 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[2.0]",
|
| 274 |
+
"tests/test_ext_marshmallow.py::TestTimeDelta::test_timedelta_x_unit[3.0.0]",
|
| 275 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_raise_if_schema_class_passed",
|
| 276 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_equal",
|
| 277 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[list]",
|
| 278 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_same_schemas_instances_unhashable_modifiers_equal[set]",
|
| 279 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_different_schemas_not_equal",
|
| 280 |
+
"tests/test_ext_marshmallow_common.py::TestMakeSchemaKey::test_instances_with_different_modifiers_not_equal",
|
| 281 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[2.0]",
|
| 282 |
+
"tests/test_ext_marshmallow_common.py::TestUniqueName::test_unique_name[3.0.0]",
|
| 283 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-tuple]",
|
| 284 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[tuple-list]",
|
| 285 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-tuple]",
|
| 286 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_get_fields_meta_exclude_dump_only_as_list_and_tuple[list-list]",
|
| 287 |
+
"tests/test_ext_marshmallow_common.py::TestGetFields::test_schema_with_field_named_fields",
|
| 288 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[2.0]",
|
| 289 |
+
"tests/test_ext_marshmallow_field.py::test_field2choices_preserving_order[3.0.0]",
|
| 290 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Integer-integer]",
|
| 291 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Float-number]",
|
| 292 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string0]",
|
| 293 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-String-string1]",
|
| 294 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean0]",
|
| 295 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Boolean-boolean1]",
|
| 296 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-UUID-string]",
|
| 297 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-DateTime-string]",
|
| 298 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Date-string]",
|
| 299 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Time-string]",
|
| 300 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-TimeDelta-integer]",
|
| 301 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Email-string]",
|
| 302 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-Url-string]",
|
| 303 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IP-string]",
|
| 304 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv4-string]",
|
| 305 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-IPv6-string]",
|
| 306 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomStringField-string]",
|
| 307 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[2.0-CustomIntegerField-integer]",
|
| 308 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Integer-integer]",
|
| 309 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Float-number]",
|
| 310 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string0]",
|
| 311 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-String-string1]",
|
| 312 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean0]",
|
| 313 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Boolean-boolean1]",
|
| 314 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-UUID-string]",
|
| 315 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-DateTime-string]",
|
| 316 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Date-string]",
|
| 317 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Time-string]",
|
| 318 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-TimeDelta-integer]",
|
| 319 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Email-string]",
|
| 320 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-Url-string]",
|
| 321 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IP-string]",
|
| 322 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv4-string]",
|
| 323 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-IPv6-string]",
|
| 324 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomStringField-string]",
|
| 325 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_type[3.0.0-CustomIntegerField-integer]",
|
| 326 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[2.0]",
|
| 327 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_no_type[3.0.0]",
|
| 328 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-List]",
|
| 329 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[2.0-CustomList]",
|
| 330 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-List]",
|
| 331 |
+
"tests/test_ext_marshmallow_field.py::test_formatted_field_translates_to_array[3.0.0-CustomList]",
|
| 332 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-UUID-uuid]",
|
| 333 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-DateTime-date-time]",
|
| 334 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Date-date]",
|
| 335 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Email-email]",
|
| 336 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-Url-url]",
|
| 337 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IP-ip]",
|
| 338 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv4-ipv4]",
|
| 339 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[2.0-IPv6-ipv6]",
|
| 340 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-UUID-uuid]",
|
| 341 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-DateTime-date-time]",
|
| 342 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Date-date]",
|
| 343 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Email-email]",
|
| 344 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-Url-url]",
|
| 345 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IP-ip]",
|
| 346 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv4-ipv4]",
|
| 347 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_formats[3.0.0-IPv6-ipv6]",
|
| 348 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[2.0]",
|
| 349 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_description[3.0.0]",
|
| 350 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[2.0]",
|
| 351 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default[3.0.0]",
|
| 352 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[2.0]",
|
| 353 |
+
"tests/test_ext_marshmallow_field.py::test_boolean_field_with_false_load_default[3.0.0]",
|
| 354 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[2.0]",
|
| 355 |
+
"tests/test_ext_marshmallow_field.py::test_datetime_field_with_load_default[3.0.0]",
|
| 356 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[2.0]",
|
| 357 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_default_callable[3.0.0]",
|
| 358 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[2.0]",
|
| 359 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default[3.0.0]",
|
| 360 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[2.0]",
|
| 361 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_default_and_load_default[3.0.0]",
|
| 362 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[2.0]",
|
| 363 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices[3.0.0]",
|
| 364 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[2.0]",
|
| 365 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices[3.0.0]",
|
| 366 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[2.0]",
|
| 367 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_nullable_choices_returns_only_one_none[3.0.0]",
|
| 368 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[2.0]",
|
| 369 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_equal[3.0.0]",
|
| 370 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[2.0]",
|
| 371 |
+
"tests/test_ext_marshmallow_field.py::test_only_allows_valid_properties_in_metadata[3.0.0]",
|
| 372 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[2.0]",
|
| 373 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_choices_multiple[3.0.0]",
|
| 374 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[2.0]",
|
| 375 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_additional_metadata[3.0.0]",
|
| 376 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[2.0]",
|
| 377 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.0.0]",
|
| 378 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_allow_none[3.1.0]",
|
| 379 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-2.0]",
|
| 380 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.0.0]",
|
| 381 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Field-3.1.0]",
|
| 382 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-2.0]",
|
| 383 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.0.0]",
|
| 384 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_field_with_no_type[Raw-3.1.0]",
|
| 385 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[2.0]",
|
| 386 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.0.0]",
|
| 387 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable[3.1.0]",
|
| 388 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[2.0]",
|
| 389 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.0.0]",
|
| 390 |
+
"tests/test_ext_marshmallow_field.py::test_nested_nullable_with_metadata[3.1.0]",
|
| 391 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[2.0]",
|
| 392 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.0.0]",
|
| 393 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_pluck[3.1.0]",
|
| 394 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[2.0]",
|
| 395 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_dump_only[3.0.0]",
|
| 396 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[2.0]",
|
| 397 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.0.0]",
|
| 398 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_load_only[3.1.0]",
|
| 399 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[2.0]",
|
| 400 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_no_type[3.0.0]",
|
| 401 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Float]",
|
| 402 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[2.0-Integer]",
|
| 403 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Float]",
|
| 404 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_string_type[3.0.0-Integer]",
|
| 405 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_with_number[3.1.0]",
|
| 406 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_type_list_without_number[3.1.0]",
|
| 407 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[2.0]",
|
| 408 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_range_datetime_type[3.0.0]",
|
| 409 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[2.0]",
|
| 410 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_str_regex[3.0.0]",
|
| 411 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[2.0]",
|
| 412 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_pattern_obj_regex[3.0.0]",
|
| 413 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[2.0]",
|
| 414 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_no_pattern[3.0.0]",
|
| 415 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[2.0]",
|
| 416 |
+
"tests/test_ext_marshmallow_field.py::test_field_with_multiple_patterns[3.0.0]",
|
| 417 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[2.0]",
|
| 418 |
+
"tests/test_ext_marshmallow_field.py::test_enum_symbol_field[3.0.0]",
|
| 419 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-Integer]",
|
| 420 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[2.0-True]",
|
| 421 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-Integer]",
|
| 422 |
+
"tests/test_ext_marshmallow_field.py::test_enum_value_field[3.0.0-True]",
|
| 423 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[2.0]",
|
| 424 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum[3.0.0]",
|
| 425 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[2.0]",
|
| 426 |
+
"tests/test_ext_marshmallow_field.py::test_nullable_enum_returns_only_one_none[3.0.0]",
|
| 427 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[2.0]",
|
| 428 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.0.0]",
|
| 429 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec_metadatas[3.1.0]",
|
| 430 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[2.0]",
|
| 431 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_spec[3.0.0]",
|
| 432 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[2.0]",
|
| 433 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many_spec[3.0.0]",
|
| 434 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[2.0]",
|
| 435 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_ref[3.0.0]",
|
| 436 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[2.0]",
|
| 437 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_nested_many[3.0.0]",
|
| 438 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[2.0]",
|
| 439 |
+
"tests/test_ext_marshmallow_field.py::test_nested_field_with_property[3.0.0]",
|
| 440 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[2.0]",
|
| 441 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_iso[3.0.0]",
|
| 442 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[2.0]",
|
| 443 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_rfc[3.0.0]",
|
| 444 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[2.0]",
|
| 445 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp[3.0.0]",
|
| 446 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[2.0]",
|
| 447 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_timestamp_ms[3.0.0]",
|
| 448 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[2.0]",
|
| 449 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format[3.0.0]",
|
| 450 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[2.0]",
|
| 451 |
+
"tests/test_ext_marshmallow_field.py::test_datetime2property_custom_format_missing_regex[3.0.0]",
|
| 452 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[2.0]",
|
| 453 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_spec[3.0.0]",
|
| 454 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[2.0]",
|
| 455 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_with_property[3.0.0]",
|
| 456 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[2.0]",
|
| 457 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_metadata[3.0.0]",
|
| 458 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[2.0]",
|
| 459 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many[3.0.0]",
|
| 460 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[2.0]",
|
| 461 |
+
"tests/test_ext_marshmallow_field.py::TestField2PropertyPluck::test_many_with_property[3.0.0]",
|
| 462 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[2.0]",
|
| 463 |
+
"tests/test_ext_marshmallow_field.py::test_custom_properties_for_custom_fields[3.0.0]",
|
| 464 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[2.0]",
|
| 465 |
+
"tests/test_ext_marshmallow_field.py::test_field2property_with_non_string_metadata_keys[3.0.0]",
|
| 466 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[2.0]",
|
| 467 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_load_default_load[3.0.0]",
|
| 468 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_default_location_mapping_if_schema_many[2.0]",
|
| 469 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[2.0]",
|
| 470 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowFieldToOpenAPI::test_fields_with_dump_only[3.0.0]",
|
| 471 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[2.0]",
|
| 472 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_with_explicit_fields[3.0.0]",
|
| 473 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[2.0]",
|
| 474 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema2jsonschema_override_name[3.0.0]",
|
| 475 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[2.0]",
|
| 476 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_required_fields[3.0.0]",
|
| 477 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[2.0]",
|
| 478 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_partial[3.0.0]",
|
| 479 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[2.0]",
|
| 480 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_no_required_fields[3.0.0]",
|
| 481 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[2.0]",
|
| 482 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_title_and_description_may_be_added[3.0.0]",
|
| 483 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[2.0]",
|
| 484 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_excluded_fields[3.0.0]",
|
| 485 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[2.0]",
|
| 486 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_disallow[3.0.0]",
|
| 487 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[2.0]",
|
| 488 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_allow[3.0.0]",
|
| 489 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[2.0]",
|
| 490 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_unknown_values_ignore[3.0.0]",
|
| 491 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[2.0]",
|
| 492 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_only_explicitly_declared_fields_are_translated[3.0.0]",
|
| 493 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[2.0]",
|
| 494 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_observed_field_name_for_required_field[3.0.0]",
|
| 495 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-True]",
|
| 496 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[2.0-False]",
|
| 497 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-True]",
|
| 498 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_schema_instance_inspection[3.0.0-False]",
|
| 499 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[2.0]",
|
| 500 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToModelDefinition::test_raises_error_if_no_declared_fields[3.0.0]",
|
| 501 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[2.0]",
|
| 502 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_custom_properties_for_custom_fields[3.0.0]",
|
| 503 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[2.0]",
|
| 504 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_required[3.0.0]",
|
| 505 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[2.0]",
|
| 506 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_deprecated[3.0.0]",
|
| 507 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[2.0]",
|
| 508 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial[3.0.0]",
|
| 509 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[2.0]",
|
| 510 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_partial_list[3.0.0]",
|
| 511 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-List]",
|
| 512 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[2.0-CustomList]",
|
| 513 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-List]",
|
| 514 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_field_list[3.0.0-CustomList]",
|
| 515 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body[2.0]",
|
| 516 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_with_dump_only[2.0]",
|
| 517 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_body_many[2.0]",
|
| 518 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[2.0]",
|
| 519 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query[3.0.0]",
|
| 520 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[2.0]",
|
| 521 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance[3.0.0]",
|
| 522 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[2.0]",
|
| 523 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_schema_query_instance_many_should_raise_exception[3.0.0]",
|
| 524 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[2.0]",
|
| 525 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_fields_query[3.0.0]",
|
| 526 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[2.0]",
|
| 527 |
+
"tests/test_ext_marshmallow_openapi.py::TestMarshmallowSchemaToParameters::test_raises_error_if_not_a_schema[3.0.0]",
|
| 528 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[2.0]",
|
| 529 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields[3.0.0]",
|
| 530 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-only]",
|
| 531 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[2.0-exclude]",
|
| 532 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-only]",
|
| 533 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_only_exclude[3.0.0-exclude]",
|
| 534 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[2.0]",
|
| 535 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_field[3.0.0]",
|
| 536 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[2.0]",
|
| 537 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_fields_with_adhoc_changes[3.0.0]",
|
| 538 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[2.0]",
|
| 539 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_plucked_fields_with_adhoc_changes[3.0.0]",
|
| 540 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[2.0]",
|
| 541 |
+
"tests/test_ext_marshmallow_openapi.py::TestNesting::test_schema2jsonschema_with_nested_excluded_fields[3.0.0]",
|
| 542 |
+
"tests/test_ext_marshmallow_openapi.py::test_openapi_converter_openapi_version_types",
|
| 543 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range-properties0]",
|
| 544 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-range_no_upper-properties1]",
|
| 545 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_ranges-properties2]",
|
| 546 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-list_length-properties3]",
|
| 547 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_list_length-properties4]",
|
| 548 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-string_length-properties5]",
|
| 549 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-custom_field_length-properties6]",
|
| 550 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-multiple_lengths-properties7]",
|
| 551 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-equal_length-properties8]",
|
| 552 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[2.0-date_range-properties9]",
|
| 553 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range-properties0]",
|
| 554 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-range_no_upper-properties1]",
|
| 555 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_ranges-properties2]",
|
| 556 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-list_length-properties3]",
|
| 557 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_list_length-properties4]",
|
| 558 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-string_length-properties5]",
|
| 559 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-custom_field_length-properties6]",
|
| 560 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-multiple_lengths-properties7]",
|
| 561 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-equal_length-properties8]",
|
| 562 |
+
"tests/test_ext_marshmallow_openapi.py::TestFieldValidation::test_properties[3.0.0-date_range-properties9]",
|
| 563 |
+
"tests/test_utils.py::test_build_reference",
|
| 564 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring",
|
| 565 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[None]",
|
| 566 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[]",
|
| 567 |
+
"tests/test_yaml_utils.py::test_load_yaml_from_docstring_empty_docstring[---]",
|
| 568 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[None]",
|
| 569 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[]",
|
| 570 |
+
"tests/test_yaml_utils.py::test_load_operations_from_docstring_empty_docstring[---]",
|
| 571 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_unicode",
|
| 572 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_are_not_sorted_by_default",
|
| 573 |
+
"tests/test_yaml_utils.py::test_dict_to_yaml_keys_can_be_sorted_with_yaml_dump_kwargs"
|
| 574 |
+
]
|
| 575 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/grade.py
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Trusted private pytest panel runner. Installed only in a fresh grader Job."""
|
| 2 |
+
|
| 3 |
+
import hashlib
|
| 4 |
+
import importlib.util
|
| 5 |
+
import json
|
| 6 |
+
import os
|
| 7 |
+
import shutil
|
| 8 |
+
import stat
|
| 9 |
+
import subprocess
|
| 10 |
+
from pathlib import Path, PurePosixPath
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def sha(raw):
|
| 14 |
+
return hashlib.sha256(raw).hexdigest()
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def safe(value):
|
| 18 |
+
path = PurePosixPath(value)
|
| 19 |
+
if (
|
| 20 |
+
path.is_absolute()
|
| 21 |
+
or path.as_posix() != value
|
| 22 |
+
or not path.parts
|
| 23 |
+
or any(part in {".", "..", ".git"} for part in path.parts)
|
| 24 |
+
):
|
| 25 |
+
raise ValueError("Unsafe trusted test path")
|
| 26 |
+
return path
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def restore(worktree, private, manifest):
|
| 30 |
+
worktree, private = Path(worktree), Path(private)
|
| 31 |
+
captured = {}
|
| 32 |
+
for name, expected in manifest["files"].items():
|
| 33 |
+
path = private / safe(name)
|
| 34 |
+
info = path.lstat()
|
| 35 |
+
raw = path.read_bytes() if stat.S_ISREG(info.st_mode) else b""
|
| 36 |
+
if (
|
| 37 |
+
not stat.S_ISREG(info.st_mode)
|
| 38 |
+
or len(raw) != expected["bytes"]
|
| 39 |
+
or sha(raw) != expected["sha256"]
|
| 40 |
+
or stat.S_IMODE(info.st_mode) != expected["mode"]
|
| 41 |
+
):
|
| 42 |
+
raise ValueError("Trusted private test bytes or modes drifted")
|
| 43 |
+
captured[name] = (raw, expected["mode"])
|
| 44 |
+
# Capture and verify every private byte before changing the submitted tree.
|
| 45 |
+
for name in manifest["directory_roots"]:
|
| 46 |
+
destination = worktree / safe(name)
|
| 47 |
+
if destination.is_symlink():
|
| 48 |
+
raise ValueError("Submitted test directory is a symlink")
|
| 49 |
+
for parent in destination.parents:
|
| 50 |
+
if parent == worktree:
|
| 51 |
+
break
|
| 52 |
+
if parent.is_symlink():
|
| 53 |
+
raise ValueError("Submitted test parent is a symlink")
|
| 54 |
+
if destination.exists():
|
| 55 |
+
if not destination.is_dir():
|
| 56 |
+
raise ValueError("Submitted test directory is not a directory")
|
| 57 |
+
shutil.rmtree(destination)
|
| 58 |
+
for name, (raw, mode) in captured.items():
|
| 59 |
+
destination = worktree / safe(name)
|
| 60 |
+
for parent in destination.parents:
|
| 61 |
+
if parent == worktree:
|
| 62 |
+
break
|
| 63 |
+
if parent.is_symlink():
|
| 64 |
+
raise ValueError("Submitted test parent is a symlink")
|
| 65 |
+
if destination.is_symlink():
|
| 66 |
+
raise ValueError("Submitted trusted file is a symlink")
|
| 67 |
+
destination.parent.mkdir(parents=True, exist_ok=True)
|
| 68 |
+
destination.write_bytes(raw)
|
| 69 |
+
destination.chmod(mode)
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
def run(worktree, private_root, output, invoke=None):
|
| 73 |
+
private_root, output, worktree = Path(private_root), Path(output), Path(worktree)
|
| 74 |
+
expected = json.loads((private_root / "expected-panels.json").read_bytes())
|
| 75 |
+
config = json.loads((private_root / "panel-config.json").read_bytes())
|
| 76 |
+
manifest = json.loads((private_root / "trusted-inventory.json").read_bytes())
|
| 77 |
+
restore(worktree, private_root / "trusted", manifest)
|
| 78 |
+
output.mkdir(parents=True, exist_ok=True)
|
| 79 |
+
for name in (
|
| 80 |
+
"reward.txt",
|
| 81 |
+
"pass-to-pass.xml",
|
| 82 |
+
"fail-to-pass.xml",
|
| 83 |
+
"pytest-evidence.json",
|
| 84 |
+
):
|
| 85 |
+
(output / name).unlink(missing_ok=True)
|
| 86 |
+
environment = dict(os.environ)
|
| 87 |
+
for key in ("PYTEST_ADDOPTS", "PYTEST_DISABLE_PLUGIN_AUTOLOAD", "PYTHONPATH"):
|
| 88 |
+
environment.pop(key, None)
|
| 89 |
+
commands, native_exit = [], 0
|
| 90 |
+
invoke = invoke or subprocess.run
|
| 91 |
+
for group in ("pass-to-pass", "fail-to-pass"):
|
| 92 |
+
if (
|
| 93 |
+
not isinstance(expected[group], list)
|
| 94 |
+
or not expected[group]
|
| 95 |
+
or any(
|
| 96 |
+
not isinstance(target, str) or not target for target in expected[group]
|
| 97 |
+
)
|
| 98 |
+
):
|
| 99 |
+
raise ValueError("Frozen native pytest selectors are incomplete")
|
| 100 |
+
command = [
|
| 101 |
+
*config["official_pytest_argv"],
|
| 102 |
+
"--override-ini=addopts=",
|
| 103 |
+
"--junitxml=" + str(output / (group + ".xml")),
|
| 104 |
+
*expected[group],
|
| 105 |
+
]
|
| 106 |
+
result = invoke(command, cwd=worktree, env=environment, check=False)
|
| 107 |
+
native_exit = result.returncode
|
| 108 |
+
commands.append({"group": group, "argv": command, "exit_code": native_exit})
|
| 109 |
+
if native_exit != 0:
|
| 110 |
+
break
|
| 111 |
+
(output / "pytest-commands.json").write_text(
|
| 112 |
+
json.dumps(commands, sort_keys=True) + "\n"
|
| 113 |
+
)
|
| 114 |
+
spec = importlib.util.spec_from_file_location(
|
| 115 |
+
"trusted_pytest_result", private_root / "check_pytest.py"
|
| 116 |
+
)
|
| 117 |
+
checker = importlib.util.module_from_spec(spec)
|
| 118 |
+
spec.loader.exec_module(checker)
|
| 119 |
+
result = checker.assess(output, expected, native_exit)
|
| 120 |
+
(output / "reward.txt").write_text(str(result["reward"]) + "\n")
|
| 121 |
+
(output / "pytest-evidence.json").write_text(
|
| 122 |
+
json.dumps(result, sort_keys=True) + "\n"
|
| 123 |
+
)
|
| 124 |
+
return result
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
if __name__ == "__main__":
|
| 128 |
+
run("/testbed/repo", "/tests", "/logs/verifier")
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/panel-config.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"dependency_installation_pinned": false,
|
| 3 |
+
"official_install_cmds": [
|
| 4 |
+
"pip install -e .[dev]"
|
| 5 |
+
],
|
| 6 |
+
"official_pytest_argv": [
|
| 7 |
+
"pytest",
|
| 8 |
+
"--disable-warnings",
|
| 9 |
+
"--color=no",
|
| 10 |
+
"--tb=no",
|
| 11 |
+
"--verbose"
|
| 12 |
+
],
|
| 13 |
+
"official_test_command": "source /opt/miniconda3/bin/activate; conda activate testbed; pytest --disable-warnings --color=no --tb=no --verbose",
|
| 14 |
+
"panel_normalization": "Override project addopts only to execute the exact frozen native panels; add JUnit output, preserve official pytest options and all selectors.",
|
| 15 |
+
"python_version": "3.10",
|
| 16 |
+
"source_bound_test_dependency_cmds": [
|
| 17 |
+
"python -m pip install 'marshmallow>=3.10.0,<4.0.0'"
|
| 18 |
+
],
|
| 19 |
+
"test_dependency_source_sha256": {
|
| 20 |
+
"pyproject.toml": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4",
|
| 21 |
+
"tox.ini": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7"
|
| 22 |
+
}
|
| 23 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/test.sh
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -Eeuo pipefail
|
| 3 |
+
source /opt/miniconda3/bin/activate
|
| 4 |
+
conda activate testbed
|
| 5 |
+
cd /testbed/repo
|
| 6 |
+
exec python -I /tests/grade.py
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted-inventory.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"directory_roots": [
|
| 3 |
+
"tests"
|
| 4 |
+
],
|
| 5 |
+
"files": {
|
| 6 |
+
"pyproject.toml": {
|
| 7 |
+
"bytes": 2488,
|
| 8 |
+
"mode": 420,
|
| 9 |
+
"sha256": "3ec695df908d5fe31fd787988101bab7398e8867750ed2e9912506c5a738f0a4"
|
| 10 |
+
},
|
| 11 |
+
"tests/__init__.py": {
|
| 12 |
+
"bytes": 0,
|
| 13 |
+
"mode": 420,
|
| 14 |
+
"sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
| 15 |
+
},
|
| 16 |
+
"tests/conftest.py": {
|
| 17 |
+
"bytes": 810,
|
| 18 |
+
"mode": 420,
|
| 19 |
+
"sha256": "0009b46d9e729e75bd002d1e0864afaca1f96a6953ce60f8389410bebd0787e2"
|
| 20 |
+
},
|
| 21 |
+
"tests/schemas.py": {
|
| 22 |
+
"bytes": 2130,
|
| 23 |
+
"mode": 420,
|
| 24 |
+
"sha256": "64084646e19c70bf1170dd6639bdd6800dd92a3983074ed2841fae60fbaaec61"
|
| 25 |
+
},
|
| 26 |
+
"tests/test_core.py": {
|
| 27 |
+
"bytes": 51766,
|
| 28 |
+
"mode": 420,
|
| 29 |
+
"sha256": "18ca6c50d1894f5b4fc3d981412341ceed3cc1401bca7ab5ec0c8688b2c67ff3"
|
| 30 |
+
},
|
| 31 |
+
"tests/test_ext_marshmallow.py": {
|
| 32 |
+
"bytes": 52950,
|
| 33 |
+
"mode": 420,
|
| 34 |
+
"sha256": "12f40adf8f18db5073d9f0b692562c528eebc008307e982149da48c7fb600cf5"
|
| 35 |
+
},
|
| 36 |
+
"tests/test_ext_marshmallow_common.py": {
|
| 37 |
+
"bytes": 3236,
|
| 38 |
+
"mode": 420,
|
| 39 |
+
"sha256": "e17249f21422b2fa79f74f51898f242cb1e9786d0ba6df58bc3086d928d51d79"
|
| 40 |
+
},
|
| 41 |
+
"tests/test_ext_marshmallow_field.py": {
|
| 42 |
+
"bytes": 22438,
|
| 43 |
+
"mode": 420,
|
| 44 |
+
"sha256": "39223a47f90ca40e515a7e34ac8806087b3e0ba2968f6832b0a4a77c8c7226b1"
|
| 45 |
+
},
|
| 46 |
+
"tests/test_ext_marshmallow_openapi.py": {
|
| 47 |
+
"bytes": 24310,
|
| 48 |
+
"mode": 420,
|
| 49 |
+
"sha256": "d4edc2675840f8cc7ba0dda6169e2ab3e5c59907e20ae26576d4860828cb9e6b"
|
| 50 |
+
},
|
| 51 |
+
"tests/test_utils.py": {
|
| 52 |
+
"bytes": 918,
|
| 53 |
+
"mode": 420,
|
| 54 |
+
"sha256": "54f00d286b489440bc17cbbb162fcd53c7aedd8f96dea8d5064f44f70c026810"
|
| 55 |
+
},
|
| 56 |
+
"tests/test_yaml_utils.py": {
|
| 57 |
+
"bytes": 1285,
|
| 58 |
+
"mode": 420,
|
| 59 |
+
"sha256": "4a4af4dc1f013207b65093d25ac67809409c1ec7f63f03122a27bf9e1c873003"
|
| 60 |
+
},
|
| 61 |
+
"tests/utils.py": {
|
| 62 |
+
"bytes": 1806,
|
| 63 |
+
"mode": 420,
|
| 64 |
+
"sha256": "a0de7ce4c28047b674ffe7d5ff4cf2b9d97a07378b529c1f058a7099838ea000"
|
| 65 |
+
},
|
| 66 |
+
"tox.ini": {
|
| 67 |
+
"bytes": 778,
|
| 68 |
+
"mode": 420,
|
| 69 |
+
"sha256": "ef999fed2b6069e442fd54748aac1250090141f2a9dbb1b69502632c3fedc2f7"
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
}
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/pyproject.toml
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "apispec"
|
| 3 |
+
version = "6.8.1"
|
| 4 |
+
description = "A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification)."
|
| 5 |
+
readme = "README.rst"
|
| 6 |
+
license = { file = "LICENSE" }
|
| 7 |
+
authors = [{ name = "Steven Loria", email = "sloria1@gmail.com" }]
|
| 8 |
+
maintainers = [
|
| 9 |
+
{ name = "Steven Loria", email = "sloria1@gmail.com" },
|
| 10 |
+
{ name = "Jérôme Lafréchoux", email = "jerome@jolimont.fr" },
|
| 11 |
+
]
|
| 12 |
+
classifiers = [
|
| 13 |
+
"Development Status :: 5 - Production/Stable",
|
| 14 |
+
"Intended Audience :: Developers",
|
| 15 |
+
"License :: OSI Approved :: MIT License",
|
| 16 |
+
"Programming Language :: Python :: 3",
|
| 17 |
+
"Programming Language :: Python :: 3.9",
|
| 18 |
+
"Programming Language :: Python :: 3.10",
|
| 19 |
+
"Programming Language :: Python :: 3.11",
|
| 20 |
+
"Programming Language :: Python :: 3.12",
|
| 21 |
+
"Programming Language :: Python :: 3.13",
|
| 22 |
+
]
|
| 23 |
+
keywords = [
|
| 24 |
+
"apispec",
|
| 25 |
+
"swagger",
|
| 26 |
+
"openapi",
|
| 27 |
+
"specification",
|
| 28 |
+
"oas",
|
| 29 |
+
"documentation",
|
| 30 |
+
"spec",
|
| 31 |
+
"rest",
|
| 32 |
+
"api",
|
| 33 |
+
]
|
| 34 |
+
requires-python = ">=3.9"
|
| 35 |
+
dependencies = ["packaging>=21.3"]
|
| 36 |
+
|
| 37 |
+
[project.urls]
|
| 38 |
+
Changelog = "https://apispec.readthedocs.io/en/latest/changelog.html"
|
| 39 |
+
Funding = "https://opencollective.com/marshmallow"
|
| 40 |
+
Issues = "https://github.com/marshmallow-code/apispec/issues"
|
| 41 |
+
Source = "https://github.com/marshmallow-code/apispec"
|
| 42 |
+
Tidelift = "https://tidelift.com/subscription/pkg/pypi-apispec?utm_source=pypi-apispec&utm_medium=pypi"
|
| 43 |
+
|
| 44 |
+
[project.optional-dependencies]
|
| 45 |
+
yaml = ["PyYAML>=3.10"]
|
| 46 |
+
marshmallow = ["marshmallow>=3.18.0"]
|
| 47 |
+
docs = [
|
| 48 |
+
"apispec[marshmallow]",
|
| 49 |
+
"pyyaml==6.0.2",
|
| 50 |
+
"sphinx==8.1.3",
|
| 51 |
+
"sphinx-issues==5.0.0",
|
| 52 |
+
"sphinx-rtd-theme==3.0.2",
|
| 53 |
+
]
|
| 54 |
+
tests = ["apispec[yaml,marshmallow]", "openapi-spec-validator==0.7.1", "pytest"]
|
| 55 |
+
dev = ["apispec[tests]", "tox", "pre-commit>=3.5,<5.0"]
|
| 56 |
+
|
| 57 |
+
[build-system]
|
| 58 |
+
requires = ["flit_core<4"]
|
| 59 |
+
build-backend = "flit_core.buildapi"
|
| 60 |
+
|
| 61 |
+
[tool.flit.sdist]
|
| 62 |
+
include = [
|
| 63 |
+
"docs/",
|
| 64 |
+
"tests/",
|
| 65 |
+
"CHANGELOG.rst",
|
| 66 |
+
"CONTRIBUTING.rst",
|
| 67 |
+
"SECURITY.md",
|
| 68 |
+
"tox.ini",
|
| 69 |
+
]
|
| 70 |
+
exclude = ["docs/_build/"]
|
| 71 |
+
|
| 72 |
+
[tool.ruff]
|
| 73 |
+
src = ["src"]
|
| 74 |
+
fix = true
|
| 75 |
+
show-fixes = true
|
| 76 |
+
output-format = "full"
|
| 77 |
+
|
| 78 |
+
[tool.ruff.format]
|
| 79 |
+
docstring-code-format = true
|
| 80 |
+
|
| 81 |
+
[tool.ruff.lint]
|
| 82 |
+
ignore = ["E203", "E266", "E501", "E731"]
|
| 83 |
+
select = [
|
| 84 |
+
"B", # flake8-bugbear
|
| 85 |
+
"E", # pycodestyle error
|
| 86 |
+
"F", # pyflakes
|
| 87 |
+
"I", # isort
|
| 88 |
+
"UP", # pyupgrade
|
| 89 |
+
"W", # pycodestyle warning
|
| 90 |
+
]
|
| 91 |
+
|
| 92 |
+
[tool.mypy]
|
| 93 |
+
ignore_missing_imports = true
|
| 94 |
+
warn_unreachable = true
|
| 95 |
+
warn_unused_ignores = true
|
| 96 |
+
warn_redundant_casts = true
|
| 97 |
+
no_implicit_optional = true
|
tasks/marshmallow-code__apispec.8b421526.combine_file__t5dh0iap/tests/trusted/tests/__init__.py
ADDED
|
File without changes
|