File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
rest-api-spec/src/main/resources/rest-api-spec/test/index
main/java/org/opensearch/index/mapper
test/java/org/opensearch/index/mapper Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 9
9
index : test_1
10
10
11
11
- do :
12
- catch : /field name cannot contain only dot /
12
+ catch : /field name cannot contain only the character \[.\] /
13
13
index :
14
14
index : test_1
15
15
id : 1
18
18
}
19
19
20
20
- do :
21
- catch : /field name cannot contain only dot /
21
+ catch : /field name cannot contain only the character \[.\] /
22
22
index :
23
23
index : test_1
24
24
id : 1
27
27
}
28
28
29
29
- do :
30
- catch : /field name cannot contain only dot /
30
+ catch : /field name cannot contain only the character \[.\] /
31
31
index :
32
32
index : test_1
33
33
id : 1
Original file line number Diff line number Diff line change @@ -207,7 +207,7 @@ private static String[] splitAndValidatePath(String fullFieldPath) {
207
207
if (fullFieldPath .contains ("." )) {
208
208
String [] parts = fullFieldPath .split ("\\ ." );
209
209
if (parts .length == 0 ) {
210
- throw new IllegalArgumentException ("field name cannot contain only dot " );
210
+ throw new IllegalArgumentException ("field name cannot contain only the character [.] " );
211
211
}
212
212
for (String part : parts ) {
213
213
if (Strings .hasText (part ) == false ) {
Original file line number Diff line number Diff line change @@ -1716,20 +1716,20 @@ public void testDynamicFieldsWithOnlyDot() throws Exception {
1716
1716
})));
1717
1717
1718
1718
assertThat (e .getCause (), notNullValue ());
1719
- assertThat (e .getCause ().getMessage (), containsString ("field name cannot contain only dot " ));
1719
+ assertThat (e .getCause ().getMessage (), containsString ("field name cannot contain only the character [.] " ));
1720
1720
1721
1721
e = expectThrows (
1722
1722
MapperParsingException .class ,
1723
1723
() -> mapper .parse (source (b -> { b .startObject (".." ).field ("foo" , 2 ).endObject (); }))
1724
1724
);
1725
1725
1726
1726
assertThat (e .getCause (), notNullValue ());
1727
- assertThat (e .getCause ().getMessage (), containsString ("field name cannot contain only dot " ));
1727
+ assertThat (e .getCause ().getMessage (), containsString ("field name cannot contain only the character [.] " ));
1728
1728
1729
1729
e = expectThrows (MapperParsingException .class , () -> mapper .parse (source (b -> b .field ("." , "1234" ))));
1730
1730
1731
1731
assertThat (e .getCause (), notNullValue ());
1732
- assertThat (e .getCause ().getMessage (), containsString ("field name cannot contain only dot " ));
1732
+ assertThat (e .getCause ().getMessage (), containsString ("field name cannot contain only the character [.] " ));
1733
1733
}
1734
1734
1735
1735
public void testDynamicFieldsEmptyName () throws Exception {
You can’t perform that action at this time.
0 commit comments