From a84cb99e68effa87f382881ec5372b4da9d9c174 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 13 Nov 2024 14:54:05 -0500 Subject: [PATCH] Added HEAD /{index}/_doc/{id} 404 response. (#670) Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/namespaces/_core.yaml | 5 +++++ tests/default/indices/doc.yaml | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d24b75f3f..886986786 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added verbose output of the story being evaluated ([#646](https://github.com/opensearch-project/opensearch-api-specification/pull/646)) - Added `_search` with `sort: direction` ([#658](https://github.com/opensearch-project/opensearch-api-specification/pull/658)) - Added `_common.mapping:FlatObjectProperty` ([#661](https://github.com/opensearch-project/opensearch-api-specification/pull/661)) +- Added `HEAD /{index}/_doc/{id}` returning `404` ([#670](https://github.com/opensearch-project/opensearch-api-specification/pull/670)) ### Removed - Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652)) diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index fafc809b3..542d55bf2 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -1393,6 +1393,8 @@ paths: responses: '200': $ref: '#/components/responses/exists@200' + '404': + $ref: '#/components/responses/exists@404' post: operationId: index.1 x-operation-group: index @@ -2905,6 +2907,9 @@ components: exists@200: content: application/json: {} + exists@404: + content: + application/json: {} exists_source@200: content: application/json: {} diff --git a/tests/default/indices/doc.yaml b/tests/default/indices/doc.yaml index 5396a52bf..714c773d4 100644 --- a/tests/default/indices/doc.yaml +++ b/tests/default/indices/doc.yaml @@ -49,6 +49,14 @@ chapters: id: '1' response: status: 200 + - synopsis: Check whether a document exists. + path: /{index}/_doc/{id} + method: HEAD + parameters: + index: movies + id: '1' + response: + status: 200 - synopsis: Delete a document. path: /{index}/_doc/{id} method: DELETE @@ -65,6 +73,14 @@ chapters: id: '1' response: status: 404 + - synopsis: Check whether a nonexistent document exists. + path: /{index}/_doc/{id} + method: HEAD + parameters: + index: movies + id: '1' + response: + status: 404 - synopsis: Delete a nonexistent document. path: /{index}/_doc/{id} method: DELETE