-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API delete will not return object not found #4886
Conversation
On the following cases the API will not return NotFound error: - when tombstone found on stage - when object not found on branch commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This looks great, but I would like it to go much further! I want us to remove the 404 response entirely. Currently swagger.yml makes me think that I could synchronize multiple workers on 200-vs-404s, but in fact this is not true! 404 is not programmatically usable in the API.
We require 404 for repository and branch not found |
Co-authored-by: Ariel Shaqed (Scolnicov) <ariels@treeverse.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I think we can try to improve the API documentation, and made some suggestions.
In any case it's a really useful change: as someone coding against it, an API that precisely describes what it does is really important to me.
@@ -3094,7 +3094,7 @@ paths: | |||
tags: | |||
- objects | |||
operationId: deleteObject | |||
summary: delete object | |||
summary: delete object. Missing objects will not return a NotFound error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
summary: delete object. Missing objects will not return a NotFound error. | |
summary: delete object. |
I believe that this belongs on the descriptions of 204 and of 404, and in a positive not a negative.
404:
description: Repository or branch do not exist.
$ref: "#/components/responses/NotFound"
(The same for deleteObjects, of course!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried this one first. The description is part of the definition. Set it also on the status code - the code generators just ignore it.
@@ -3094,7 +3094,7 @@ paths: | |||
tags: | |||
- objects | |||
operationId: deleteObject | |||
summary: delete object | |||
summary: delete object. Missing objects will not return a NotFound error. | |||
responses: | |||
204: | |||
description: object deleted successfully |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: object deleted successfully | |
description: Success: Now there is no object at key. Also returned if the object did not exist in the first place. |
Change in API
delete object
The delete object(s) APIs will no longer return "not found" status code when object doesn't exists (similar to S3 behaviour).
The API will not return NotFound errors in the following cases:
Fix #4798