schemathesis 4.3.1__py3-none-any.whl → 4.3.2__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.
Potentially problematic release.
This version of schemathesis might be problematic. Click here for more details.
- schemathesis/core/errors.py +7 -3
- schemathesis/core/jsonschema/bundler.py +6 -4
- schemathesis/specs/openapi/adapter/responses.py +4 -4
- schemathesis/specs/openapi/examples.py +2 -1
- {schemathesis-4.3.1.dist-info → schemathesis-4.3.2.dist-info}/METADATA +1 -1
- {schemathesis-4.3.1.dist-info → schemathesis-4.3.2.dist-info}/RECORD +9 -9
- {schemathesis-4.3.1.dist-info → schemathesis-4.3.2.dist-info}/WHEEL +0 -0
- {schemathesis-4.3.1.dist-info → schemathesis-4.3.2.dist-info}/entry_points.txt +0 -0
- {schemathesis-4.3.1.dist-info → schemathesis-4.3.2.dist-info}/licenses/LICENSE +0 -0
schemathesis/core/errors.py
CHANGED
|
@@ -298,13 +298,17 @@ class UnresolvableReference(SchemathesisError):
|
|
|
298
298
|
|
|
299
299
|
|
|
300
300
|
class InfiniteRecursiveReference(SchemathesisError):
|
|
301
|
-
"""
|
|
301
|
+
"""A schema has required references forming an infinite cycle."""
|
|
302
302
|
|
|
303
|
-
def __init__(self, reference: str) -> None:
|
|
303
|
+
def __init__(self, reference: str, cycle: list[str]) -> None:
|
|
304
304
|
self.reference = reference
|
|
305
|
+
self.cycle = cycle
|
|
305
306
|
|
|
306
307
|
def __str__(self) -> str:
|
|
307
|
-
|
|
308
|
+
if len(self.cycle) == 1:
|
|
309
|
+
return f"Schema `{self.reference}` has a required reference to itself"
|
|
310
|
+
cycle_str = " ->\n ".join(self.cycle + [self.cycle[0]])
|
|
311
|
+
return f"Schema `{self.reference}` has required references forming a cycle:\n\n {cycle_str}"
|
|
308
312
|
|
|
309
313
|
|
|
310
314
|
class SerializationNotPossible(SerializationError):
|
|
@@ -73,7 +73,9 @@ class Bundler:
|
|
|
73
73
|
raise BundleError(reference, resolved_schema)
|
|
74
74
|
def_name = get_def_name(resolved_uri)
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
scopes = resolver._scopes_stack
|
|
77
|
+
|
|
78
|
+
is_recursive_reference = resolved_uri in scopes
|
|
77
79
|
has_recursive_references |= is_recursive_reference
|
|
78
80
|
if inline_recursive and is_recursive_reference:
|
|
79
81
|
# This is a recursive reference! As of Sep 2025, `hypothesis-jsonschema` does not support
|
|
@@ -91,9 +93,9 @@ class Bundler:
|
|
|
91
93
|
cloned = deepclone(resolved_schema)
|
|
92
94
|
remaining_references = sanitize(cloned)
|
|
93
95
|
if reference in remaining_references:
|
|
94
|
-
# This schema is either infinitely recursive or the sanitization logic misses it
|
|
95
|
-
|
|
96
|
-
raise InfiniteRecursiveReference(reference)
|
|
96
|
+
# This schema is either infinitely recursive or the sanitization logic misses it
|
|
97
|
+
cycle = scopes[scopes.index(resolved_uri) :]
|
|
98
|
+
raise InfiniteRecursiveReference(reference, cycle)
|
|
97
99
|
|
|
98
100
|
result = {key: _bundle_recursive(value) for key, value in current.items() if key != "$ref"}
|
|
99
101
|
# Recursive references need `$ref` to be in them, which is only possible with `dict`
|
|
@@ -177,11 +177,11 @@ def _iter_resolved_responses(
|
|
|
177
177
|
) -> Iterator[tuple[str, OpenApiResponse]]:
|
|
178
178
|
for key, response in definition.items():
|
|
179
179
|
status_code = str(key)
|
|
180
|
-
|
|
180
|
+
new_scope, resolved = maybe_resolve(response, resolver, scope)
|
|
181
181
|
yield (
|
|
182
182
|
status_code,
|
|
183
183
|
OpenApiResponse(
|
|
184
|
-
status_code=status_code, definition=resolved, resolver=resolver, scope=
|
|
184
|
+
status_code=status_code, definition=resolved, resolver=resolver, scope=new_scope, adapter=adapter
|
|
185
185
|
),
|
|
186
186
|
)
|
|
187
187
|
|
|
@@ -300,10 +300,10 @@ def _iter_resolved_headers(
|
|
|
300
300
|
definition: types.v3.Headers, resolver: RefResolver, scope: str, adapter: SpecificationAdapter
|
|
301
301
|
) -> Iterator[tuple[str, OpenApiResponseHeader]]:
|
|
302
302
|
for name, header in definition.items():
|
|
303
|
-
|
|
303
|
+
new_scope, resolved = maybe_resolve(header, resolver, scope)
|
|
304
304
|
yield (
|
|
305
305
|
name,
|
|
306
|
-
OpenApiResponseHeader(name=name, definition=resolved, resolver=resolver, scope=
|
|
306
|
+
OpenApiResponseHeader(name=name, definition=resolved, resolver=resolver, scope=new_scope, adapter=adapter),
|
|
307
307
|
)
|
|
308
308
|
|
|
309
309
|
|
|
@@ -219,7 +219,8 @@ def _resolve_bundled(
|
|
|
219
219
|
# Try to remove recursive references to avoid infinite recursion
|
|
220
220
|
remaining_references = references.sanitize(schema)
|
|
221
221
|
if reference in remaining_references:
|
|
222
|
-
|
|
222
|
+
cycle = list(reference_path[reference_path.index(reference) :])
|
|
223
|
+
raise InfiniteRecursiveReference(reference, cycle)
|
|
223
224
|
|
|
224
225
|
new_path = reference_path + (reference,)
|
|
225
226
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: schemathesis
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.2
|
|
4
4
|
Summary: Property-based testing framework for Open API and GraphQL based apps
|
|
5
5
|
Project-URL: Documentation, https://schemathesis.readthedocs.io/en/stable/
|
|
6
6
|
Project-URL: Changelog, https://github.com/schemathesis/schemathesis/blob/master/CHANGELOG.md
|
|
@@ -52,7 +52,7 @@ schemathesis/core/compat.py,sha256=9BWCrFoqN2sJIaiht_anxe8kLjYMR7t0iiOkXqLRUZ8,1
|
|
|
52
52
|
schemathesis/core/control.py,sha256=IzwIc8HIAEMtZWW0Q0iXI7T1niBpjvcLlbuwOSmy5O8,130
|
|
53
53
|
schemathesis/core/curl.py,sha256=jrPL9KpNHteyJ6A1oxJRSkL5bfuBeuPs3xh9Z_ml2cE,1892
|
|
54
54
|
schemathesis/core/deserialization.py,sha256=qjXUPaz_mc1OSgXzTUSkC8tuVR8wgVQtb9g3CcAF6D0,2951
|
|
55
|
-
schemathesis/core/errors.py,sha256=
|
|
55
|
+
schemathesis/core/errors.py,sha256=KlcDlsxg9sHKdo-NtFDluhk1iwQbSHdpDGykf8CxOKY,17357
|
|
56
56
|
schemathesis/core/failures.py,sha256=yFpAxWdEnm0Ri8z8RqRI9H7vcLH5ztOeSIi4m4SGx5g,8996
|
|
57
57
|
schemathesis/core/fs.py,sha256=ItQT0_cVwjDdJX9IiI7EnU75NI2H3_DCEyyUjzg_BgI,472
|
|
58
58
|
schemathesis/core/hooks.py,sha256=qhbkkRSf8URJ4LKv2wmKRINKpquUOgxQzWBHKWRWo3Q,475
|
|
@@ -69,7 +69,7 @@ schemathesis/core/transport.py,sha256=LQcamAkFqJ0HuXQzepevAq2MCJW-uq5Nm-HE9yc7HM
|
|
|
69
69
|
schemathesis/core/validation.py,sha256=b0USkKzkWvdz3jOW1JXYc_TfYshfKZeP7xAUnMqcNoc,2303
|
|
70
70
|
schemathesis/core/version.py,sha256=dOBUWrY3-uA2NQXJp9z7EtZgkR6jYeLg8sMhQCL1mcI,205
|
|
71
71
|
schemathesis/core/jsonschema/__init__.py,sha256=gBZGsXIpK2EFfcp8x0b69dqzWAm2OeZHepKImkkLvoE,320
|
|
72
|
-
schemathesis/core/jsonschema/bundler.py,sha256=
|
|
72
|
+
schemathesis/core/jsonschema/bundler.py,sha256=wK-UhI49TbfnNjr_riQZ28s005d4c-s05WcXLGQFlCs,7861
|
|
73
73
|
schemathesis/core/jsonschema/keywords.py,sha256=pjseXTfH9OItNs_Qq6ubkhNWQOrxTnwHmrP_jxrHeJU,631
|
|
74
74
|
schemathesis/core/jsonschema/references.py,sha256=c2Q4IKWUbwENNtkbFaqf8r3LLZu6GFE5YLnYQlg5tPg,6069
|
|
75
75
|
schemathesis/core/jsonschema/types.py,sha256=C7f9g8yKFuoxC5_0YNIh8QAyGU0-tj8pzTMfMDjjjVM,1248
|
|
@@ -133,7 +133,7 @@ schemathesis/specs/openapi/_hypothesis.py,sha256=g5476s_ArzheWKHHlOfKwx46tqoiehP
|
|
|
133
133
|
schemathesis/specs/openapi/checks.py,sha256=YYV6j6idyw2ubY4sLp-avs2OVEkAWeIihjT0xiV1RRA,30669
|
|
134
134
|
schemathesis/specs/openapi/converter.py,sha256=4a6-8STT5snF7B-t6IsOIGdK5rV16oNqsdvWL7VFf2M,6472
|
|
135
135
|
schemathesis/specs/openapi/definitions.py,sha256=8htclglV3fW6JPBqs59lgM4LnA25Mm9IptXBPb_qUT0,93949
|
|
136
|
-
schemathesis/specs/openapi/examples.py,sha256=
|
|
136
|
+
schemathesis/specs/openapi/examples.py,sha256=moFFfOfzepjlJOrqLc60BrEmJ4oRzwJ3SM03y_nJNMU,24097
|
|
137
137
|
schemathesis/specs/openapi/formats.py,sha256=4tYRdckauHxkJCmOhmdwDq_eOpHPaKloi89lzMPbPzw,3975
|
|
138
138
|
schemathesis/specs/openapi/media_types.py,sha256=F5M6TKl0s6Z5X8mZpPsWDEdPBvxclKRcUOc41eEwKbo,2472
|
|
139
139
|
schemathesis/specs/openapi/patterns.py,sha256=GqPZEXMRdWENQxanWjBOalIZ2MQUjuxk21kmdiI703E,18027
|
|
@@ -145,7 +145,7 @@ schemathesis/specs/openapi/adapter/__init__.py,sha256=YEovBgLjnXd3WGPMJXq0KbSGHe
|
|
|
145
145
|
schemathesis/specs/openapi/adapter/parameters.py,sha256=MYEQUxhtv23e1uhoDq5bDHMUT3Q64bW7aZloJuz13QY,18626
|
|
146
146
|
schemathesis/specs/openapi/adapter/protocol.py,sha256=VDF6COcilHEUnmw76YBVur8bFiTFQHsNvaO9pR_i_KM,2709
|
|
147
147
|
schemathesis/specs/openapi/adapter/references.py,sha256=6M59pJy_U_sLh3Xzgu6-izWXtz3bjXnqJYSD65wRHtk,549
|
|
148
|
-
schemathesis/specs/openapi/adapter/responses.py,sha256=
|
|
148
|
+
schemathesis/specs/openapi/adapter/responses.py,sha256=0iC0i6AF3VMVlTiKxBNLFHG_W22-5K731fVMdhUk9Kk,13269
|
|
149
149
|
schemathesis/specs/openapi/adapter/security.py,sha256=W3cqlbs80NxF9SAavOi7BhtNGzdxHO476lYxiWN0D08,4945
|
|
150
150
|
schemathesis/specs/openapi/adapter/v2.py,sha256=2Rd1cTv7_I5QrBPLVfa2yD80NAErxV3tdeACjtEfXAA,1280
|
|
151
151
|
schemathesis/specs/openapi/adapter/v3_0.py,sha256=8bOE9WUDrvPivGs0w-S1PP2TXgWuaoTzMdg2_WWbi-E,1272
|
|
@@ -179,8 +179,8 @@ schemathesis/transport/prepare.py,sha256=erYXRaxpQokIDzaIuvt_csHcw72iHfCyNq8VNEz
|
|
|
179
179
|
schemathesis/transport/requests.py,sha256=wriRI9fprTplE_qEZLEz1TerX6GwkE3pwr6ZnU2o6vQ,10648
|
|
180
180
|
schemathesis/transport/serialization.py,sha256=GwO6OAVTmL1JyKw7HiZ256tjV4CbrRbhQN0ep1uaZwI,11157
|
|
181
181
|
schemathesis/transport/wsgi.py,sha256=kQtasFre6pjdJWRKwLA_Qb-RyQHCFNpaey9ubzlFWKI,5907
|
|
182
|
-
schemathesis-4.3.
|
|
183
|
-
schemathesis-4.3.
|
|
184
|
-
schemathesis-4.3.
|
|
185
|
-
schemathesis-4.3.
|
|
186
|
-
schemathesis-4.3.
|
|
182
|
+
schemathesis-4.3.2.dist-info/METADATA,sha256=t4XVoDj7Tst0-FT19wxnLdQ3wVtaveCp18GMoa1ZzU4,8540
|
|
183
|
+
schemathesis-4.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
184
|
+
schemathesis-4.3.2.dist-info/entry_points.txt,sha256=hiK3un-xfgPdwj9uj16YVDtTNpO128bmk0U82SMv8ZQ,152
|
|
185
|
+
schemathesis-4.3.2.dist-info/licenses/LICENSE,sha256=2Ve4J8v5jMQAWrT7r1nf3bI8Vflk3rZVQefiF2zpxwg,1121
|
|
186
|
+
schemathesis-4.3.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|