diff --git a/installation_instruction/installation_instruction.py b/installation_instruction/installation_instruction.py index 6ea508f..e007357 100644 --- a/installation_instruction/installation_instruction.py +++ b/installation_instruction/installation_instruction.py @@ -82,12 +82,13 @@ def parse_schema(self) -> dict: "description": value.get("description", ""), "type": value.get("type", "enum"), "default": value.get("default", None), + "key": key, } if "enum" in value: result["properties"][key]["enum"] = [ { "title": e, - "value": e, + "key": e, "description": "", } for e in value["enum"] ] @@ -95,7 +96,7 @@ def parse_schema(self) -> dict: result["properties"][key]["enum"] = [ { "title": c.get("title", c.get("const", "")), - "value": c.get("const", ""), + "key": c.get("const", ""), "description": c.get("description", ""), } for c in value[type] ] diff --git a/tests/test_installation_instruction.py b/tests/test_installation_instruction.py index 9e1ede1..1d902a2 100644 --- a/tests/test_installation_instruction.py +++ b/tests/test_installation_instruction.py @@ -27,15 +27,16 @@ def test_parse_schema(test_data_flags_options): "description": "The package manager of your choosing.", "default": "pip", "type": "enum", + "key": "packager", "enum": [ { "title": "pip", - "value": "pip", + "key": "pip", "description": "" }, { "title": "conda", - "value": "conda", + "key": "conda", "description": "" } ] @@ -44,15 +45,16 @@ def test_parse_schema(test_data_flags_options): assert schema["properties"]["compute_platform"] == { "title": "Compute Platform", "description": "Should your gpu or your cpu handle the task?", + "key": "compute_platform", "enum": [ { "title": "CUDA 11.8", - "value": "cu118", + "key": "cu118", "description": "" }, { "title": "CUDA 12.1", - "value": "cu121", + "key": "cu121", "description": "CUDA 12.1 is the latest version of CUDA." } ],