diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 0ef3a16a6..0089f7be4 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -1264,6 +1264,8 @@ paths: responses: '200': $ref: '#/components/responses/get@200' + '404': + $ref: '#/components/responses/get@200' head: operationId: exists.0 x-operation-group: exists @@ -1364,6 +1366,8 @@ paths: responses: '200': $ref: '#/components/responses/delete@200' + '404': + $ref: '#/components/responses/delete@200' /{index}/_explain/{id}: get: operationId: explain.0 diff --git a/spec/namespaces/indices.yaml b/spec/namespaces/indices.yaml index dcd758619..ad4a4c8dd 100644 --- a/spec/namespaces/indices.yaml +++ b/spec/namespaces/indices.yaml @@ -1044,6 +1044,8 @@ paths: responses: '200': $ref: '#/components/responses/indices.delete@200' + '404': + $ref: '#/components/responses/indices.delete@404' /{index}/_alias: get: operationId: indices.get_alias.2 @@ -2400,6 +2402,11 @@ components: application/json: schema: $ref: '../schemas/_common.yaml#/components/schemas/IndicesResponseBase' + indices.delete@404: + content: + application/json: + schema: + $ref: '../schemas/indices._common.yaml#/components/schemas/IndexErrorCause' indices.delete_alias@200: content: application/json: diff --git a/spec/schemas/_common.yaml b/spec/schemas/_common.yaml index 889c8b014..e2105f8df 100644 --- a/spec/schemas/_common.yaml +++ b/spec/schemas/_common.yaml @@ -2238,3 +2238,7 @@ components: required: - reason - status + ResourceType: + type: string + enum: + - index_or_alias diff --git a/spec/schemas/indices._common.yaml b/spec/schemas/indices._common.yaml index 90d6776d6..6d5ec90bb 100644 --- a/spec/schemas/indices._common.yaml +++ b/spec/schemas/indices._common.yaml @@ -1010,3 +1010,29 @@ components: - mappings - order - settings + IndexErrorCause: + type: object + properties: + type: + description: The type of error + type: string + reason: + description: A human-readable explanation of the error, in english + type: string + root_cause: + type: array + items: + $ref: '#/components/schemas/IndexErrorCause' + index: + $ref: '_common.yaml#/components/schemas/IndexName' + index_uuid: + $ref: '_common.yaml#/components/schemas/Uuid' + resource.id: + $ref: '_common.yaml#/components/schemas/IndexName' + resource.type: + $ref: '_common.yaml#/components/schemas/ResourceType' + required: + - type + additionalProperties: + title: metadata + description: Additional details about the error. diff --git a/tests/default/indices/doc.yaml b/tests/default/indices/doc.yaml index 6eb5a8a5d..cffe8ff21 100644 --- a/tests/default/indices/doc.yaml +++ b/tests/default/indices/doc.yaml @@ -57,3 +57,19 @@ chapters: id: '1' response: status: 200 + - synopsis: Retrieve a non existing document. + path: /{index}/_doc/{id} + method: GET + parameters: + index: movies + id: '1' + response: + status: 404 + - synopsis: Delete a non existing document. + path: /{index}/_doc/{id} + method: DELETE + parameters: + index: movies + id: '1' + response: + status: 404 diff --git a/tests/default/indices/index.yaml b/tests/default/indices/index.yaml index 4b34c8937..1564db477 100644 --- a/tests/default/indices/index.yaml +++ b/tests/default/indices/index.yaml @@ -84,4 +84,12 @@ chapters: version: '>= 2.0' parameters: index: books,games - cluster_manager_timeout: 10s + cluster_manager_timeout: 10s + + - synopsis: Delete non existing index `movies`. + path: /{index} + method: DELETE + parameters: + index: movies + response: + status: 404