Skip to content

Commit

Permalink
perf: Improve performance of add_link
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <dmitry@dygalo.dev>
  • Loading branch information
Stranger6667 committed May 11, 2024
1 parent e33fac8 commit 53bdd2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/changelog.rst
Expand Up @@ -4,6 +4,10 @@ Changelog
:version:`Unreleased <v3.28.0...HEAD>` - TBD
--------------------------------------------

**Performance**

- Improve performance of ``add_link`` by avoiding unnecessary reference resolving.

.. _v3.28.0:

:version:`3.28.0 <v3.27.1...v3.28.0>` - 2024-05-10
Expand Down
2 changes: 1 addition & 1 deletion src/schemathesis/specs/openapi/schemas.py
Expand Up @@ -524,7 +524,7 @@ def add_link(
if operation == source.path:
# Methods should be completely resolved now, otherwise they might miss a resolving scope when
# they will be fully resolved later
methods = self.resolver.resolve_all(methods)
methods = self.resolver.resolve_all(methods, RECURSION_DEPTH_LIMIT - 8)
found = False
for method, definition in methods.items():
if method.upper() == source.method.upper():
Expand Down

0 comments on commit 53bdd2f

Please sign in to comment.