You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem including expected versus actual behavior:
Actual behavior: An (invalid) mappings update request, where dynamic_mappings is an object instead of an array, results in a http response with a 500 code.
Expected behavior: A 400 (bad request) http response code.
Steps to reproduce:
Create a new index my_index
Send the following request through Kibana's console
PUT /my_index/_mappings
{
"dynamic_templates": {}
}
Notice the 500 response:
{
"error": {
"root_cause": [
{
"type": "class_cast_exception",
"reason": "class java.util.LinkedHashMap cannot be cast to class java.util.List (java.util.LinkedHashMap and java.util.List are in module java.base of loader 'bootstrap')"
}
],
"type": "class_cast_exception",
"reason": "class java.util.LinkedHashMap cannot be cast to class java.util.List (java.util.LinkedHashMap and java.util.List are in module java.base of loader 'bootstrap')"
},
"status": 500
}
The text was updated successfully, but these errors were encountered:
Currently, a mappings update request, where dynamic_mappings is an object
instead of an array, results in a http response with a 500 code. This PR checks
for this condition and throws a MapperParsingException like we do for other
malformed mapping cases.
Closes#51486
Elasticsearch version: 7.5.2
Plugins installed: []
JVM version: (Elastic Cloud)
OS version: (Elastic Cloud)
Description of the problem including expected versus actual behavior:
Actual behavior: An (invalid) mappings update request, where
dynamic_mappings
is an object instead of an array, results in a http response with a 500 code.Expected behavior: A 400 (bad request) http response code.
Steps to reproduce:
my_index
The text was updated successfully, but these errors were encountered: