Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes and tests. #673

Merged
merged 6 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added and returning .
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Nov 18, 2024
commit d102f52593ae458c88c2c26e9bd435bebae49769
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added `/_cluster/stats/{metric}/nodes/{node_id}` and `/_cluster/stats/{metric}/{index_metric}/nodes/{node_id}` ([#639](https://github.com/opensearch-project/opensearch-api-specification/pull/639))
- Added `PhoneAnalyzer` from `analysis-phonenumber` plugin ([#609](https://github.com/opensearch-project/opensearch-api-specification/pull/609))
- Added `/_list/indices` & `/_list/shards` api specs ([#613](https://github.com/opensearch-project/opensearch-api-specification/pull/613))
- Added `GET` and `HEAD /{index}/_source/{id}` returning `404` ([#673](https://github.com/opensearch-project/opensearch-api-specification/pull/673))

### 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