Skip to content
Discussion options

You must be logged in to vote

I think __root__ can solve your problem:

class ResponseWithList(BaseModel):
    __root__: List[Any]

More information see https://docs.pydantic.dev/usage/models/#custom-root-types

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by luolingchun
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
3 participants
Converted from issue

This discussion was converted from issue #56 on February 12, 2023 03:25.