Created
October 28, 2020 15:28
-
-
Save thoraxe/4b540ce69574556b91db782f3e8a7fd7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "http://json-schema.org/draft-07/schema", | |
"$id": "http://example.com/example.json", | |
"type": "object", | |
"title": "The Space Ring Things Player Schema", | |
"description": "The root schema comprises the entire JSON document.", | |
"default": {}, | |
"examples": [ | |
{ | |
"position": { | |
"x": 102.6, | |
"y": 68.4 | |
}, | |
"ship": { | |
"name": "The Rusty Bucket", | |
"velocity": 100.0, | |
"heading": 68.0, | |
"weapon_power": 1.0, | |
"hit_points": 100.0 | |
} | |
} | |
], | |
"required": [ | |
"position", | |
"ship" | |
], | |
"properties": { | |
"position": { | |
"$id": "#/properties/position", | |
"type": "object", | |
"title": "The position schema", | |
"description": "Defines where a player is inside a sector as coordinates", | |
"default": {}, | |
"examples": [ | |
{ | |
"x": 102.6, | |
"y": 68.4 | |
} | |
], | |
"required": [ | |
"x", | |
"y" | |
], | |
"properties": { | |
"x": { | |
"$id": "#/properties/position/properties/x", | |
"type": "number", | |
"title": "X position", | |
"description": "The x coordinate value", | |
"default": 0.0, | |
"examples": [ | |
102.6 | |
] | |
}, | |
"y": { | |
"$id": "#/properties/position/properties/y", | |
"type": "number", | |
"title": "Y position", | |
"description": "The y coordinate value", | |
"default": 0.0, | |
"examples": [ | |
68.4 | |
] | |
} | |
}, | |
"additionalProperties": false | |
}, | |
"ship": { | |
"$id": "#/properties/ship", | |
"type": "object", | |
"title": "The ship schema", | |
"description": "The details about the player's ship", | |
"default": {}, | |
"examples": [ | |
{ | |
"name": "The Rusty Bucket", | |
"velocity": 100.0, | |
"heading": 68.0, | |
"weapon_power": 1.0, | |
"hit_points": 100.0 | |
} | |
], | |
"required": [ | |
"name", | |
"velocity", | |
"heading", | |
"weapon_power", | |
"hit_points" | |
], | |
"properties": { | |
"name": { | |
"$id": "#/properties/ship/properties/name", | |
"type": "string", | |
"title": "The name of the ship", | |
"description": "A player can name their ship", | |
"default": "", | |
"examples": [ | |
"The Rusty Bucket" | |
] | |
}, | |
"velocity": { | |
"$id": "#/properties/ship/properties/velocity", | |
"type": "number", | |
"title": "The velocity of the ship", | |
"description": "How fast the ship is traveling", | |
"default": 0.0, | |
"examples": [ | |
100.0 | |
] | |
}, | |
"heading": { | |
"$id": "#/properties/ship/properties/heading", | |
"type": "number", | |
"title": "The heading of the ship", | |
"description": "Which direction the ship is pointing", | |
"default": 0.0, | |
"examples": [ | |
68.0 | |
] | |
}, | |
"weapon_power": { | |
"$id": "#/properties/ship/properties/weapon_power", | |
"type": "number", | |
"title": "Ship weapon power", | |
"description": "The current total weapon power of the ship", | |
"default": 0.0, | |
"examples": [ | |
1.0 | |
] | |
}, | |
"hit_points": { | |
"$id": "#/properties/ship/properties/hit_points", | |
"type": "number", | |
"title": "Ship hit points", | |
"description": "The starting hit points for the ship", | |
"default": 0.0, | |
"examples": [ | |
100.0 | |
] | |
} | |
}, | |
"additionalProperties": false | |
} | |
}, | |
"additionalProperties": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment