Skip to content

Commit 4f1322f

Browse files
authored
fix: handle empty description string in class generator (#2677)
When API schema has description: "" (empty string), dict.get() returns the empty string instead of falling back to MISSING_DESCRIPTION_STR, causing empty class docstrings. Use 'or' instead of get() default to handle both missing and empty/falsy description values.
1 parent 16ded46 commit 4f1322f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

class_generator/parsers/explain_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def parse_explain(kind: str) -> list[dict[str, Any]]:
8989

9090
resource_dict: dict[str, Any] = {
9191
"base_class": "NamespacedResource" if namespaced else "Resource",
92-
"description": _kind_schema.get("description", MISSING_DESCRIPTION_STR),
92+
"description": _kind_schema.get("description") or MISSING_DESCRIPTION_STR,
9393
"fields": [],
9494
"spec": [],
9595
}

0 commit comments

Comments
 (0)