Skip to content

Commit 5239b95

Browse files
Group by parent
1 parent 03715f9 commit 5239b95

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

linodecli/baked/parsing.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ def __simplify(sentence: str) -> Optional[str]:
144144
if simplified is not None
145145
)
146146

147-
print(result)
148-
149147
if result is None:
150148
raise ValueError(
151149
f"description does not contain any relevant lines: {description}",

linodecli/documentation/template_data.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,17 @@ def from_openapi(cls, arg: OpenAPIRequestArg) -> Self:
9393
:returns: The initialized object.
9494
"""
9595

96+
type_str = arg.datatype
97+
if arg.item_type is not None:
98+
type_str = f"{arg.datatype}[{arg.item_type}]"
99+
100+
if arg.format == "json":
101+
type_str = "json"
102+
96103
return cls(
97104
path=arg.path,
98105
required=arg.required,
99-
type=(
100-
arg.datatype
101-
if arg.item_type is None
102-
else f"{arg.datatype}[{arg.item_type}]"
103-
),
106+
type=type_str,
104107
is_json=arg.format == "json",
105108
is_nullable=arg.nullable,
106109
is_parent=arg.is_parent,
@@ -224,7 +227,9 @@ def from_openapi(cls, operation: OpenAPIOperation) -> Self:
224227
if not isinstance(arg, OpenAPIRequestArg):
225228
continue
226229

227-
sections[arg.prefix or ""].append(Argument.from_openapi(arg))
230+
sections[arg.parent if arg.is_child else ""].append(
231+
Argument.from_openapi(arg)
232+
)
228233

229234
result.argument_sections = sorted(
230235
[

0 commit comments

Comments
 (0)