JSON: Transmit the ID as a string. See commit for the reason.
This commit is contained in:
parent
2dea68f386
commit
822a1b1528
3 changed files with 4 additions and 4 deletions
|
@ -20,7 +20,7 @@ class Generator {
|
|||
@NonNull
|
||||
JsonLabyrinth generate() {
|
||||
final JsonLabyrinth result = new JsonLabyrinth();
|
||||
result.setId(this.labyrinth.getRandomSeed());
|
||||
result.setId(String.valueOf(this.labyrinth.getRandomSeed()));
|
||||
result.setWidth(this.labyrinth.getWidth());
|
||||
result.setHeight(this.labyrinth.getHeight());
|
||||
final List<List<JsonCell>> rows = new ArrayList<>();
|
||||
|
|
|
@ -39,7 +39,7 @@ public class JsonRenderer implements Renderer<String> {
|
|||
rows.get(0).add(cell);
|
||||
// Wrap it all in an instance of JsonLabyrinth.
|
||||
final JsonLabyrinth jsonLabyrinth = new JsonLabyrinth();
|
||||
jsonLabyrinth.setId(0L);
|
||||
jsonLabyrinth.setId("0");
|
||||
jsonLabyrinth.setGrid(rows);
|
||||
return jsonLabyrinth;
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"existingJavaType": "java.lang.Long"
|
||||
"type": "string",
|
||||
"description": "64 bit precision signed integer value. Transmitted as string, because ECMAScript (browsers) don't normally handle 64 bit integers well, as the ECMAScript 'number' type is a 64 bit signed double value, leaving only 53 bits for the integer part, thus losing precision."
|
||||
},
|
||||
"width": {
|
||||
"type": "integer",
|
||||
|
|
Loading…
Reference in a new issue