From 8b8a6b3342afa1002a97112bf596e1bcd7e90b96 Mon Sep 17 00:00:00 2001 From: Alejandro Villar Date: Mon, 22 Jan 2024 11:21:57 +0100 Subject: [PATCH] Fix OAS 3.0 build --- ogc/bblocks/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ogc/bblocks/util.py b/ogc/bblocks/util.py index fa5f0fa..8815bb6 100644 --- a/ogc/bblocks/util.py +++ b/ogc/bblocks/util.py @@ -788,8 +788,10 @@ def walk(subschema: dict | list, schema_id: str | Path, is_properties: bool = Fa apply_fixes(subschema) schema_version = subschema.pop('$schema', None) - schema_id = subschema.pop('$id', schema_id) - if isinstance(schema_id, str) and isinstance(subschema.get('$ref'), str): + schema_declared_id = subschema.pop('$id', None) + if schema_declared_id: + schema_id = schema_declared_id + if isinstance(schema_id, (str, Path)) and isinstance(subschema.get('$ref'), str): ref = f"{schema_url}#/x-defs/{get_ref_mapping(schema_id, subschema.pop('$ref'))}"