### Description

For a query with params like `"params": [{"x": 1}, {"y": 2}]` running in a JVM with assertions disabled results in:

```
  "error": {
    "root_cause": [
      {
        "type": "x_content_parse_exception",
        "reason": "Failed to build [params] after last required field arrived"
      }
    ],
    "type": "x_content_parse_exception",
    "reason": "[3:19] [esql/query] failed to parse field [params]",
    "caused_by": {
      "type": "x_content_parse_exception",
      "reason": "Failed to build [params] after last required field arrived",
      "caused_by": {
        "type": "array_index_out_of_bounds_exception",
        "reason": "Index 1 out of bounds for length 0"
      }
    }
  }
```

but with assertions enabled:

```
[2023-09-07T13:03:21,434][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [runTask-0] fatal error in thread [Thread-2], exiting java.lang.AssertionError: [params] must configure at least one constructor argument. If it doesn't have any it should use ObjectParser instead of ConstructingObjectParser. This is a bug in the parser declaration.
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ConstructingObjectParser$Target.finish(ConstructingObjectParser.java:543)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ConstructingObjectParser.parse(ConstructingObjectParser.java:166)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ConstructingObjectParser.apply(ConstructingObjectParser.java:158)
┬╗      at org.elasticsearch.xpack.esql.action.EsqlQueryRequest.parseParams(EsqlQueryRequest.java:181)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.AbstractObjectParser.lambda$declareField$0(AbstractObjectParser.java:174)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ObjectParser.lambda$declareField$10(ObjectParser.java:431)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ObjectParser.parseValue(ObjectParser.java:609)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ObjectParser.parseArray(ObjectParser.java:604)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ObjectParser.parseSub(ObjectParser.java:643)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:315)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ObjectParser.parse(ObjectParser.java:259)
┬╗      at org.elasticsearch.xcontent@8.11.0-SNAPSHOT/org.elasticsearch.xcontent.ObjectParser.apply(ObjectParser.java:382)
┬╗      at org.elasticsearch.xpack.esql.action.EsqlQueryRequest.fromXContent(EsqlQueryRequest.java:144)
┬╗      at org.elasticsearch.xpack.esql.action.RestEsqlQueryAction.prepareRequest(RestEsqlQueryAction.java:45)
```
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/action/EsqlQueryRequestTests.java
.replaceAll("5326", Integer.toString(id))
            .replaceAll("2j8UKw1bRO283PMwDugNNg", localNode)
            .replaceAll("2023-07-31T15:46:32\\.328Z", DateFieldMapper.DEFAULT_DATE_TIME_FORMATTER.formatMillis(taskInfo.startTime()))
            .replaceAll("1690818392328", Long.toString(taskInfo.startTime()))
            .replaceAll("41.7ms", TimeValue.timeValueNanos(taskInfo.runningTimeNanos()).toString())
            .replaceAll("41770830", Long.toString(taskInfo.runningTimeNanos()))
            .trim();
        assertThat(json, equalTo(expected));
    }
    private static void assertParserErrorMessage(String json, String message) {
        Exception e = expectThrows(IllegalArgumentException.class, () -> parseEsqlQueryRequest(json));
        assertThat(e.getMessage(), containsString(message));
    }
    private static EsqlQueryRequest parseEsqlQueryRequest(String json) throws IOException {
        SearchModule searchModule = new SearchModule(Settings.EMPTY, Collections.emptyList());
        XContentParserConfiguration config = XContentParserConfiguration.EMPTY.withRegistry(
            new NamedXContentRegistry(searchModule.getNamedXContents())
        );
        try (XContentParser parser = XContentType.JSON.xContent().createParser(config, json)) {
            return EsqlQueryRequest.fromXContent(parser);
        }
    }
    private static QueryBuilder randomQueryBuilder() {
        return randomFrom(
            new TermQueryBuilder(randomAlphaOfLength(5), randomAlphaOfLengthBetween(1, 10)),
            new RangeQueryBuilder(randomAlphaOfLength(5)).gt(randomIntBetween(0, 1000))
        );
    }
}