-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Fix msearch request parsing when index expression is null #130776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hi @smalyshev, I've created a changelog YAML for you. |
Pinging @elastic/es-core-infra (Team:Core/Infra) |
Pinging @elastic/es-search-foundations (Team:Search Foundations) |
@@ -537,6 +538,14 @@ public void testFailOnExtraCharacters() throws IOException { | |||
} | |||
} | |||
|
|||
public void testNullIndex() throws IOException { | |||
try { | |||
MultiSearchRequest request = parseMultiSearchRequest("/org/elasticsearch/action/search/msearch-null.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a case of personal preference, but have you considered inlining the JSON directly?
Since the request is only a couple of lines, inlining it would improve readability and make the test easier to follow at a glance, especially for a simple case like this.
Method
XContentMapValues.nodeStringArrayValue
does not check for null before trying to manipulate the value, butnull
is a legit value that can come from JSON, we should check for it.Fixes #129631