Skip to content

Commit e5aa842

Browse files
committed
Fix: add populate_by_name.
1 parent 14bbfc6 commit e5aa842

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cmdcomp/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class Model(BaseModel):
5-
model_config = ConfigDict(extra="forbid")
5+
model_config = ConfigDict(extra="forbid", populate_by_name=True)

cmdcomp/v2/command/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
from cmdcomp.model import Model
99
from cmdcomp.v2.command.argument.flag_argument import V2FlagArgument
10-
from cmdcomp.v2.command.argument.select_argument import (
11-
V2SelectArgument,
12-
V2ValueArgument,
13-
)
10+
from cmdcomp.v2.command.argument.select_argument import V2SelectArgument
1411
from cmdcomp.v2.mixin.has_alias import HasAlias
1512

1613
from .argument import V2Argument
@@ -250,7 +247,7 @@ def _convert_argument(value: _InputArgument | None) -> V2Argument:
250247
case list():
251248
return V2SelectArgument(
252249
type="select",
253-
raw_values=[V2ValueArgument(value=v) for v in value],
250+
raw_values=[v for v in value],
254251
)
255252

256253
case None:

0 commit comments

Comments
 (0)