microsoftgraph / microsoftgraph/msgraph-sdk-python
JSON serialization exception when creating PlannerTask
Aberta
@rkodev já está trabalhando nisso.
Desde 12/7/2024.
Needs: Attention :wave:
- Linguagem predominante
- Python
- Estrelas
- 630
- Forks
- 96
- Merge médio
- 15h 20min
- PRs com merge (30d)
- 3
Descrição
Sample Python code from this documentation page does not work if any of datetime-typed fields initialized.
Exception with message Object of type DateTime is not JSON serializable is thrown.
Non-working code:
graph_client = GraphServiceClient(credentials, scopes)
request_body = PlannerTask(
plan_id = "xqQg5FS2LkCp935s-FIFm2QAFkHM",
bucket_id = "hsOf2dhOJkqyYYZEtdzDe2QAIUCR",
title = "Update client list",
assignments = PlannerAssignments(
additional_data = {
"fbab97d0-4932-4511-b675-204639209557" : {
"@odata_type" : "#microsoft.graph.plannerAssignment",
"order_hint" : " !",
},
}
),
due_date_time = datetime(2023, 12, 31)
)
result = await graph_client.planner.tasks.post(request_body)
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Avaliação
Esta issue ainda não foi avaliada.