diff --git a/aas_standard_parser/classes/descriptor_json_helper_classes.py b/aas_standard_parser/classes/descriptor_json_helper_classes.py index 5d36e76..0127532 100644 --- a/aas_standard_parser/classes/descriptor_json_helper_classes.py +++ b/aas_standard_parser/classes/descriptor_json_helper_classes.py @@ -16,9 +16,10 @@ def __init__(self, href: str): class DescriptorData: """Class to represent the descriptor data structure.""" - def __init__(self, identifier: str): + def __init__(self, identifier_encoded: str): """Initialize the DescriptorData with the given descriptor data.""" - self.identifier: str = identifier + self.identifier_encoded: str = identifier_encoded + self.identifier: str = "" self.endpoints: list[dict] = [] self.description: dict = {} self.display_name: dict = {} diff --git a/aas_standard_parser/descriptor_json_helper.py b/aas_standard_parser/descriptor_json_helper.py index 8eab126..36afeaf 100644 --- a/aas_standard_parser/descriptor_json_helper.py +++ b/aas_standard_parser/descriptor_json_helper.py @@ -14,13 +14,13 @@ def parse_descriptor(descriptor_data: dict) -> DescriptorData | None: :param descriptor_data: The descriptor data containing endpoints. :return: A DescriptorData object containing parsed descriptor information. """ - identifier = descriptor_data.get("id", "") + identifier_encoded = descriptor_data.get("id", "") - if not identifier: + if not identifier_encoded: logger.warning(f"Descriptor data missing 'id' field: {descriptor_data}") return None - descriptor = DescriptorData(identifier) + descriptor = DescriptorData(identifier_encoded) descriptor.endpoints = descriptor_data.get("endpoints", []) descriptor.description = descriptor_data.get("description", {}) descriptor.display_name = descriptor_data.get("displayName", {}) @@ -28,6 +28,7 @@ def parse_descriptor(descriptor_data: dict) -> DescriptorData | None: descriptor.id_short = descriptor_data.get("idShort", "") descriptor.semantic_id = descriptor_data.get("semanticId", {}) descriptor.supplementary_semantic_ids = descriptor_data.get("supplementarySemanticIds", []) + descriptor.identifier = decode_base_64(identifier_encoded) return descriptor