Setting additional_data for DriveItemUploadableProperties throw 400
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 42/100
Piste de recherche
Commencez par le point d’entrée create_upload_session et examinez comment DriveItemUploadableProperties et CreateUploadSessionPostRequestBody sérialisent les données supplémentaires dans additional_data. Reproduisez la requête de l’issue avec msgraph.generated.models.drive_item_uploadable_properties et le champ @microsoft.graph.conflictBehavior. Le travail est terminé lorsque createUploadSession accepte le champ documenté et applique le comportement de conflit demandé lorsqu’un fichier existe déjà.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Describe the bug
When try to add any field from the docs, such as "description" or "@microsoft.graph.conflictBehavior" to DriveItemUploadableProperties from msgraph.generated.models.drive_item_uploadable_properties msgraph throw this:
E msgraph.generated.models.o_data_errors.o_data_error.ODataError:
E APIError
E Code: 400
E message: None
E error: MainError(additional_data={}, code='invalidRequest', details=None, inner_error=InnerError(additional_data={}, client_request_id='463c4945-0f9c-435e-9ece-30e48ff358b6', date=DateTime(2024, 11, 6, 8, 37, 41, tzinfo=Timezone('UTC')), odata_type=None, request_id='48083d5b-ecd3-4176-8447-112ab2233e72'), message='The request is malformed or incorrect.', target=None)
code i used for this:
sp_url = f'{self.drive_path}/items/root:{remote_path}:'
sp_session_url = sp_url + '/createUploadSession'
base_request_builder = (
self.client.drives.by_drive_id(self.drive_id)
.items.by_drive_item_id("root").create_upload_session.with_url(
sp_session_url,
)
)
create_session_response = await base_request_builder.post(
CreateUploadSessionPostRequestBody(
item=DriveItemUploadableProperties(
name=file_name,
additional_data={
"@microsoft.graph.conflictBehavior": "rename",
},
),
)
)
I also tried to add additional_data to CreateUploadSessionPostRequestBody but it does nothing
Expected behavior
When uploading file to Sharepoint and file with the same name already exists it must add suffix (1) or _1 to the new file
How to reproduce
try to upload file with createUploadSession if file with that name already exists using code above
SDK Version
1.9.0
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- Langage dominant
- Python
- Étoiles
- 630
- Forks
- 96
- Merge moyen
- 15 h 20 min
- PR mergées (30 j)
- 3
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoftgraph/msgraph-sdk-python
-
status:waiting-for-triage type:bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
microsoftgraph/msgraph-sdk-python#1570 ·
-
status:waiting-for-triage type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
microsoftgraph/msgraph-sdk-python#1563 ·
-
Needs: Attention :wave: type:bug
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
microsoftgraph/msgraph-sdk-python#1287 · 2 commentaires · 1 réaction ·
-
Batch Request Support Ouvertestatus:waiting-for-triage
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
microsoftgraph/msgraph-sdk-python#1557 ·
-
status:waiting-for-triage type:bug
Difficulté 3/5 1-2 jours Accessibilité débutants 55/100
microsoftgraph/msgraph-sdk-python#1556 · 1 commentaire · 1 réaction ·
Toutes les issues de microsoftgraph/msgraph-sdk-python
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
zostera/django-bootstrap4#894 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
use-agent-os/agent-os#3276 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
NousResearch/hermes-agent#117848 ·