Skip to content

Commit 56b09b8

Browse files
committed
Pass another few draft 4 tests.
1 parent 8ae92bf commit 56b09b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

referencing/jsonschema.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ def id_of(self, resource):
186186
return id
187187

188188
def anchors_in(self, resource):
189-
anchor = self.id_of(resource) or ""
190-
if anchor.startswith("#"):
191-
yield Anchor(name=anchor[1:], resource=resource)
189+
id = resource.get("id")
190+
if id is not None and id.startswith("#"):
191+
yield Anchor(name=id[1:], resource=resource)
192192

193193
def subresources_of(self, resource):
194194
for each in self._SUBRESOURCE:

0 commit comments

Comments
 (0)