diff --git a/.github/workflows/response_templates/mcopenapi_public.yml b/.github/workflows/response_templates/mcopenapi_public.yml index 6d0f7a8108..4cc2651082 100644 --- a/.github/workflows/response_templates/mcopenapi_public.yml +++ b/.github/workflows/response_templates/mcopenapi_public.yml @@ -2864,7 +2864,11 @@ components: type: number format: double example: 1690743671.0881049633 - example: { "version": 2, "update_time": 1690743671.0881049633 } + description: + type: string + description: Description of the response template version. + example: "This is version 2 of the response template." + example: { "version": 2, "update_time": 1690743671.0881049633, "description": "This is version 2 of the response template." } ResponseTemplateManifest: type: object description: Response template manifest. diff --git a/.github/workflows/response_templates/template_script.py b/.github/workflows/response_templates/template_script.py index f49ba5e820..2f6b6ffe88 100644 --- a/.github/workflows/response_templates/template_script.py +++ b/.github/workflows/response_templates/template_script.py @@ -32,21 +32,25 @@ def generate_manifest(directory, prefix, output_dir): template_mapping = _get_template_mapping(directory) for template_name, template_list in sorted(template_mapping.items(), key=lambda x: x[0]): out_template_name = f"{template_name}.json" + curr_template_name = template_name templates_version= [] for _, file in template_list: with open(file, 'r') as in_file: content = in_file.read() curr_template = json.loads(content) - version = curr_template.get("version", "1.0") + version = curr_template.get("version") update_time = curr_template.get("update_time") + description = curr_template.get("description") + curr_template_name = curr_template.get("name", template_name) curr_metadata = { "version": version, "update_time": update_time, + "description": description, } templates_version.append(curr_metadata) response_templates.append({ - "name": template_name, + "name": curr_template_name, "versions": templates_version, "link": f"{prefix}{out_template_name}" })