mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
Fix serialization of short[] arays.
short[] were mistakenly encoded as a float[]. This is not an issue for the text-based xcontents that we have (yaml, json) since floats can represent any short value and are serialized as strings. However, this will make the binary xcontents serialize shorts as int instead of floats. Close #7845
This commit is contained in:
parent
4ee91cb331
commit
ede60df804
@ -1272,7 +1272,7 @@ public final class XContentBuilder implements BytesStream, Releasable {
|
||||
generator.writeEndArray();
|
||||
} else if (value instanceof short[]) {
|
||||
generator.writeStartArray();
|
||||
for (float v : (short[]) value) {
|
||||
for (short v : (short[]) value) {
|
||||
generator.writeNumber(v);
|
||||
}
|
||||
generator.writeEndArray();
|
||||
|
Loading…
x
Reference in New Issue
Block a user