From dafa820851dbd0465e76a7e81235ac87ba2a4314 Mon Sep 17 00:00:00 2001 From: immanuwell Date: Sun, 31 May 2026 19:36:52 +0400 Subject: [PATCH] fix: align update operation delete api Signed-off-by: immanuwell --- Documentation/reference/api.md | 25 ++++++++----------------- httptransport/api/v1/openapi.etag | 2 +- httptransport/api/v1/openapi.jq | 20 +++++++++++++++++--- httptransport/api/v1/openapi.json | 23 ++++++++++++++--------- httptransport/api/v1/openapi.yaml | 17 +++++++++++------ httptransport/matcher_v1.go | 6 +++--- httptransport/matcher_v1_test.go | 26 ++++++++++++++++++++++++++ 7 files changed, 80 insertions(+), 39 deletions(-) diff --git a/Documentation/reference/api.md b/Documentation/reference/api.md index 986fca82f0..10e2233d2d 100644 --- a/Documentation/reference/api.md +++ b/Documentation/reference/api.md @@ -1359,9 +1359,9 @@ headers = { 'Accept': 'application/vnd.clair.error.v1+json' } -r = requests.delete('/matcher/api/v1/internal/update_operation/{digest}', headers = headers) +r = requests.delete('/matcher/api/v1/internal/update_operation/{id}', headers = headers) -print(r.json()) +print(r.status_code) ``` @@ -1380,7 +1380,7 @@ func main() { } data := bytes.NewBuffer([]byte{jsonReq}) - req, err := http.NewRequest("DELETE", "/matcher/api/v1/internal/update_operation/{digest}", data) + req, err := http.NewRequest("DELETE", "/matcher/api/v1/internal/update_operation/{id}", data) req.Header = headers client := &http.Client{} @@ -1396,21 +1396,19 @@ const headers = { 'Accept':'application/vnd.clair.error.v1+json' }; -fetch('/matcher/api/v1/internal/update_operation/{digest}', +fetch('/matcher/api/v1/internal/update_operation/{id}', { method: 'DELETE', headers: headers }) .then(function(res) { - return res.json(); -}).then(function(body) { - console.log(body); + console.log(res.status); }); ``` -`DELETE /matcher/api/v1/internal/update_operation/{digest}` +`DELETE /matcher/api/v1/internal/update_operation/{id}` Issues a delete of the provided Update Operation ID and all associated data. After this delete clients will no longer be able to generate a diff against this Update Operation. @@ -1419,7 +1417,7 @@ After this delete clients will no longer be able to generate a diff against this |Name|In|Type|Required|Description| |---|---|---|---|---| -|digest|path|[digest](#schemadigest)|true|OCI-compatible digest of a referred object.| +|id|path|string(uuid)|true|UUID of the update operation to delete.| > Example responses @@ -1436,17 +1434,11 @@ After this delete clients will no longer be able to generate a diff against this |Status|Meaning|Description|Schema| |---|---|---|---| -|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|Success|None| +|204|[No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5)|Success|None| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|Bad Request|[error](#schemaerror)| |415|[Unsupported Media Type](https://tools.ietf.org/html/rfc7231#section-6.5.13)|Unsupported Media Type|[error](#schemaerror)| |default|Default|Internal Server Error|[error](#schemaerror)| -### Response Headers - -|Status|Header|Type|Format|Description| -|---|---|---|---|---| -|200|Clair-Error|string||This is a trailer containing any errors encountered while writing the response.| -