From 4b4ed4003be510fd9c79503d47174830e6ab522e 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..ff60841 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') + 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'))}"