From f157dae0537cdecf7ddffb42c9fbacbf3f6eb1bb Mon Sep 17 00:00:00 2001 From: Jimmy Jones Date: Wed, 9 Dec 2015 21:25:52 +0000 Subject: [PATCH] Disallow unquoted field names, fix testcases using unquoted JSON --- .../common/xcontent/json/JsonXContent.java | 2 +- .../cluster/SimpleDataNodesIT.java | 2 +- .../WriteConsistencyLevelIT.java | 6 +- .../index/query/BoolQueryBuilderTests.java | 8 +- .../recovery/SimpleRecoveryIT.java | 2 +- .../common/settings/loader/test-settings.json | 14 +-- .../multifield/merge/test-mapping1.json | 6 +- .../multifield/merge/test-mapping3.json | 8 +- .../multifield/merge/test-mapping4.json | 10 +-- .../mapper/multifield/merge/upgrade1.json | 10 +-- .../mapper/multifield/merge/upgrade2.json | 14 +-- .../mapper/multifield/merge/upgrade3.json | 10 +-- .../index/mapper/simple/test-mapping.json | 84 +++++++++--------- .../mapper/simple/test1-notype-noid.json | 40 ++++----- .../index/mapper/simple/test1-notype.json | 42 ++++----- .../index/mapper/simple/test1.json | 38 ++++---- .../elasticsearch/search/geo/gzippedmap.gz | Bin 7734 -> 7686 bytes .../migration/migrate_5_0/rest.asciidoc | 5 ++ .../rest-api-spec/test/ingest/30_mutate.yaml | 18 ++-- .../rest-api-spec/test/ingest/80_foreach.yaml | 2 +- .../test/search/70_response_filtering.yaml | 8 +- .../test/rest/test/DoSectionParserTests.java | 12 +-- 22 files changed, 173 insertions(+), 168 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java b/core/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java index ee730f10b2a..54fe6bab458 100644 --- a/core/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java +++ b/core/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java @@ -50,7 +50,7 @@ public class JsonXContent implements XContent { static { jsonFactory = new JsonFactory(); - jsonFactory.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); + jsonFactory.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, false); jsonFactory.configure(JsonGenerator.Feature.QUOTE_FIELD_NAMES, true); jsonFactory.configure(JsonParser.Feature.ALLOW_COMMENTS, true); jsonFactory.configure(JsonFactory.Feature.FAIL_ON_SYMBOL_HASH_OVERFLOW, false); // this trips on many mappings now... diff --git a/core/src/test/java/org/elasticsearch/cluster/SimpleDataNodesIT.java b/core/src/test/java/org/elasticsearch/cluster/SimpleDataNodesIT.java index 44565a269bd..46c31cf58e3 100644 --- a/core/src/test/java/org/elasticsearch/cluster/SimpleDataNodesIT.java +++ b/core/src/test/java/org/elasticsearch/cluster/SimpleDataNodesIT.java @@ -69,6 +69,6 @@ public class SimpleDataNodesIT extends ESIntegTestCase { } private String source(String id, String nameValue) { - return "{ type1 : { \"id\" : \"" + id + "\", \"name\" : \"" + nameValue + "\" } }"; + return "{ \"type1\" : { \"id\" : \"" + id + "\", \"name\" : \"" + nameValue + "\" } }"; } } diff --git a/core/src/test/java/org/elasticsearch/consistencylevel/WriteConsistencyLevelIT.java b/core/src/test/java/org/elasticsearch/consistencylevel/WriteConsistencyLevelIT.java index 46c027cb91c..aac715b6013 100644 --- a/core/src/test/java/org/elasticsearch/consistencylevel/WriteConsistencyLevelIT.java +++ b/core/src/test/java/org/elasticsearch/consistencylevel/WriteConsistencyLevelIT.java @@ -53,7 +53,7 @@ public class WriteConsistencyLevelIT extends ESIntegTestCase { fail("can't index, does not match consistency"); } catch (UnavailableShardsException e) { assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE)); - assertThat(e.getMessage(), equalTo("[test][0] Not enough active copies to meet write consistency of [QUORUM] (have 1, needed 2). Timeout: [100ms], request: [index {[test][type1][1], source[{ type1 : { \"id\" : \"1\", \"name\" : \"test\" } }]}]")); + assertThat(e.getMessage(), equalTo("[test][0] Not enough active copies to meet write consistency of [QUORUM] (have 1, needed 2). Timeout: [100ms], request: [index {[test][type1][1], source[{ \"type1\" : { \"id\" : \"1\", \"name\" : \"test\" } }]}]")); // but really, all is well } @@ -76,7 +76,7 @@ public class WriteConsistencyLevelIT extends ESIntegTestCase { fail("can't index, does not match consistency"); } catch (UnavailableShardsException e) { assertThat(e.status(), equalTo(RestStatus.SERVICE_UNAVAILABLE)); - assertThat(e.getMessage(), equalTo("[test][0] Not enough active copies to meet write consistency of [ALL] (have 2, needed 3). Timeout: [100ms], request: [index {[test][type1][1], source[{ type1 : { \"id\" : \"1\", \"name\" : \"test\" } }]}]")); + assertThat(e.getMessage(), equalTo("[test][0] Not enough active copies to meet write consistency of [ALL] (have 2, needed 3). Timeout: [100ms], request: [index {[test][type1][1], source[{ \"type1\" : { \"id\" : \"1\", \"name\" : \"test\" } }]}]")); // but really, all is well } @@ -93,6 +93,6 @@ public class WriteConsistencyLevelIT extends ESIntegTestCase { } private String source(String id, String nameValue) { - return "{ type1 : { \"id\" : \"" + id + "\", \"name\" : \"" + nameValue + "\" } }"; + return "{ \"type1\" : { \"id\" : \"" + id + "\", \"name\" : \"" + nameValue + "\" } }"; } } diff --git a/core/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java b/core/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java index d9740d9f32b..4ed593c6ff7 100644 --- a/core/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java +++ b/core/src/test/java/org/elasticsearch/index/query/BoolQueryBuilderTests.java @@ -133,22 +133,22 @@ public class BoolQueryBuilderTests extends AbstractQueryTestCase 0) { QueryBuilder must = tempQueryBuilder.must().get(0); - contentString += "must: " + must.toString() + ","; + contentString += "\"must\": " + must.toString() + ","; expectedQuery.must(must); } if (tempQueryBuilder.mustNot().size() > 0) { QueryBuilder mustNot = tempQueryBuilder.mustNot().get(0); - contentString += (randomBoolean() ? "must_not: " : "mustNot: ") + mustNot.toString() + ","; + contentString += (randomBoolean() ? "\"must_not\": " : "\"mustNot\": ") + mustNot.toString() + ","; expectedQuery.mustNot(mustNot); } if (tempQueryBuilder.should().size() > 0) { QueryBuilder should = tempQueryBuilder.should().get(0); - contentString += "should: " + should.toString() + ","; + contentString += "\"should\": " + should.toString() + ","; expectedQuery.should(should); } if (tempQueryBuilder.filter().size() > 0) { QueryBuilder filter = tempQueryBuilder.filter().get(0); - contentString += "filter: " + filter.toString() + ","; + contentString += "\"filter\": " + filter.toString() + ","; expectedQuery.filter(filter); } contentString = contentString.substring(0, contentString.length() - 1); diff --git a/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java b/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java index 26291b7ac9c..e5f8e9ce756 100644 --- a/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java +++ b/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java @@ -108,6 +108,6 @@ public class SimpleRecoveryIT extends ESIntegTestCase { } private String source(String id, String nameValue) { - return "{ type1 : { \"id\" : \"" + id + "\", \"name\" : \"" + nameValue + "\" } }"; + return "{ \"type1\" : { \"id\" : \"" + id + "\", \"name\" : \"" + nameValue + "\" } }"; } } diff --git a/core/src/test/resources/org/elasticsearch/common/settings/loader/test-settings.json b/core/src/test/resources/org/elasticsearch/common/settings/loader/test-settings.json index 7190648d597..d124762e79d 100644 --- a/core/src/test/resources/org/elasticsearch/common/settings/loader/test-settings.json +++ b/core/src/test/resources/org/elasticsearch/common/settings/loader/test-settings.json @@ -1,10 +1,10 @@ { - test1:{ - value1:"value1", - test2:{ - value2:"value2", - value3:2 + "test1":{ + "value1":"value1", + "test2":{ + "value2":"value2", + "value3":2 }, - test3:["test3-1", "test3-2"] + "test3":["test3-1", "test3-2"] } -} \ No newline at end of file +} diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping1.json b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping1.json index a276c0bf236..dbd74d33780 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping1.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping1.json @@ -1,9 +1,9 @@ { - person:{ - properties:{ + "person":{ + "properties":{ "name":{ "type": "text", - store:true + "store":true } } } diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping3.json b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping3.json index 22b97dccf45..459d9fc9b1e 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping3.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping3.json @@ -14,13 +14,13 @@ }, "not_indexed":{ "type": "text", - index:false, - store:true + "index":false, + "store":true }, "not_indexed2":{ "type": "text", - index:false, - store:true + "index":false, + "store":true } } } diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping4.json b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping4.json index d7ba2508004..416633c4fc1 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping4.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/test-mapping4.json @@ -1,14 +1,14 @@ { - person:{ - properties:{ + "person":{ + "properties":{ "name":{ "type": "text", - store:true, + "store":true, "fields":{ "not_indexed3":{ "type": "text", - index:false, - store:true + "index":false, + "store":true } } } diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade1.json b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade1.json index d000fca94b7..b00ea46b56d 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade1.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade1.json @@ -1,17 +1,17 @@ { - person:{ - properties:{ + "person":{ + "properties":{ "name":{ "type": "text", - store:true, + "store":true, "fields":{ "indexed":{ "type": "text" }, "not_indexed":{ "type": "text", - index:false, - store:true + "index":false, + "store":true } } } diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade2.json b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade2.json index 478999ff6e1..563567f463e 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade2.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade2.json @@ -1,22 +1,22 @@ { - person:{ - properties:{ + "person":{ + "properties":{ "name":{ "type": "text", - store:true, + "store":true, "fields":{ "indexed":{ "type": "text" }, "not_indexed":{ "type": "text", - index:false, - store:true + "index":false, + "store":true }, "not_indexed2":{ "type": "text", - index:false, - store:true + "index":false, + "store":true } } } diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade3.json b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade3.json index 89f268efb33..5985ff316a7 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade3.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/multifield/merge/upgrade3.json @@ -1,14 +1,14 @@ { - person:{ - properties:{ + "person":{ + "properties":{ "name":{ "type": "text", - index:false, + "index":false, "fields":{ "not_indexed3":{ "type": "text", - index:false, - store:true + "index":false, + "store":true } } } diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test-mapping.json b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test-mapping.json index b13cab0af61..0f99af91ecb 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test-mapping.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test-mapping.json @@ -1,79 +1,79 @@ { - person:{ + "person":{ "_meta":{ "param1":"value1" }, - date_formats:["yyyy-MM-dd", "dd-MM-yyyy"], - dynamic:false, - enabled:true, - _source:{ + "date_formats":["yyyy-MM-dd", "dd-MM-yyyy"], + "dynamic":false, + "enabled":true, + "_source":{ }, - properties:{ - name:{ - type:"object", - dynamic:false, - properties:{ - first:{ + "properties":{ + "name":{ + "type":"object", + "dynamic":false, + "properties":{ + "first":{ "type": "text", - store:true + "store":true }, - last:{ + "last":{ "type": "keyword" } } }, - address:{ - type:"object", - properties:{ - first:{ - properties:{ - location:{ + "address":{ + "type":"object", + "properties":{ + "first":{ + "properties":{ + "location":{ "type": "text", - store:true + "store":true } } }, - last:{ - properties:{ - location:{ + "last":{ + "properties":{ + "location":{ "type": "text" } } } } }, - age:{ - type:"integer", - null_value:0 + "age":{ + "type":"integer", + "null_value":0 }, - birthdate:{ - type:"date", - format:"yyyy-MM-dd" + "birthdate":{ + "type":"date", + "format":"yyyy-MM-dd" }, - nerd:{ - type:"boolean" + "nerd":{ + "type":"boolean" }, - dogs:{ + "dogs":{ "type": "text" }, - complex:{ - type:"object", - properties:{ - value1:{ + "complex":{ + "type":"object", + "properties":{ + "value1":{ "type": "text" }, - value2:{ + "value2":{ "type": "text" } } }, - complex2:{ - type:"object", - properties:{ - value1:{ + "complex2":{ + "type":"object", + "properties":{ + "value1":{ "type": "text" }, - value2:{ + "value2":{ "type": "text" } } diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype-noid.json b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype-noid.json index eb71b7a8204..2a42bc2444a 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype-noid.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype-noid.json @@ -1,39 +1,39 @@ { - name:{ - first:"shay", - last:"banon" + "name":{ + "first":"shay", + "last":"banon" }, - address:{ - first:{ - location:"first location" + "address":{ + "first":{ + "location":"first location" }, - last:{ - location:"last location" + "last":{ + "location":"last location" } }, - age:32, - birthDate:"1977-11-15", - nerd:true, - dogs:["buck", "mia"], - complex:[ + "age":32, + "birthDate":"1977-11-15", + "nerd":true, + "dogs":["buck", "mia"], + "complex":[ { - value1:"value1" + "value1":"value1" }, { - value2:"value2" + "value2":"value2" } ], - complex2:[ + "complex2":[ [ { - value1:"value1" + "value1":"value1" } ], [ { - value2:"value2" + "value2":"value2" } ] ], - nullValue:null -} \ No newline at end of file + "nullValue":null +} diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype.json b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype.json index e91f2f543d6..daa077fa9e6 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1-notype.json @@ -1,40 +1,40 @@ { - _id:"1", - name:{ - first:"shay", - last:"banon" + "_id":"1", + "name":{ + "first":"shay", + "last":"banon" }, - address:{ - first:{ - location:"first location" + "address":{ + "first":{ + "location":"first location" }, - last:{ - location:"last location" + "last":{ + "location":"last location" } }, - age:32, - birthDate:"1977-11-15", - nerd:true, - dogs:["buck", "mia"], - complex:[ + "age":32, + "birthDate":"1977-11-15", + "nerd":true, + "dogs":["buck", "mia"], + "complex":[ { - value1:"value1" + "value1":"value1" }, { - value2:"value2" + "value2":"value2" } ], - complex2:[ + "complex2":[ [ { - value1:"value1" + "value1":"value1" } ], [ { - value2:"value2" + "value2":"value2" } ] ], - nullValue:null -} \ No newline at end of file + "nullValue":null +} diff --git a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1.json b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1.json index a4e64e9cc27..2a42bc2444a 100644 --- a/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1.json +++ b/core/src/test/resources/org/elasticsearch/index/mapper/simple/test1.json @@ -1,39 +1,39 @@ { - name:{ - first:"shay", - last:"banon" + "name":{ + "first":"shay", + "last":"banon" }, - address:{ - first:{ - location:"first location" + "address":{ + "first":{ + "location":"first location" }, - last:{ - location:"last location" + "last":{ + "location":"last location" } }, - age:32, - birthDate:"1977-11-15", - nerd:true, - dogs:["buck", "mia"], - complex:[ + "age":32, + "birthDate":"1977-11-15", + "nerd":true, + "dogs":["buck", "mia"], + "complex":[ { - value1:"value1" + "value1":"value1" }, { - value2:"value2" + "value2":"value2" } ], - complex2:[ + "complex2":[ [ { - value1:"value1" + "value1":"value1" } ], [ { - value2:"value2" + "value2":"value2" } ] ], - nullValue:null + "nullValue":null } diff --git a/core/src/test/resources/org/elasticsearch/search/geo/gzippedmap.gz b/core/src/test/resources/org/elasticsearch/search/geo/gzippedmap.gz index d903def573b512d50125f216159dc7cc298c8dfa..f8894811a6c088ce2bc166d8252f09ac9390bff6 100644 GIT binary patch literal 7686 zcmV+h9{J%PiwFotUF}u^17~_^aByX0ZDDW#tzBKOY)5f@=T}_aXP=|~sP5|K&42^O z5D>;F2|^J96j?$xB90V<{NJ-yf7U)e;L)co460!!Q5bKKl3<@85mfxe)Il^;-9_5kKX_FYkU~ov&-dM{@!*{>`{qM1g3*P1A`al2CJ71qA=HO%P|H>aeBAM2lvzwpg zMwgvSY5u9iPFSRXVtm-?Vpdf@K5~h4;W_)_=HI%I`ht>540FLwm$0jk`}z2;>LrBh z^OX{O$>TF^WU16FzFz5K^xmm?4-iTXs`FVwdk^id-%RyR$oQtv2fprGpK$&^LP=5O~YKUl(Al{>dSnQc6=pAm*yXr z(CNgh)I85m8eu3UyJ8QrHC;9@1LYwSDXdg9{IE^Cb~Ca*{tbfx-K z%^N@_6@RL8ztrg>m^tJNop&M!oNP_mmWfsN1^8)I@Kk9rFbOlP1$53585x9*+H-Rz=t32r=Yl$(Fjr{1 z@y9+kI;`s#7gil+Ac-!kqNx!!&dL`S@y~$*>^5ui63Y5uNTP>Az$wg4sI}!eWJvF_ zj$^qf!G~pPAQA!kCBnwdBOK4C87D1UyN8IA77g=IeLv_Ju!l8{_$a5an6?|UK+BbL zFvo|Rh6!DQ*y$ov7%X8h*N<(Txwk<^C9#x|q_MAZL2FcS20_&M>+9wMrI@TU08Ifd zU#3<2zGAM|=drOs5tqw*6vg|llPW`@6kPAxL)v|KTK%a7$9g%?H8JZY7&8Z*vJCK0 z?V>T(#>X)7vUH@TzK)9O(%!KN20fXj=ggSP~f?`h*x=nAx%&lHGs(y>?GNXbh-JCNeVQh zHadl5LHJ?T!PmJCx@JQ&TnU&n-`9hq7h_CC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a+_^cm$KrgS@!d+{ZSFXX-$FSaG<`XtO%N)?6*LFux6~YSqDd~`?N6C8|jhCj;&EJ3d*=D zdCr*f5py$Ivng&JDqZ&wS2bC}daYR!nS>eH2{p_Ljg)W#AGvX_S_WL(O16ef!I$%H zy1?xs;opYQ;9qc>y<4vyr9yr)KNKugNr386bojOS2RD@vMTVi=G|mx@(*);~_TzIE`lq3z*&`7HU@6k-bO+;S+@ZJNU4k291 zta1>^%>^Sz6BJrZt#<9V_e?ak&Zz=X3j7Z@ewx&{Pb;wq#0L0z7DQidmD;EBTW_rd zXXbQk>syj?yL}QX+hewt%s!faQj1|$3TeeKbIHS!8XZ`Vw|(0D+8@6qYMcEsMrCo~ z)r!`3fqY>xawhs?ST)kk86(&kAb) zSyk?F|K){_&eImr)0Wet4%UZlu!qgGN4>d+oxVk8%#M{3w#)yfzpmjqb1)s3?V8FsT_+8f_pwa;OK` z0>-0gUH%LpJtHUm%JtB1j3lSlP=O4zMN~%Td5Bh z;oPs8C<*G*K^ZNrsWabYM&YzQyhXG2QT|ca%iFK#7}&wKPxF}HFn>7%F^nHxgh6n< zIOwPf=d7sb{CCpMes}HohuqG88Se0h=1zaN?(BE)GLxR`a`wB1VgJQ01&gc%*@>xv zTp2L8dyRne(S+XfDXC|X$m7uFd8qU-^7<`-+tax3SseNJhsF+nxa{sK4gLF#|+cFKnd|I2MLE_K^b@T8{ORgQ%)= z%Wyl}^l7H)8^2R2b<=8`hU+aE6u}`)m$Ax#&KE{^=15teEgvo()&6@uANfl$Zp8tW zh@izBCprzel66TL**2VQZ!4bc{Ve4D^o_FO&H(B_9`wmoX6hPx# diff --git a/docs/reference/migration/migrate_5_0/rest.asciidoc b/docs/reference/migration/migrate_5_0/rest.asciidoc index 46cb74b6289..b95b0cc43e7 100644 --- a/docs/reference/migration/migrate_5_0/rest.asciidoc +++ b/docs/reference/migration/migrate_5_0/rest.asciidoc @@ -35,3 +35,8 @@ Node roles are now returned in a specific section, called `roles`, as part of nodes stats and nodes info response. The new section is an array that holds all the different roles that each node fulfills. In case the array is returned empty, that means that the node is a coordinating only node. + +==== Forbid unquoted JSON + +Previously, JSON documents were allowed with unquoted field names, which +isn't strictly JSON and broke some Elasticsearch clients. diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/30_mutate.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/30_mutate.yaml index d942ef43b30..c6816afba0e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/30_mutate.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/30_mutate.yaml @@ -82,15 +82,15 @@ pipeline: "my_pipeline" body: > { - field_to_rename: "value", - field_to_remove: "old_value", - field_to_lowercase: "LOWERCASE", - field_to_uppercase: "uppercase", - field_to_trim: " trimmed ", - field_to_split: "127-0-0-1", - field_to_join: ["127","0","0","1"], - field_to_convert: ["127","0","0","1"], - field_to_gsub: "127-0-0-1" + "field_to_rename": "value", + "field_to_remove": "old_value", + "field_to_lowercase": "LOWERCASE", + "field_to_uppercase": "uppercase", + "field_to_trim": " trimmed ", + "field_to_split": "127-0-0-1", + "field_to_join": ["127","0","0","1"], + "field_to_convert": ["127","0","0","1"], + "field_to_gsub": "127-0-0-1" } - do: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/80_foreach.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/80_foreach.yaml index a26681152df..fc0fca81b09 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/80_foreach.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/ingest/80_foreach.yaml @@ -31,7 +31,7 @@ pipeline: "my_pipeline" body: > { - values: ["foo", "bar", "baz"] + "values": ["foo", "bar", "baz"] } - do: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/70_response_filtering.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/70_response_filtering.yaml index f81cb234691..e7d51c5bced 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/70_response_filtering.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search/70_response_filtering.yaml @@ -25,7 +25,7 @@ search: index: test filter_path: "*" - body: "{ query: { match_all: {} } }" + body: "{ \"query\": { \"match_all\": {} } }" - gte: { took: 0 } - is_true: _shards.total @@ -41,7 +41,7 @@ search: index: test filter_path: "took" - body: "{ query: { match_all: {} } }" + body: "{ \"query\": { \"match_all\": {} } }" - is_true: took - is_false: _shards.total @@ -57,7 +57,7 @@ search: index: test filter_path: "_shards.*" - body: "{ query: { match_all: {} } }" + body: "{ \"query\": { \"match_all\": {} } }" - is_false: took - is_true: _shards.total @@ -73,7 +73,7 @@ search: index: test filter_path: [ "hits.**._i*", "**.total" ] - body: "{ query: { match_all: {} } }" + body: "{ \"query\": { \"match_all\": {} } }" - is_false: took - is_true: _shards.total diff --git a/test/framework/src/test/java/org/elasticsearch/test/rest/test/DoSectionParserTests.java b/test/framework/src/test/java/org/elasticsearch/test/rest/test/DoSectionParserTests.java index 3c65fda94ca..655d3071d63 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/rest/test/DoSectionParserTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/rest/test/DoSectionParserTests.java @@ -160,8 +160,8 @@ public class DoSectionParserTests extends AbstractParserTestCase { parser = YamlXContent.yamlXContent.createParser( "search:\n" + " body:\n" + - " _source: [ include.field1, include.field2 ]\n" + - " query: { match_all: {} }" + " \"_source\": [ include.field1, include.field2 ]\n" + + " \"query\": { \"match_all\": {} }" ); String body = "{ \"_source\": [ \"include.field1\", \"include.field2\" ], \"query\": { \"match_all\": {} }}"; @@ -281,7 +281,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { " index: test_1\n" + " type: test\n" + " id: 1\n" + - " body: \"{ _source: true, query: { match_all: {} } }\"" + " body: \"{ \\\"_source\\\": true, \\\"query\\\": { \\\"match_all\\\": {} } }\"" ); DoSectionParser doSectionParser = new DoSectionParser(); @@ -297,14 +297,14 @@ public class DoSectionParserTests extends AbstractParserTestCase { assertThat(apiCallSection.hasBody(), equalTo(true)); assertThat(apiCallSection.getBodies().size(), equalTo(1)); //stringified body is taken as is - assertJsonEquals(apiCallSection.getBodies().get(0), "{ _source: true, query: { match_all: {} } }"); + assertJsonEquals(apiCallSection.getBodies().get(0), "{ \"_source\": true, \"query\": { \"match_all\": {} } }"); } public void testParseDoSectionWithBodiesStringifiedAndNot() throws Exception { parser = YamlXContent.yamlXContent.createParser( "index:\n" + " body:\n" + - " - \"{ _source: true, query: { match_all: {} } }\"\n" + + " - \"{ \\\"_source\\\": true, \\\"query\\\": { \\\"match_all\\\": {} } }\"\n" + " - { size: 100, query: { match_all: {} } }" ); @@ -319,7 +319,7 @@ public class DoSectionParserTests extends AbstractParserTestCase { assertThat(apiCallSection.hasBody(), equalTo(true)); assertThat(apiCallSection.getBodies().size(), equalTo(2)); //stringified body is taken as is - assertJsonEquals(apiCallSection.getBodies().get(0), "{ _source: true, query: { match_all: {} } }"); + assertJsonEquals(apiCallSection.getBodies().get(0), "{ \"_source\": true, \"query\": { \"match_all\": {} } }"); assertJsonEquals(apiCallSection.getBodies().get(1), body); }