pytest-httpchain-jsonref 0.4.0__tar.gz → 0.6.0__tar.gz
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.
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/PKG-INFO +1 -1
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/pyproject.toml +1 -1
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/src/pytest_httpchain_jsonref/loader.py +3 -0
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/src/pytest_httpchain_jsonref/plumbing/circular.py +18 -3
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/README.md +0 -0
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/src/pytest_httpchain_jsonref/__init__.py +0 -0
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/src/pytest_httpchain_jsonref/exceptions.py +0 -0
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/src/pytest_httpchain_jsonref/plumbing/__init__.py +0 -0
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/src/pytest_httpchain_jsonref/plumbing/path.py +0 -0
- {pytest_httpchain_jsonref-0.4.0 → pytest_httpchain_jsonref-0.6.0}/src/pytest_httpchain_jsonref/plumbing/reference.py +0 -0
|
@@ -12,6 +12,9 @@ def load_json(path: Path, max_parent_traversal_depth: int = 3, root_path: Path |
|
|
|
12
12
|
All three directives ($include, $merge, $ref) work identically. $include and $merge are preferred
|
|
13
13
|
as they avoid conflicts with VS Code's JSON Schema validation (which treats $ref specially).
|
|
14
14
|
|
|
15
|
+
"$schema" keys pass through untouched — whether and where to tolerate them
|
|
16
|
+
is the consumer's decision (pytest-httpchain's models drop them during validation).
|
|
17
|
+
|
|
15
18
|
Args:
|
|
16
19
|
path: Path to the JSON file to load
|
|
17
20
|
max_parent_traversal_depth: Maximum number of parent directory traversals allowed in reference paths
|
|
@@ -60,12 +60,27 @@ class CircularDependencyTracker:
|
|
|
60
60
|
self.internal_refs.discard(pointer)
|
|
61
61
|
|
|
62
62
|
def create_child_tracker(self) -> Self:
|
|
63
|
-
"""Create a child tracker
|
|
63
|
+
"""Create a child tracker for descending into an external document.
|
|
64
|
+
|
|
65
|
+
External refs are keyed by ``(file, pointer)`` and inherited, so a
|
|
66
|
+
cross-document cycle (A -> B -> A) is detected along the resolution
|
|
67
|
+
chain.
|
|
68
|
+
|
|
69
|
+
Internal refs are NOT inherited. A JSON pointer like ``#/a`` is only
|
|
70
|
+
meaningful relative to its own document's root, and a child tracker is
|
|
71
|
+
created exactly when resolution crosses into a new document. Carrying
|
|
72
|
+
the parent's open internal pointers across that boundary would conflate
|
|
73
|
+
unrelated documents that happen to reuse the same pointer string and
|
|
74
|
+
raise a phantom cycle. Genuine intra-document internal cycles are still
|
|
75
|
+
caught, because every internal ref within one document shares a single
|
|
76
|
+
tracker instance; genuine cross-document cycles are caught by
|
|
77
|
+
``external_refs`` (every document-crossing hop is an external ref).
|
|
64
78
|
|
|
65
79
|
Returns:
|
|
66
|
-
A new tracker
|
|
80
|
+
A new tracker inheriting external refs but starting with a fresh,
|
|
81
|
+
empty internal-ref set.
|
|
67
82
|
"""
|
|
68
83
|
child = self.__class__()
|
|
69
84
|
child.external_refs = self.external_refs.copy()
|
|
70
|
-
child.internal_refs =
|
|
85
|
+
child.internal_refs = set()
|
|
71
86
|
return child
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|