schemathesis 3.28.0__py3-none-any.whl → 3.29.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- schemathesis/exceptions.py +4 -3
- schemathesis/models.py +2 -10
- schemathesis/runner/impl/core.py +1 -1
- schemathesis/schemas.py +19 -33
- schemathesis/specs/graphql/_cache.py +26 -0
- schemathesis/specs/graphql/schemas.py +79 -46
- schemathesis/specs/openapi/_cache.py +123 -0
- schemathesis/specs/openapi/_hypothesis.py +2 -0
- schemathesis/specs/openapi/links.py +36 -26
- schemathesis/specs/openapi/references.py +17 -6
- schemathesis/specs/openapi/schemas.py +229 -158
- schemathesis/specs/openapi/security.py +3 -5
- schemathesis/specs/openapi/stateful/__init__.py +1 -2
- schemathesis/specs/openapi/stateful/links.py +5 -5
- schemathesis/stateful/__init__.py +10 -2
- schemathesis/transports/content_types.py +2 -0
- {schemathesis-3.28.0.dist-info → schemathesis-3.29.0.dist-info}/METADATA +6 -2
- {schemathesis-3.28.0.dist-info → schemathesis-3.29.0.dist-info}/RECORD +21 -19
- {schemathesis-3.28.0.dist-info → schemathesis-3.29.0.dist-info}/WHEEL +0 -0
- {schemathesis-3.28.0.dist-info → schemathesis-3.29.0.dist-info}/entry_points.txt +0 -0
- {schemathesis-3.28.0.dist-info → schemathesis-3.29.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -65,10 +65,13 @@ class InliningResolver(jsonschema.RefResolver):
|
|
|
65
65
|
|
|
66
66
|
def resolve_all(self, item: JSONType, recursion_level: int = 0) -> JSONType:
|
|
67
67
|
"""Recursively resolve all references in the given object."""
|
|
68
|
+
resolve = self.resolve_all
|
|
68
69
|
if isinstance(item, dict):
|
|
69
70
|
ref = item.get("$ref")
|
|
70
|
-
if
|
|
71
|
-
|
|
71
|
+
if isinstance(ref, str):
|
|
72
|
+
url, resolved = self.resolve(ref)
|
|
73
|
+
self.push_scope(url)
|
|
74
|
+
try:
|
|
72
75
|
# If the next level of recursion exceeds the limit, then we need to copy it explicitly
|
|
73
76
|
# In other cases, this method create new objects for mutable types (dict & list)
|
|
74
77
|
next_recursion_level = recursion_level + 1
|
|
@@ -76,10 +79,18 @@ class InliningResolver(jsonschema.RefResolver):
|
|
|
76
79
|
copied = fast_deepcopy(resolved)
|
|
77
80
|
remove_optional_references(copied)
|
|
78
81
|
return copied
|
|
79
|
-
return
|
|
80
|
-
|
|
82
|
+
return resolve(resolved, next_recursion_level)
|
|
83
|
+
finally:
|
|
84
|
+
self.pop_scope()
|
|
85
|
+
return {
|
|
86
|
+
key: resolve(sub_item, recursion_level) if isinstance(sub_item, (dict, list)) else sub_item
|
|
87
|
+
for key, sub_item in item.items()
|
|
88
|
+
}
|
|
81
89
|
if isinstance(item, list):
|
|
82
|
-
return [
|
|
90
|
+
return [
|
|
91
|
+
self.resolve_all(sub_item, recursion_level) if isinstance(sub_item, (dict, list)) else sub_item
|
|
92
|
+
for sub_item in item
|
|
93
|
+
]
|
|
83
94
|
return item
|
|
84
95
|
|
|
85
96
|
def resolve_in_scope(self, definition: dict[str, Any], scope: str) -> tuple[list[str], dict[str, Any]]:
|
|
@@ -89,7 +100,7 @@ class InliningResolver(jsonschema.RefResolver):
|
|
|
89
100
|
if "$ref" in definition:
|
|
90
101
|
self.push_scope(scope)
|
|
91
102
|
try:
|
|
92
|
-
new_scope, definition =
|
|
103
|
+
new_scope, definition = self.resolve(definition["$ref"])
|
|
93
104
|
finally:
|
|
94
105
|
self.pop_scope()
|
|
95
106
|
scopes.append(new_scope)
|