Skip to content

Commit 3ffcda0

Browse files
authored
Handle additional JSON properties (#5139)
* Handle additional JSON properties * PR feedback - add comment
1 parent 4c622f4 commit 3ffcda0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Nest/Aggregations/AggregateFormatter.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,24 @@ private IAggregate GetBoxplotAggregate(ref JsonReader reader, IJsonFormatterReso
258258
reader.ReadNext(); // "q3"
259259
reader.ReadNext(); // :
260260
boxplot.Q3 = reader.ReadDouble();
261+
262+
// ES 7.11.0 adds these two additional properties on the payload
263+
// When present on a 7.11 response, we avoid an exception by
264+
// handling (and skipping) over the properties. The 7.11 client
265+
// will add support for these new properties on BoxplotAggregate.
266+
var token = reader.GetCurrentJsonToken();
267+
if (token != JsonToken.EndObject)
268+
{
269+
reader.ReadNext(); // ,
270+
reader.ReadNext(); // "lower"
271+
reader.ReadNext(); // :
272+
reader.ReadDouble();
273+
reader.ReadNext(); // ,
274+
reader.ReadNext(); // "upper"
275+
reader.ReadNext(); // :
276+
reader.ReadDouble();
277+
}
278+
261279
return boxplot;
262280
}
263281

0 commit comments

Comments
 (0)