Skip to content

Request: Support List[pydantic.BaseModel] as response #57

Answered by luolingchun
guneemwelloeux asked this question in Q&A
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: 3 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
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
2 participants
Converted from issue

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