OpenSearch/modules
Julie Tibshirani 3ce7d2c9b6
Make sure to reject mappings with type _doc when include_type_name is false. (#38270)
`CreateIndexRequest#source(Map<String, Object>, ... )`, which is used when
deserializing index creation requests, accidentally accepts mappings that are
nested twice under the type key (as described in the bug report #38266).

This in turn causes us to be too lenient in parsing typeless mappings. In
particular, we accept the following index creation request, even though it
should not contain the type key `_doc`:

```
PUT index?include_type_name=false
{
  "mappings": {
    "_doc": {
      "properties": { ... }
    }
  }
}
```

There is a similar issue for both 'put templates' and 'put mappings' requests
as well.

This PR makes the minimal changes to detect and reject these typed mappings in
requests. It does not address #38266 generally, or attempt a larger refactor
around types in these server-side requests, as I think this should be done at a
later time.
2019-02-05 10:52:32 -08:00
..
aggs-matrix-stats Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
analysis-common Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
ingest-common Mute DateProcessorTests#testJodaPatternLocale (#38265) 2019-02-03 19:52:53 +01:00
ingest-geoip Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
ingest-user-agent Ingest node - user agent, move device to an object (#38115) 2019-01-31 13:54:34 -06:00
lang-expression Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
lang-mustache Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
lang-painless Make sure to reject mappings with type _doc when include_type_name is false. (#38270) 2019-02-05 10:52:32 -08:00
mapper-extras Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
parent-join Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
percolator Default include_type_name to false in the yml test harness. (#38058) 2019-02-01 11:44:13 -08:00
rank-eval Rename no-master-block setting (#38350) 2019-02-05 08:47:56 +00:00
reindex Make sure to reject mappings with type _doc when include_type_name is false. (#38270) 2019-02-05 10:52:32 -08:00
repository-url Removes typed calls from YAML REST tests (#37611) 2019-01-30 16:32:58 +00:00
transport-netty4 Remove DiscoveryPlugin#getDiscoveryTypes (#38414) 2019-02-05 17:42:24 +00:00
build.gradle Painless: Add spi jar that will be published for extending whitelists (#28302) 2018-01-18 19:16:26 -08:00