Commit 637807c
authored
Throw exception for unsupported values type in Alias (#124737)
After creating index with alias using the following request
```
PUT test-index
{
"aliases": {
"alias1": {
"is_write_index": "true"
}
}
}
```
we got the following result for get index request:
```
{
"test-index" : {
"aliases" : {
"alias1" : { }
},
"mappings" : { },
"settings" : {
...
}
}
}
```
The `is_write_index` field is missing because string boolean value is
not supported for this filed and `no warning message showed`, which will
mislead the users. In #120453 I open a PR to let the createIndex API
support string boolean values for `is_write_index` field, but @dakrone
think it's better to be strict about boolean values. So I open this PR
to let the Alias class throw exception for the unsupport value type to
avoid the slience swallowing of this case.1 parent 0700b24 commit 637807c
File tree
4 files changed
+66
-1
lines changed- docs/changelog
- rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.create
- server/src/main/java/org/elasticsearch
- action/admin/indices/alias
- index
4 files changed
+66
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
89 | 121 | | |
90 | 122 | | |
91 | 123 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
260 | 270 | | |
261 | 271 | | |
262 | 272 | | |
263 | 273 | | |
264 | 274 | | |
265 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
266 | 286 | | |
267 | 287 | | |
268 | 288 | | |
| |||
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
31 | 39 | | |
32 | 40 | | |
0 commit comments