maze-generator/src/main/resources/maze.schema.json

97 lines
2.1 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://manuel.friedli.info/maze/maze.schema.json",
"javaType": "ch.fritteli.maze.generator.json.JsonMaze",
"type": "object",
"additionalProperties": false,
"required": [
"id",
"width",
"height",
"start",
"end",
"grid"
],
"properties": {
"id": {
"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",
"minimum": 1
},
"height": {
"type": "integer",
"minimum": 1
},
"start": {
"$ref": "#/$defs/coordinates"
},
"end": {
"$ref": "#/$defs/coordinates"
},
"grid": {
"$ref": "#/$defs/grid"
}
},
"$defs": {
"grid": {
"type": "array",
"items": {
"$ref": "#/$defs/row"
},
"minItems": 1
},
"row": {
"type": "array",
"items": {
"$ref": "#/$defs/cell"
},
"minItems": 1
},
"cell": {
"type": "object",
"javaType": "ch.fritteli.maze.generator.json.JsonCell",
"additionalProperties": false,
"required": [],
"properties": {
"top": {
"type": "boolean"
},
"right": {
"type": "boolean"
},
"bottom": {
"type": "boolean"
},
"left": {
"type": "boolean"
},
"solution": {
"type": "boolean"
}
}
},
"coordinates": {
"type": "object",
"javaType": "ch.fritteli.maze.generator.json.JsonCoordinates",
"additionalProperties": false,
"required": [
"x",
"y"
],
"properties": {
"x": {
"type": "integer",
"minimum": 0
},
"y": {
"type": "integer",
"minimum": 0
}
}
}
}
}