OpenSearch/client
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
..
benchmark Converting randomized testing to create a separate unitTest task instead of replacing the builtin test task (#36311) 2018-12-19 08:25:20 +02:00
client-benchmark-noop-api-plugin Type removal - added deprecation warnings to _bulk apis (#36549) 2019-01-10 21:35:19 +00:00
rest Use stricter timer in DeadHostStateTests (#38301) 2019-02-04 15:03:31 +01:00
rest-high-level Make sure to reject mappings with type _doc when include_type_name is false. (#38270) 2019-02-05 10:52:32 -08:00
sniffer Update httpclient for JDK 11 TLS engine (#37994) 2019-01-30 14:24:29 -07:00
test Testing conventions now checks for tests in main (#37321) 2019-01-24 17:30:50 +02:00
transport Testing conventions now checks for tests in main (#37321) 2019-01-24 17:30:50 +02:00