We should send content-type: application/json
on all requests beginning in 5.3. We need to confirm that this works as expected for bulk endpoints, which ES should accept even though they are not technically json. Starting in 6.0, this will be required, but 5.3 will introduce the ability for people to turn strict checking on in Elasticsearch, so we need to have this in place by then.
/cc @jbudz @tylersmalley
Console will do text/plain on bulk: https://github.com/elastic/kibana/blob/912454a31f655615ec544b7f484eb92164ef3f0f/src/core_plugins/console/public/src/es.js#L25-L27
I haven't tested yet but I'm guessing the client does too, https://github.com/elastic/elasticsearch-js/blob/5e5aae7c5bf5a578b92ddc9170eee5027b5858c5/src/lib/serializers/json.js#L63
edit: this should be fine, https://github.com/elastic/elasticsearch/pull/22947
We need to use application/json whenever there is a request body, even for bulk endpoints. That Elasticsearch PR you linked is making it so application/json is accepted for that.
@epixa the pr he linked is making it so that application/x-ldjson
(which is what esjs sends) and application/x-ndjson
(from an updated proposal for new-line delimited json) are valid content-types for the bulk-formatted apis
Issue: https://github.com/elastic/elasticsearch/issues/22943
@jbudz @spalger Did either of you check non-console requests? We need to wrap this up
I tested 5.3 from source, this LGTM from the kibana side
Every request from Kibana 5.3 to ES 5.3 results in a warning in my /var/log/elasticsearch/CLUSTERNAME_deprecation.log file. How can I get rid of this warning?
[2017-04-04T13:58:13,302][WARN ][o.e.d.r.RestController ] The Content-Type [application/x-ldjson] has been superseded by [application/x-ndjson] in the specification and should be used instead.
@grinabms This is fixed in 5.4, but we're trying to determine how risky it would be to backport the change into 5.3.x.
Every 10 seconds a warning, logging get very noisy, is there a way to supress that?
We released a fix for this deprecation warning problem in 5.3.1
Cool stuff, 5.3.1 out already?
Yep, it was released last week
Most helpful comment
Every request from Kibana 5.3 to ES 5.3 results in a warning in my /var/log/elasticsearch/CLUSTERNAME_deprecation.log file. How can I get rid of this warning?
[2017-04-04T13:58:13,302][WARN ][o.e.d.r.RestController ] The Content-Type [application/x-ldjson] has been superseded by [application/x-ndjson] in the specification and should be used instead.