How do we define a Pydantic Class Type for the following nested dictionary structure (with complicated strings as keys):
{ "inputs" : {
"simpleStringName": <Simple_DateTime_Value>
"simpleStringName2": {
"Complicated|String|Name|with|Pipe|Characters" : <Simple-Int-Value>,
"Complicated|String|Name2|with|Pipe|Characters" : <Simple-Int-Value2>
}
}
}
Pydantic needs to enforce the entire structure. That is simply this will not work:
class XYZ(BaseModel):
inputs : Dict()
I want to enforce requests input format using Pydantic with fastAPI.