Skip to content

Send the parameters the API documents - #93

Merged
ilyabrin merged 1 commit into
mainfrom
fix/api-params
Oct 7, 2026
Merged

ilyabrin merged 1 commit into
mainfrom
fix/api-params

Conversation

@ilyabrin

@ilyabrin ilyabrin commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Why

Checked against the API schema and reference, three requests did not
match. Each was silently wrong:

Method Sent Documented Effect
DeleteResource permanent=true permanently=true a permanent delete went to the trash
uploads with Overwrite X-Overwrite header overwrite=true on the link request uploading over a file failed with 409
OperationStatus operations?operation_id=ID operations/ID status of background operations

yad hits the last two: re-uploading a file, and following a move.

What

  • DeleteResource sends permanently.
  • New GetLinkForUploadWithOverwrite; the upload helpers use it, and
    the X-Overwrite header is gone. GetLinkForUpload is unchanged.
  • OperationStatus puts the ID in the path.

Checked locally

Tests for each; they fail on the old code. go vet, go test ./... (also
as 386), golangci-lint v2.13.2.

Three requests did not match the API reference:

- DeleteResource sent permanent=true, which the API ignores, so a
  permanent delete went to the trash. It now sends permanently.
- Uploads asked for overwrite with an X-Overwrite header the API does
  not know, so uploading over an existing file failed with 409. The
  upload link request now carries overwrite, through the new
  GetLinkForUploadWithOverwrite.
- OperationStatus asked for operations?operation_id=, while the
  operation ID belongs in the path: operations/{id}.
@ilyabrin
ilyabrin merged commit ba2451f into main Oct 7, 2026
13 checks passed
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