Closed
Description
Describe the bug
There is a bug in the PUT _alias/{alias}
API that does not validate the fields inside the payload when adding/removing backing indices. While this results in a no-op, ideally an exception should be thrown and an incorrect payload should not be rejected.
Related component
Indexing
To Reproduce
- Create a new index
- Create an alias with this index as a backing index and supply an incorrect field inside the
add
block - The service won't throw an error
Example:
PUT index-1
PUT _alias/alias-1
{
"actions": [
{
"add": {
"index": "index-1",
"alias": "alias-1",
"abcd": true
}
}
]
}
The response (unexpected) is the following:
{
"acknowledged": true
}
Expected behavior
The service should throw an error in the above mentioned scenario as abcd
is not a recognized field.
Additional Details
Plugins
NA
Screenshots
NA
Host/Environment (please complete the following information):
NA
Additional context
Sample attached above