Skip to content

Commit

Permalink
fix: fix RootModel.__root__ type not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Ljzd-PRO committed Dec 1, 2023
1 parent ad358c6 commit fcf3c9e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ktoolbox/api/misc/get_app_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class GetAppVersion(BaseAPI):
method = "get"

class Response(RootModel[str]):
pass
__root__: str

extra_validator = RootModel.parse_obj

Expand Down
2 changes: 1 addition & 1 deletion ktoolbox/api/posts/get_announcement.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GetAnnouncement(BaseAPI):
method = "get"

class Response(RootModel[List[Announcement]]):
pass
__root__: List[Announcement]

@classmethod
async def __call__(cls, service: str, creator_id: str) -> APIRet[List[Announcement]]:
Expand Down
2 changes: 1 addition & 1 deletion ktoolbox/api/posts/get_creator_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class GetCreatorPost(BaseAPI):
method = "get"

class Response(RootModel[List[Post]]):
pass
__root__: List[Post]

@classmethod
async def __call__(cls, service: str, creator_id: str, *, q: str = None, o: int = None) -> APIRet[List[Post]]:
Expand Down
2 changes: 1 addition & 1 deletion ktoolbox/api/posts/get_creators.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class GetCreators(BaseAPI):
method = "get"

class Response(RootModel[List[Creator]]):
pass
__root__: List[Creator]

@classmethod
async def __call__(cls) -> APIRet[List[Creator]]:
Expand Down

0 comments on commit fcf3c9e

Please sign in to comment.