Skip to content

Commit

Permalink
Added and returning .
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed Nov 14, 2024
1 parent 43537b8 commit 96cd1e2
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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))
- Added `_common.mapping:IcuCollationKeywordProperty` ([#666](https://github.com/opensearch-project/opensearch-api-specification/pull/666))
- Added `GET` and `HEAD /{index}/_source/{id}` returning `404` ([#](https://github.com/opensearch-project/opensearch-api-specification/pull/))

### 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))
Expand Down
12 changes: 12 additions & 0 deletions spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2047,6 +2047,8 @@ paths:
responses:
'200':
$ref: '#/components/responses/get_source@200'
'404':
$ref: '#/components/responses/get_source@404'
head:
operationId: exists_source.0
x-operation-group: exists_source
Expand All @@ -2069,6 +2071,8 @@ paths:
responses:
'200':
$ref: '#/components/responses/exists_source@200'
'404':
$ref: '#/components/responses/exists_source@404'
/{index}/_termvectors:
get:
operationId: termvectors.0
Expand Down Expand Up @@ -2913,6 +2917,9 @@ components:
exists_source@200:
content:
application/json: {}
exists_source@404:
content:
application/json: {}
explain@200:
content:
application/json:
Expand Down Expand Up @@ -3019,6 +3026,11 @@ components:
application/json:
schema:
type: object
get_source@404:
content:
application/json:
schema:
$ref: '../schemas/query._common.yaml#/components/schemas/ErrorResponse'
index@200:
content:
application/json:
Expand Down
52 changes: 52 additions & 0 deletions tests/default/indices/source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test retrieving a document source.
epilogues:
- path: /movies
method: DELETE
status: [200, 404]
prologues:
- path: /movies/_doc/1
method: POST
parameters:
refresh: true
request:
payload:
title: Beauty and the Beast
year: 1991
chapters:
- synopsis: Retrieve the document source.
path: /{index}/_source/{id}
method: GET
parameters:
index: movies
id: '1'
response:
status: 200
payload:
title: Beauty and the Beast
year: 1991
- synopsis: Retrieve a non-existent document source.
path: /{index}/_source/{id}
method: GET
parameters:
index: movies
id: '2'
response:
status: 404
- synopsis: Check whether the document exists.
path: /{index}/_source/{id}
method: HEAD
parameters:
index: movies
id: '1'
response:
status: 200
- synopsis: Check whether the document exists.
path: /{index}/_source/{id}
method: HEAD
parameters:
index: movies
id: '2'
response:
status: 404

0 comments on commit 96cd1e2

Please sign in to comment.