Skip to content

Commit 59a7ff4

Browse files
authoredAug 4, 2024··
Added support for request headers. (#461)
* Renamed request_body to request. Signed-off-by: dblock <dblock@amazon.com> * Added npm run generate-types. Signed-off-by: dblock <dblock@amazon.com> * Added support for request headers. Signed-off-by: dblock <dblock@amazon.com> --------- Signed-off-by: dblock <dblock@amazon.com>
1 parent ac8659d commit 59a7ff4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+335
-209
lines changed
 

‎CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,14 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
5454
- Added `plugins` to NodeInfoSettings ([#442](https://github.com/opensearch-project/opensearch-api-specification/pull/442))
5555
- Added test coverage ([#443](https://github.com/opensearch-project/opensearch-api-specification/pull/443))
5656
- Added `--opensearch-version` to `merger` that excludes schema elements per semver ([#428](https://github.com/opensearch-project/opensearch-api-specification/pull/428))
57-
- Added `retry` to `tester` to support asynchronous tasks ([453](https://github.com/opensearch-project/opensearch-api-specification/pull/453))
57+
- Added `retry` to `tester` to support asynchronous tasks ([#453](https://github.com/opensearch-project/opensearch-api-specification/pull/453))
5858
- Added passing OPENSEARCH_JAVA_OPTS into the docker container used for tests ([#454](https://github.com/opensearch-project/opensearch-api-specification/pull/454))
5959
- Added a warning on mulitple paths being tested in the same file ([#452](https://github.com/opensearch-project/opensearch-api-specification/pull/452))
6060
- Added validation of titles and descriptions in info and schema objects ([#463](https://github.com/opensearch-project/opensearch-api-specification/pull/463))
6161
- Added `/_plugins/_query/settings` ([#456](https://github.com/opensearch-project/opensearch-api-specification/pull/456))
6262
- Added `/_plugins/_ppl`, `explain` and `stats` ([#460](https://github.com/opensearch-project/opensearch-api-specification/pull/460))
6363
- Added tests against OpenSearch 3.0 ([#459](https://github.com/opensearch-project/opensearch-api-specification/pull/459))
64+
- Added support for request headers in tests [#461](https://github.com/opensearch-project/opensearch-api-specification/pull/461)
6465

6566
### Changed
6667

‎TESTING_GUIDE.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,12 @@ chapters:
7575
- synopsis: Create an index named `books` with mappings and settings.
7676
path: /{index} # The test will fail if "PUT /{index}" operation is not found in the spec.
7777
method: PUT
78-
parameters: # All parameters are validated against their schemas in the spec
78+
parameters: # All parameters are validated against their schemas in the spec.
7979
index: books
80-
request_body: # The request body is validated against the schema of the requestBody in the spec
81-
payload:
80+
request: # The request.
81+
headers: # Optional headers.
82+
user-agent: OpenSearch API Spec/1.0
83+
payload: # The request body is validated against the schema of the requestBody in the spec.
8284
mappings:
8385
properties:
8486
name:
@@ -88,7 +90,8 @@ chapters:
8890
settings:
8991
number_of_shards: 5
9092
number_of_replicas: 2
91-
response: # The response body is validated against the schema of the corresponding response in the spec
93+
response: # The response.
94+
payload: # Matching response payload. The entire payload is validated against the schema of the corresponding response in the spec.
9295
status: 200 # This is the expected status code of the response. Any other status code will fail the test.
9396
9497
- synopsis: Retrieve the mappings and settings of the `books` index.
@@ -113,7 +116,7 @@ Consider the following chapters in [ml/model_groups](tests/ml/model_groups.yaml)
113116
id: create_model_group # Only needed if you want to refer to this chapter in another chapter.
114117
path: /_plugins/_ml/model_groups/_register
115118
method: POST
116-
request_body:
119+
request:
117120
payload:
118121
name: NLP_Group
119122
description: Model group for NLP models.

0 commit comments

Comments
 (0)
Please sign in to comment.