Skip to content

Add DELETE /v2.2/files/{id} to OpenAPI v2.2 - #46

Merged
rferreira merged 1 commit into
mainfrom
rferreira-openapi-delete-result
Aug 29, 2026
Merged

rferreira merged 1 commit into
mainfrom
rferreira-openapi-delete-result

Conversation

@rferreira

@rferreira rferreira commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • align the v2.2 OpenAPI spec with API
  • add DELETE /v2.2/files/{id} with operationId: deleteFile
  • document hard delete semantics for the processing result and associated trace
  • model responses as 204 No Content and 401 Bad credentials

Validation

  • vacuum lint -d --no-style src/v22.yaml
  • npx --yes @openapitools/openapi-generator-cli validate --recommend -i src/v22.yaml

Aligns OpenAPI v2.2 with jackfruit PR #1556 by documenting hard deletion of a processing result and associated trace, with 204/401 responses and no modeled 401 body for this route.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@rferreira
rferreira merged commit 47f2e85 into main Aug 29, 2026
2 checks passed
@rferreira
rferreira deleted the rferreira-openapi-delete-result branch August 29, 2026 14:23
rferreira added a commit to scanii/scanii-php that referenced this pull request Aug 31, 2026
….0) (#142)

* feat: add delete and deleteTrace for split result/trace deletion (6.4.0)

Propagates the openapi v2.2 delete endpoints (scanii/openapi#46, #48) to
scanii-php, following the naming locked by scanii-java and the translation
pattern already shipped in dotnet 7.3.x, go 2.3.0, node 1.5.0 and rust 1.4.0.

- Add ScaniiClient::delete(string $id): void — DELETE /v2.2/files/{id};
  removes the processing result only, leaving the trace readable
- Add ScaniiClient::deleteTrace(string $id): void — DELETE /v2.2/files/{id}/trace;
  removes the trace only, leaving the result readable
- Both throw ScaniiException on 404 (also returned by a repeated delete of the
  same id) and ScaniiAuthException on 401/403, via the existing throwForStatus
- void return matches the existing deleteAuthToken precedent in this SDK rather
  than Java's boolean, which encodes nothing a thrown error does not already
- README: API table rows grouped with the other /files methods, plus a note that
  the two deletes are independent
- ScaniiClient::VERSION -> 6.4.0; no composer.json version field — Packagist
  reads from git tags

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

* refactor: return bool from delete and deleteTrace to match Java

Mirrors scanii-java's `boolean delete(String)` / `boolean deleteTrace(String)`
rather than following this SDK's local `deleteAuthToken(): void` precedent.
The Java reference wins per CLAUDE.md §6 — return types do not diverge from it.

As in Java, the value is always true; any non-204 throws before the return.
Both integration tests now assert it.

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
rferreira added a commit to scanii/scanii-python that referenced this pull request Aug 31, 2026
* feat: add delete and delete_trace for split result/trace deletion (1.1.0)

Propagates the openapi v2.2 delete endpoints (scanii/openapi#46, superseded by
#48) to scanii-python, following the naming locked by scanii-java and the
translation pattern shipped in dotnet 7.3.x, go 2.3.0, node 1.5.0, rust 1.4.0
and php 6.4.0.

- ScaniiClient.delete(id) -> bool — DELETE /v2.2/files/{id}; removes the
  processing result only, leaving the trace readable
- ScaniiClient.delete_trace(id) -> bool — DELETE /v2.2/files/{id}/trace;
  removes the trace only, leaving the result readable
- bool return mirrors scanii-java and this SDK's existing delete_auth_token
- Both raise ScaniiError on 404 (also returned by a repeated delete of the same
  id) and ScaniiAuthError on 401/403, via the existing _raise_for_status
- Version 1.0.1 -> 1.1.0 in pyproject.toml and src/scanii/_version.py (kept in
  sync per CLAUDE.md §6)

Tests: 6 integration tests hard-asserting the split semantics against
scanii-cli, plus 9 unit tests covering verb, path, id url-encoding, and the
403/404 error mapping.

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

* docs: drop the "v2.2 preview" designation from retrieve_trace and process_from_url

The v2.2 spec only ever marked GET /files/{id}/trace as preview — the
`location` parameter behind process_from_url was listed as a plain 2.2
feature, so labelling it preview was drift introduced during the v2.2
propagation. The trace endpoint's preview marking is being dropped from the
contract as well (openapi v22.yaml), so neither method carries it now.

Docs only — no behavior, signature or return-type change.

- Removed the preview paragraph from retrieve_trace() and process_from_url()
  docstrings and from the ScaniiTraceResult model docstring
- Folded the README's "v2.2 preview methods" section into the file-scanning
  table; both methods are now ordinary rows
- Historical CHANGELOG entries left as-is; 1.1.0 records the change

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
rferreira added a commit to scanii/scanii-ruby that referenced this pull request Aug 31, 2026
* feat: add delete and delete_trace; drop preview language (1.4.0)

Final leg of the delete fan-out. Propagates the openapi v2.2 delete endpoints
(scanii/openapi#46, superseded by #48), following the naming locked by
scanii-java and the pattern shipped in dotnet, go, node, rust, php and python.

- Scanii::Client#delete(id) — DELETE /v2.2/files/{id}; removes the processing
  result only, leaving the trace readable
- Scanii::Client#delete_trace(id) — DELETE /v2.2/files/{id}/trace; removes the
  trace only, leaving the result readable
- Both return true on 204, matching #delete_auth_token and Java's boolean, and
  raise Scanii::Error on 404 / Scanii::AuthError on 401,403 via raise_for_status

Also drops the "v2.2 preview" designation from retrieve_trace and
process_from_url (README, RDoc, TraceResult, test section comments). The spec
only ever marked the trace GET as preview, and that marking has now been
removed from the contract itself (scanii/openapi#49). Docs only — no behavior
change. Historical CHANGELOG entries left intact.

VERSION 1.3.1 -> 1.4.0.

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

* fix: encode path segments with encode_uri_component, not the form encoder

Not part of the delete work — separated so it can be dropped independently.

url_encode fed every id-taking method through URI.encode_www_form_component,
which renders a space as "+". That is correct for a form body and wrong in a
path, where "+" is a literal plus: delete("a b") requested /files/a+b, so the
server would look up the id "a+b". URI.encode_uri_component gives %20.

Surfaced by a url-encoding assertion added for #delete. Affects retrieve,
retrieve_trace, delete, delete_trace, retrieve_auth_token and delete_auth_token
equally. Not reachable with server-generated ids, which are hex.

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

---------

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