Add comments and fix up the API doc

This commit is contained in:
Marc Di Luzio 2020-06-12 19:34:14 +01:00
parent 04a1b8ea1e
commit 50c3795578

View file

@ -139,27 +139,33 @@ definitions:
status: status:
properties: properties:
ready: ready:
description: Whether the server is ready to accept requests
type: boolean type: boolean
example: true example: true
version: version:
description: The version of the server in v{major}.{minor}-{delta}-{sha} form
type: string type: string
example: "v0.12-1-g7d1a2d7" example: "v0.12-1-g7d1a2d7"
tick: tick:
description: The tick rate of the server in minutes (how many minutes per tick)
type: integer type: integer
example: 5 example: 5
nexttick: nexttick:
description: The time the next tick will occur
type: string type: string
example: "15:30:00" example: "15:30:00"
error: error:
properties: properties:
error: error:
description: An explanation for the HTTP error returned
type: string type: string
example: "account not found" example: "account not found"
register-data: register-data:
properties: properties:
name: name:
description: The account name
type: string type: string
example: "myname" example: "myname"
required: required:
@ -181,22 +187,22 @@ definitions:
commands-data: commands-data:
properties: properties:
commands: commands:
description: A set of commands to exectute in the order given
type: array type: array
items: items:
type: object type: object
properties: properties:
schema: schema:
$ref: '#/definitions/command' $ref: '#/definitions/command'
error:
type: string
example: "account with name already existed"
radar-response: radar-response:
properties: properties:
range: range:
description: The range in tiles from the rover of the radar data
type: integer type: integer
example: 5 example: 5
tiles: tiles:
description: A 1D array representing range*2 + 1 squared set of tiles, origin bottom left and in row->column order
type: array type: array
items: items:
type: integer type: integer
@ -213,15 +219,19 @@ definitions:
rover-attributes: rover-attributes:
properties: properties:
speed: speed:
description: The speed the rover can move per tick
type: integer type: integer
example: 1 example: 1
range: range:
description: The range of this rover's radar
type: integer type: integer
example: 5 example: 5
name: name:
description: The name of the rover
type: string type: string
example: rover-one example: rover-one
position: position:
description: Position of the rover in world coordinates
type: object type: object
properties: properties:
schema: schema:
@ -230,6 +240,7 @@ definitions:
rover-response: rover-response:
properties: properties:
attributes: attributes:
description: The attributes of the given rover
type: object type: object
properties: properties:
schema: schema: