Skip to content

Correct the DELETE /v2.2/files/{id} contract - #47

Closed
rferreira wants to merge 1 commit into
mainfrom
raf/delete-file-contract
Closed

rferreira wants to merge 1 commit into
mainfrom
raf/delete-file-contract

Conversation

@rferreira

@rferreira rferreira commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Superseded by #48 — see that PR for the full contract.

Corrected the DELETE /v2.2/files/{id} documentation: the 401 carries an ErrorResponse body (the authentication entry point returns one regardless of method), and the operation answers 403 when the credentials are not privileged enough to delete, and 404 when there was nothing to delete.

Taken from the springdoc output of jackfruit#1560, which changes the endpoint
the spec was written against:

* 403 - the delete now requires an api key. A temporary auth token carries
  ROLE_USER and authenticates as the key that minted it, so it was able to
  erase every result filed under that key
* 404 - the delete reports whether anything was there. S3 answers the delete of
  a missing key as a success, so the old blanket 204 could not tell a caller
  that it had erased nothing. A repeated delete of the same id returns 404 too
* 401 - carries an ErrorResponse body, which it always did: the entry point
  writes one regardless of method

Also drops "hard" from the summary, which described the implementation rather
than the contract.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rferreira

rferreira commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #48. The result and trace deletes are now separate operations, so the cascade this PR documents stops being true — #48 carries the full contract, including everything here. Closing this one in favour of a single publish.

@rferreira rferreira closed this Aug 30, 2026
rferreira added a commit that referenced this pull request Aug 30, 2026
The result and its trace are separate resources - separate readers, each with
its own 404 - so deleting one no longer removes the other, and supersedes #47,
whose wording describes a cascade that is no longer how the API behaves.

* adds DELETE /v2.2/files/{id}/trace, which removes the trace alone
* DELETE /v2.2/files/{id} removes the result alone, and its description says so
  outright - a customer deleting a result must not assume the findings went with
  it, since they stay readable at the trace endpoint until deleted there
* both carry the 403 and 404 that #47 introduced, and the ErrorResponse body on
  the 401 that was always being returned

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@rferreira
rferreira deleted the raf/delete-file-contract branch August 30, 2026 14:03
rferreira added a commit that referenced this pull request Aug 30, 2026
The result and its trace are separate resources - separate readers, each with
its own 404 - so deleting one no longer removes the other, and supersedes #47,
whose wording describes a cascade that is no longer how the API behaves.

* adds DELETE /v2.2/files/{id}/trace, which removes the trace alone
* DELETE /v2.2/files/{id} removes the result alone, and its description says so
  outright - a customer deleting a result must not assume the findings went with
  it, since they stay readable at the trace endpoint until deleted there
* both carry the 403 and 404 that #47 introduced, and the ErrorResponse body on
  the 401 that was always being returned

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant