When uploading a file that already exists, the message property of the response contains another sub-object with message in it. Is this on purpose? It differs from all the other responses, and I was wondering if this is intentional or a bug.
Also, is there a way to ensure that the response throws an error if the file already exists, instead of creating a new one?
I see what you mean:
message:
message:
How strange. Sounds like a mistake.
Shall I open an issue?
Sure. I can reproduce it with mvn test -Dtest=FilesIT#test_001_AddFileGood if I add this: addTwiceResponse.prettyPrint(). Here's the output:
{
"status": "OK",
"message": {
"message": "This file has the same content as dataverseproject.png that is in the dataset. "
},
"data": {
"files": [
{
"description": "",
"label": "dataverseproject.png",
But what outcome do you want? Do you want us to change the API in a backward-incompatible way?
Or are you thinking we should clean this up if we ever release a v2 of the API?
Yes, definitely only when a V2 is released. I just noticed it and thought I'd share it.
Thought I may miss out on sth when modelling the response :smile:
I feel like we should be gathering issues like this for a v2.
I'm not sure I want an issue for each little thing though.
But for now, please go ahead and create it. More for the pile! :poop:
Jan Range has marked this topic as resolved.
Last updated: Oct 30 2025 at 06:21 UTC