diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 2e1aeb6cb..9ef05d81b 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -1220,6 +1220,8 @@ paths: responses: '200': $ref: '#/components/responses/index@200' + '201': + $ref: '#/components/responses/index@200' /{index}/_doc/{id}: get: operationId: get.0 @@ -1293,6 +1295,8 @@ paths: responses: '200': $ref: '#/components/responses/index@200' + '201': + $ref: '#/components/responses/index@200' put: operationId: index.2 x-operation-group: index diff --git a/tests/_core/index/_doc.yaml b/tests/_core/index/_doc.yaml new file mode 100644 index 000000000..6b21f687b --- /dev/null +++ b/tests/_core/index/_doc.yaml @@ -0,0 +1,49 @@ +$schema: ../../../json_schemas/test_story.schema.yaml + +skip: false +description: Test inserting and retrieving a doc. +epilogues: + - path: /movies + method: DELETE + status: [200, 404] +chapters: + - synopsis: Create a document. + path: /{index}/_doc/{id} + method: POST + parameters: + index: movies + id: '1' + request_body: + payload: + title: Beauty and the Beast + year: 1991 + response: + status: 201 + - synopsis: Update a document. + path: /{index}/_doc/{id} + method: PUT + parameters: + index: movies + id: '1' + request_body: + payload: + title: Beauty and the Beast (Updated) + year: 1991 + response: + status: 200 + - synopsis: Retrieve a document. + path: /{index}/_doc/{id} + method: GET + parameters: + index: movies + id: '1' + response: + status: 200 + - synopsis: Delete a document. + path: /{index}/_doc/{id} + method: DELETE + parameters: + index: movies + id: '1' + response: + status: 200