Skip to content

Commit 999b533

Browse files
committed
str for ids
1 parent edf8412 commit 999b533

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sphinx_needs/schema/core.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ def validate_need(
399399
field=link_type,
400400
)
401401
return warnings
402-
needs_matching = []
403-
needs_mismatching = []
402+
needs_matching: list[str] = []
403+
needs_mismatching: list[str] = []
404404
if need[link_type]:
405405
for link in need[link_type]:
406406
target_need = needs.get(link)
@@ -426,6 +426,7 @@ def validate_need(
426426
field=link_type,
427427
)
428428
continue
429+
target_need_dict = dict(target_need)
429430
new_schema_path = copy.deepcopy(schema_path)
430431
new_schema_path.append(
431432
f"{idx}[{linked_schema['id']}]"
@@ -439,11 +440,11 @@ def validate_need(
439440
)
440441
ontology_warnings = validate_need(
441442
config=config,
442-
need=target_need,
443+
need=target_need_dict,
443444
needs=needs,
444445
all_type_schemas=all_type_schemas,
445446
type_schemas=[cast(SchemaType, linked_schema)],
446-
need_path=[*need_path, link_type, target_need["id"]],
447+
need_path=[*need_path, link_type, str(target_need_dict["id"])],
447448
schema_path=[
448449
*schema_path_new,
449450
"link_schema",
@@ -460,9 +461,9 @@ def validate_need(
460461
# user config error, abort the validation
461462
warnings.extend(ontology_warnings)
462463
return warnings
463-
needs_mismatching.append(target_need["id"])
464+
needs_mismatching.append(str(target_need_dict["id"]))
464465
else:
465-
needs_matching.append(target_need["id"])
466+
needs_matching.append(str(target_need_dict["id"]))
466467
cnt_matching = len(needs_matching)
467468
cnt_mismatching = len(needs_mismatching)
468469
if (

0 commit comments

Comments
 (0)