Skip to content

Commit 5bfed26

Browse files
ifeledtanous
authored andcommitted
Make Registry description optional
Currently, parse_registries.py assumes the description property exists in every registry json it parses. However, according to the spec [1] it is not a required property, so it may not exist, see [2]. Switch it to optional and use an empty string as a default value. Testing: Ran the script and made sure the generated files remain unchanged. [1] https://redfish.dmtf.org/schemas/v1/MessageRegistry.v1_4_0.json [2] Run: `curl https://redfish.dmtf.org/schemas/v1/MessageRegistry.v1_4_0.json | jq .definitions.MessageRegistry.required` Change-Id: I3e9ba84bbdb9ba5e6ed8b00cde48c15a1b5abba6 Signed-off-by: Igor Kanyuka <ifelmail@gmail.com>
1 parent c48317f commit 5bfed26

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/parse_registries.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ def update_registries(files: t.List[RegistryInfo]) -> None:
9898

9999
registry.write(REGISTRY_HEADER.format(namespace))
100100
# Parse the Registry header info
101+
description = json_dict.get("Description", "")
101102
registry.write(
102103
"const Header header = {{\n"
103104
' "{json_dict[@Redfish.Copyright]}",\n'
@@ -107,7 +108,7 @@ def update_registries(files: t.List[RegistryInfo]) -> None:
107108
" {version_split[2]},\n"
108109
' "{json_dict[Name]}",\n'
109110
' "{json_dict[Language]}",\n'
110-
' "{json_dict[Description]}",\n'
111+
' "{description}",\n'
111112
' "{json_dict[RegistryPrefix]}",\n'
112113
' "{json_dict[OwningEntity]}",\n'
113114
"}};\n"
@@ -119,6 +120,7 @@ def update_registries(files: t.List[RegistryInfo]) -> None:
119120
json_dict=json_dict,
120121
url=url,
121122
version_split=version_split,
123+
description=description,
122124
)
123125
)
124126

0 commit comments

Comments
 (0)