Skip to content

Commit 9eebe5d

Browse files
committed
update json logic
1 parent 908e76f commit 9eebe5d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

xml2json/xml2json.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,16 @@ def create_json_from_xml(working_dir, file_dir, defined_path, platform_tag, sdk_
622622
# Get API ID
623623
api_id = root.attrib
624624
api_id = api_id.get("id")
625+
626+
# Clean up duplicate parent class in id if present
627+
if api_id:
628+
id_parts = api_id.split("_")
629+
if len(id_parts) == 4 and id_parts[1] == id_parts[3]:
630+
# Remove the duplicate parent class (fourth segment)
631+
original_id = api_id
632+
api_id = "_".join(id_parts[:3])
633+
localLogger.debug(f"Cleaned duplicate parent class from id: {original_id} -> {api_id}")
634+
625635
logLines(localLogger.debug, "App ID", api_id)
626636

627637
# Get API name

0 commit comments

Comments
 (0)