Issue
This is my pydantic class
class UploadResult(BaseModel):
reference: str
tag_uid: Optional[int] = Field(default=None, alias="tagUid")
class Config:
arbitrary_types_allowed = True
whenever I'm calling it like this I'm getting the value of tag_uid
to None.
UploadResult(reference='b07b2068fe523c849cddb3dddf9d55fcb109bc5d302ef726738cfc3d83cb6b29', tag_uid=123)
>>> UploadResult(reference='b07b2068fe523c849cddb3dddf9d55fcb109bc5d302ef726738cfc3d83cb6b29'), tag_uid=None)
Solution
Just make the tag_uid
to tagUid
.
UploadResult(reference='b07b2068fe523c849cddb3dddf9d55fcb109bc5d302ef726738cfc3d83cb6b29', tagUid=123)
Answered By - forgotten dinosaur
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.