Skip to content

Commit 30f1846

Browse files
authored
Fix: cluster settings can be flat. (#545)
Signed-off-by: dblock <[email protected]>
1 parent 3f806a1 commit 30f1846

File tree

3 files changed

+48
-6
lines changed

3 files changed

+48
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
133133
- Fixed query DSL `neural` field `query_image` set `contentEncoding` and `model_id` as optional ([#512](https://github.com/opensearch-project/opensearch-api-specification/pull/512))
134134
- Fixed `knn` query specification ([#538](https://github.com/opensearch-project/opensearch-api-specification/pull/538))
135135
- Fixed content-type for `/hot_threads` ([#543](https://github.com/opensearch-project/opensearch-api-specification/pull/543))
136+
- Fixed `/_cluster/settings` returning flat results ([#545](https://github.com/opensearch-project/opensearch-api-specification/pull/545))
136137

137138
### Security
138139

spec/namespaces/cluster.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -634,16 +634,13 @@ components:
634634
properties:
635635
persistent:
636636
type: object
637-
additionalProperties:
638-
type: object
637+
additionalProperties: true
639638
transient:
640639
type: object
641-
additionalProperties:
642-
type: object
640+
additionalProperties: true
643641
defaults:
644642
type: object
645-
additionalProperties:
646-
type: object
643+
additionalProperties: true
647644
required:
648645
- persistent
649646
- transient

tests/default/cluster/settings.yaml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
$schema: ../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test cluster settings.
4+
chapters:
5+
- synopsis: Returns cluster settings.
6+
path: /_cluster/settings
7+
method: GET
8+
parameters:
9+
flat_settings: false
10+
response:
11+
status: 200
12+
- synopsis: Returns cluster settings with defaults.
13+
path: /_cluster/settings
14+
method: GET
15+
parameters:
16+
include_defaults: true
17+
response:
18+
status: 200
19+
- synopsis: Returns cluster flat settings.
20+
path: /_cluster/settings
21+
method: GET
22+
parameters:
23+
flat_settings: true
24+
response:
25+
status: 200
26+
- synopsis: Sets cluster settings.
27+
path: /_cluster/settings
28+
method: PUT
29+
request:
30+
payload:
31+
transient:
32+
cluster:
33+
max_shards_per_node: 500
34+
response:
35+
status: 200
36+
- synopsis: Sets cluster flat settings.
37+
path: /_cluster/settings
38+
method: PUT
39+
request:
40+
payload:
41+
transient:
42+
cluster.max_shards_per_node: 500
43+
response:
44+
status: 200

0 commit comments

Comments
 (0)