diff --git a/.github/workflows/test-spec.yml b/.github/workflows/test-spec.yml index 6395778a..05e24557 100644 --- a/.github/workflows/test-spec.yml +++ b/.github/workflows/test-spec.yml @@ -26,7 +26,7 @@ jobs: - {version: 1.3.17, admin_password: admin} - {version: 2.0.0, admin_password: admin} - {version: 2.15.0} - - {version: 2.16.0, hub: opensearchstaging, ref: '@sha256:aa99ce3e2c9c94cd934cf98bab753a9920bfdbbb74bdc932d1b443d31c18d6b2'} + - {version: 2.16.0, hub: opensearchstaging, ref: '@sha256:50fbfe3b95c41e92a113ada3e80513ba4524dfc8a25dc6aaeff2bbe1e1145d5f'} name: test-opensearch-spec (version=${{ matrix.entry.version }}, hub=${{ matrix.entry.hub || 'opensearchproject' }}) runs-on: ubuntu-latest @@ -111,4 +111,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: pr-comment - path: pr-comment.json \ No newline at end of file + path: pr-comment.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 7887cdd7..aa24870b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `concurrent_query_*` and `search_idle_reactivate_count_total` fields to `SearchStats` ([#395](https://github.com/opensearch-project/opensearch-api-specification/pull/395)) - Added `remote_store` to `TranslogStats` ([#395](https://github.com/opensearch-project/opensearch-api-specification/pull/395)) - Added `file` to `/_cache/clear` and `/{index}/_cache/clear` ([#396](https://github.com/opensearch-project/opensearch-api-specification/pull/396)) +- Add `strict_allow_templates` option for the dynamic mapping parameter ([#408](https://github.com/opensearch-project/opensearch-api-specification/pull/408)) - Added a workflow to run tests against the next version of OpenSearch ([#409](https://github.com/opensearch-project/opensearch-api-specification/pull/409)) - Added support for skipping tests using semver range ([#410](https://github.com/opensearch-project/opensearch-api-specification/pull/410)) - Added `cluster_manager_timeout` to `HEAD /{index}` ([#421](https://github.com/opensearch-project/opensearch-api-specification/pull/421)) diff --git a/spec/schemas/_common.mapping.yaml b/spec/schemas/_common.mapping.yaml index 18ef5472..cc8e8de0 100644 --- a/spec/schemas/_common.mapping.yaml +++ b/spec/schemas/_common.mapping.yaml @@ -136,8 +136,8 @@ components: type: string enum: - 'false' - - runtime - strict + - strict_allow_templates - 'true' DynamicTemplate: type: object diff --git a/tests/indices/mapping.yml b/tests/indices/mapping.yml index 4d4860f0..af2b2951 100644 --- a/tests/indices/mapping.yml +++ b/tests/indices/mapping.yml @@ -70,6 +70,7 @@ chapters: write_index_only: true request_body: payload: + dynamic: 'true' properties: producer: type: text @@ -92,4 +93,56 @@ chapters: response: status: 200 payload: - acknowledged: true \ No newline at end of file + acknowledged: true + - synopsis: Update mapping for an index with setting dynamic to false. + path: /{index}/_mapping + method: PUT + parameters: + index: movies + allow_no_indices: true + expand_wildcards: none + ignore_unavailable: true + timeout: 10s + write_index_only: true + request_body: + payload: + dynamic: 'false' + response: + status: 200 + payload: + acknowledged: true + - synopsis: Update mapping for an index with setting dynamic to strict. + path: /{index}/_mapping + method: PUT + parameters: + index: movies + allow_no_indices: true + expand_wildcards: none + ignore_unavailable: true + timeout: 10s + write_index_only: true + request_body: + payload: + dynamic: strict + response: + status: 200 + payload: + acknowledged: true + - synopsis: Update mapping for an index with setting dynamic to strict_allow_templates. + version: '>= 2.16' + path: /{index}/_mapping + method: PUT + parameters: + index: movies + allow_no_indices: true + expand_wildcards: none + ignore_unavailable: true + timeout: 10s + write_index_only: true + request_body: + payload: + dynamic: strict_allow_templates + response: + status: 200 + payload: + acknowledged: true