Implement a JSON and a JSON-file renderer.
This commit is contained in:
parent
81b5d7adac
commit
715d89a57a
6 changed files with 296 additions and 3 deletions
69
src/main/resources/labyrinth.schema.json
Normal file
69
src/main/resources/labyrinth.schema.json
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://manuel.friedli.info/labyrinth-1/labyrinth.schema.json",
|
||||
"javaType": "ch.fritteli.labyrinth.generator.json.JsonLabyrinth",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"id",
|
||||
"width",
|
||||
"height",
|
||||
"grid"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"existingJavaType": "java.lang.Long"
|
||||
},
|
||||
"width": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"height": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"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.labyrinth.generator.json.JsonCell",
|
||||
"additionalProperties": false,
|
||||
"required": [],
|
||||
"properties": {
|
||||
"top": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"right": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"bottom": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"left": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"solution": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue