From 01ae9d3ce917e15ac93f476c5ec27128ee10709e Mon Sep 17 00:00:00 2001 From: xtaodada Date: Tue, 8 Aug 2023 13:55:26 +0800 Subject: [PATCH] :bug: Make CalculatorCharacterDetails weapon optional --- simnet/models/genshin/calculator.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/simnet/models/genshin/calculator.py b/simnet/models/genshin/calculator.py index 7ae16e5..ae1d390 100644 --- a/simnet/models/genshin/calculator.py +++ b/simnet/models/genshin/calculator.py @@ -83,7 +83,7 @@ class CalculatorCharacter(BaseCharacter): @validator("weapon_type", pre=True) def parse_weapon_type(cls, v: Any) -> str: - """Parse the weapon type of a character. + """Parse the weapon type of character. Args: v (Any): The value of the weapon type. @@ -121,7 +121,7 @@ class CalculatorWeapon(APIModel): @validator("type", pre=True) def parse_weapon_type(cls, v: Any) -> str: """ - Parse the type of a weapon. + Parse the type of weapon. Args: v (Any): The value of the weapon type. @@ -249,12 +249,12 @@ class CalculatorCharacterDetails(APIModel): """Details of a synced calculator Attributes: - weapon (CalculatorWeapon): The calculator weapon. + weapon (CalculatorWeapon, optional): The calculator weapon. talents (List[CalculatorTalent]): A list of calculator talents. artifacts (List[CalculatorArtifact]): A list of calculator artifacts. """ - weapon: CalculatorWeapon = Field(alias="weapon") + weapon: Optional[CalculatorWeapon] = Field(alias="weapon") talents: List[CalculatorTalent] = Field(alias="skill_list") artifacts: List[CalculatorArtifact] = Field(alias="reliquary_list")