Skip to content

Commit

Permalink
Replace usage of BigIntegers with Longs. This will fix the issues wit…
Browse files Browse the repository at this point in the history
…h BigIntegers being represented in open API spec as ints. (#370)
  • Loading branch information
Miles-Garnsey authored and emerkle826 committed Sep 15, 2023
1 parent 5fe7d48 commit 16eebc4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
6 changes: 4 additions & 2 deletions management-api-server/doc/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2147,10 +2147,12 @@
"type" : "object",
"properties" : {
"end" : {
"type" : "integer"
"type" : "integer",
"format" : "int64"
},
"start" : {
"type" : "integer"
"type" : "integer",
"format" : "int64"
}
},
"required" : [ "end", "start" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package com.datastax.mgmtapi.resources.v2.models;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigInteger;
import java.util.Comparator;
import java.util.Objects;

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

@JsonProperty(value = "start", required = true)
public final BigInteger start;
public final Long start;

@JsonProperty(value = "end", required = true)
public final BigInteger end;
public final Long end;

public RingRange(
@JsonProperty(value = "start", required = true) BigInteger start,
@JsonProperty(value = "end", required = true) BigInteger end) {
@JsonProperty(value = "start", required = true) Long start,
@JsonProperty(value = "end", required = true) Long end) {
this.start = start;
this.end = end;
}

public RingRange(String... range) {
start = new BigInteger(range[0]);
end = new BigInteger(range[1]);
start = Long.valueOf(range[0]);
end = Long.valueOf(range[1]);
}

public BigInteger getStart() {
public Long getStart() {
return start;
}

public BigInteger getEnd() {
public Long getEnd() {
return end;
}

Expand Down

0 comments on commit 16eebc4

Please sign in to comment.