Skip to content

Commit

Permalink
Fix update_refs with fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Sep 4, 2023
1 parent acffe86 commit 5fb209e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ogc/bblocks/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
if bb_config_file and bb_config_file.is_file():
bb_config = load_yaml(filename=bb_config_file)
id_prefix = bb_config.get('identifier-prefix', id_prefix)
if id_prefix and id_prefix[-1] != '.':
id_prefix += '.'
subdirs = id_prefix.split('.')[1:]
schema_mapping_config = bb_config.get('schema-mapping', {})

Expand Down
2 changes: 1 addition & 1 deletion ogc/bblocks/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def annotate_schema(bblock: BuildingBlock,
result.append(annotated_schema_fn)

# JSON
update_refs(annotated_schema, lambda s: re.sub(r'\.yaml$', '.json', s))
update_refs(annotated_schema, lambda s: re.sub(r'\.yaml(#.*)?$', r'.json\1', s))
annotated_schema_json_fn = annotated_schema_fn.with_suffix('.json')
with open(annotated_schema_json_fn, 'w') as f:
json.dump(annotated_schema, f, indent=2)
Expand Down

0 comments on commit 5fb209e

Please sign in to comment.