If I use GET (given an id) I get a JSON like:
{
"data": {
"id": "81",
"ks": {
"k1": 25,
"k2": 5
},
"items": [
{
"id": 1,
"name": "John",
"surname": "Smith"
},
{
"id": 2,
"name": "Jane",
"surname": "Doe"
}
]
},
"server-time": "2021-12-09 14:18:40"
}
with the particular case (if id does not exist):
{
"data": {
"id": -1,
"ks": "",
"items": []
},
"server-time": "2021-12-10 09:35:22"
}
I would like to create a Pydantic model for managing this data structure (I mean to formally define these objects). What is the smartest way to manage this data structure by creating classes (possibly nested)?