Skip to content

Commit

Permalink
Do not detect self-references as dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jan 31, 2024
1 parent d0c2761 commit 5056233
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ogc/bblocks/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ def walk_schema(schema):
ref = schema.get(BBLOCKS_REF_ANNOTATION, schema.get('$ref'))
if isinstance(ref, str):
ref = re.sub(r'#.*$', '', ref)
if ref.startswith('bblocks://'):
if ref == f"bblocks://{bblock.identifier}":
# A self-reference is not a dependency
pass
elif ref.startswith('bblocks://'):
# Get id directly from bblocks:// URI
deps.add(ref[len('bblocks://'):])
elif ref in self.imported_bblock_schemas:
Expand Down

0 comments on commit 5056233

Please sign in to comment.