Stream: troubleshooting

Topic: โœ” Duplicate file response


view this post on Zulip Jan Range (May 17 2024 at 15:05):

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.

image.png

view this post on Zulip Jan Range (May 17 2024 at 15:06):

Also, is there a way to ensure that the response throws an error if the file already exists, instead of creating a new one?

view this post on Zulip Philip Durbin ๐Ÿš€ (May 17 2024 at 15:09):

I see what you mean:

message:
    message:

How strange. Sounds like a mistake.

view this post on Zulip Jan Range (May 17 2024 at 15:10):

Shall I open an issue?

view this post on Zulip Philip Durbin ๐Ÿš€ (May 17 2024 at 15:18):

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",

view this post on Zulip Philip Durbin ๐Ÿš€ (May 17 2024 at 15:19):

But what outcome do you want? Do you want us to change the API in a backward-incompatible way?

view this post on Zulip Philip Durbin ๐Ÿš€ (May 17 2024 at 15:19):

Or are you thinking we should clean this up if we ever release a v2 of the API?

view this post on Zulip Jan Range (May 17 2024 at 15:25):

Yes, definitely only when a V2 is released. I just noticed it and thought I'd share it.

view this post on Zulip Jan Range (May 17 2024 at 15:26):

Thought I may miss out on sth when modelling the response :smile:

view this post on Zulip Philip Durbin ๐Ÿš€ (May 17 2024 at 15:42):

I feel like we should be gathering issues like this for a v2.

view this post on Zulip Philip Durbin ๐Ÿš€ (May 17 2024 at 15:42):

I'm not sure I want an issue for each little thing though.

view this post on Zulip Philip Durbin ๐Ÿš€ (May 17 2024 at 15:43):

But for now, please go ahead and create it. More for the pile! :poop:

view this post on Zulip Notification Bot (May 23 2024 at 06:27):

Jan Range has marked this topic as resolved.


Last updated: Oct 30 2025 at 06:21 UTC