Skip to content

Commit 3c86113

Browse files
Miles-Garnseyemerkle826
authored andcommitted
Replace usage of BigIntegers with Longs. This will fix the issues with BigIntegers being represented in open API spec as ints. (#370)
1 parent f1c9f7b commit 3c86113

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

management-api-server/doc/openapi.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,10 +2147,12 @@
21472147
"type" : "object",
21482148
"properties" : {
21492149
"end" : {
2150-
"type" : "integer"
2150+
"type" : "integer",
2151+
"format" : "int64"
21512152
},
21522153
"start" : {
2153-
"type" : "integer"
2154+
"type" : "integer",
2155+
"format" : "int64"
21542156
}
21552157
},
21562158
"required" : [ "end", "start" ]

management-api-server/src/main/java/com/datastax/mgmtapi/resources/v2/models/RingRange.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
package com.datastax.mgmtapi.resources.v2.models;
88

99
import com.fasterxml.jackson.annotation.JsonProperty;
10-
import java.math.BigInteger;
1110
import java.util.Comparator;
1211
import java.util.Objects;
1312

@@ -16,28 +15,28 @@ public final class RingRange {
1615
(RingRange o1, RingRange o2) -> o1.start.compareTo(o2.start);
1716

1817
@JsonProperty(value = "start", required = true)
19-
public final BigInteger start;
18+
public final Long start;
2019

2120
@JsonProperty(value = "end", required = true)
22-
public final BigInteger end;
21+
public final Long end;
2322

2423
public RingRange(
25-
@JsonProperty(value = "start", required = true) BigInteger start,
26-
@JsonProperty(value = "end", required = true) BigInteger end) {
24+
@JsonProperty(value = "start", required = true) Long start,
25+
@JsonProperty(value = "end", required = true) Long end) {
2726
this.start = start;
2827
this.end = end;
2928
}
3029

3130
public RingRange(String... range) {
32-
start = new BigInteger(range[0]);
33-
end = new BigInteger(range[1]);
31+
start = Long.valueOf(range[0]);
32+
end = Long.valueOf(range[1]);
3433
}
3534

36-
public BigInteger getStart() {
35+
public Long getStart() {
3736
return start;
3837
}
3938

40-
public BigInteger getEnd() {
39+
public Long getEnd() {
4140
return end;
4241
}
4342

0 commit comments

Comments
 (0)