We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb80d66 commit 191457aCopy full SHA for 191457a
referencing/jsonschema.py
@@ -181,11 +181,12 @@ def id_of(self, resource):
181
if resource is True or resource is False or "$ref" in resource:
182
return None
183
id = resource.get("id")
184
- if id is not None and not id.startswith("#"):
185
- return id
+ if id is None or id.startswith("#"):
+ return
186
+ return id
187
188
def anchors_in(self, resource):
- anchor = resource.get("id", "")
189
+ anchor = self.id_of(resource) or ""
190
if anchor.startswith("#"):
191
yield Anchor(name=anchor[1:], resource=resource)
192
0 commit comments