From d5350860b5c1fa55fc5bc58943754aa140de57b5 Mon Sep 17 00:00:00 2001 From: Ignacio Heredia Date: Fri, 22 Nov 2024 13:31:39 +0100 Subject: [PATCH] feat: add item `id` to the metadata dict --- ai4papi/routers/v1/catalog/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ai4papi/routers/v1/catalog/common.py b/ai4papi/routers/v1/catalog/common.py index 1b6da7a..f886284 100644 --- a/ai4papi/routers/v1/catalog/common.py +++ b/ai4papi/routers/v1/catalog/common.py @@ -219,6 +219,7 @@ def get_metadata( if error: print(f" [Error] {error}") metadata = { + "id": item_name, "metadata_version": "2.0.0", "title": item_name, "summary": "", @@ -267,6 +268,9 @@ def get_metadata( # (ie. ignore the value coming from the metadata) metadata['links']['docker_image'] = metadata['links']['docker_image'].strip('/ ') + # Add the item name + metadata['id'] = item_name + return metadata def get_config(