Skip to content

Commit f81a211

Browse files
committed
Empty URI fragments are equivalent to ones with no fragment.
So normalize them on addition. Not sure this applies outside of JSON Schema but we can reevaluate later.
1 parent 6345ad8 commit f81a211

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

referencing/_core.py

+3
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,9 @@ def with_resources(
404404
resources = self._resources
405405
uncrawled = self._uncrawled
406406
for uri, resource in pairs:
407+
# Empty fragment URIs are equivalent to URIs without the fragment.
408+
# TODO: Is this true for non JSON Schema resources? Probably not.
409+
uri = uri.rstrip("#")
407410
uncrawled = uncrawled.insert(uri)
408411
resources = resources.insert(uri, resource)
409412
return evolve(self, resources=resources, uncrawled=uncrawled)

suite

Submodule suite updated 31 files

0 commit comments

Comments
 (0)