this question about request.
{
number: 0,
week:{
#day of week (0-monday, etc)
0:{
# hours 0 - 00:00, 1 - 01:00, etc
0: 1.5,
1: 3.99
}
}
How I can create Pydantic class for this request schema? I try this:
from typing import Dict
class CoefficientForHour(BaseModel):
hour: int
coefficient: float
class Week(BaseModel):
week_day: int
coefficients_for_hours: Dict[int, CoefficientForHour]
class OneCreateRequest(BaseModel):
number: int
week: Dict[int, Week]
but is incorrect