Skip to content

Commit 751be4e

Browse files
committed
character: make CharacterTraitLink.spoiler/lie Optional
Per the kana field-selection contract these fields are only present when the caller explicitly requests them in `fields=`. Marking them Optional keeps `traits{name}` (without spoiler/lie) parseable by dacite instead of raising MissingValueError.
1 parent 0263ef6 commit 751be4e

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/veedb/apitypes/entities/character.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ class CharacterVNLink:
3737
@dataclass
3838
class CharacterTraitLink:
3939
id: VNDBID # Trait ID
40-
spoiler: int # 0, 1, or 2
41-
lie: bool
40+
# Per kana field-selection rules these are only present when
41+
# explicitly requested in `fields=`. Make them Optional so partial
42+
# selections like `traits{name}` parse cleanly.
43+
spoiler: Optional[int] = None # 0, 1, or 2
44+
lie: Optional[bool] = None
4245
# Other Trait fields can be selected
4346
name: Optional[str] = None # Example: Trait name
4447
# group_name: Optional[str] = None # Example

0 commit comments

Comments
 (0)