The best way to do this would be to use a custom flask json provider that handles Pydantic models + datetime.