Inconsistent data type with Conflict in context_info
When I attempt to upload a file with the same name in the same folder and run into a naming collision, I have code that accounts for the Box Exception with code: "item_name_in_use". I expect the JSON object to have an array of conflicts inside context_info as per the documentatin. However, sometimes conflicts is an object instead of an array, breaking my deserilaization process. Example:
When calling await client.FilesManager.UploadAsync(foo, bar, baz)
I receive this error:
{
"type": "error",
"status": 409,
"code": "item_name_in_use",
"context_info": {
"conflicts": {
"type": "file",
"id": "12345",
"file_version": {
"type": "file_version",
"id": "1234",
"sha1": "1234"
},
"sequence_id": "5",
"etag": "5",
"sha1": "1234",
"name": "someFile.pdf"
}
},
"help_url": "http://developers.box.com/docs/#errors",
"message": "Item with the same name already exists",
"request_id": "kkvynxh2yz2hd2q1"
}
Why is conflicts sometimes an array and sometimes an object?
Post is closed for comments.
Comments
0 comments