Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

List of Pydantic model. List[BaseModel]

class UserList(BaseModel):
    __root__: List[User]

UserList.parse_obj([
    {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']},
    {'id': '456', 'signup_ts': '2017-06-02 12:22', 'friends': ['you']},
])
Source by github.com #
 
PREVIOUS NEXT
Tagged: #List #Pydantic
ADD COMMENT
Topic
Name
4+9 =