From 19728e019cd53d34794f307f7b06327fbaa0e50f Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Sat, 17 Dec 2022 09:32:19 -0800 Subject: [PATCH] update scan endpoints --- models/ScannedSystem.json | 34 +++++++++ models/SystemWaypoint.json | 10 ++- reference/SpaceTraders.json | 144 +++++++++++++++++++----------------- 3 files changed, 119 insertions(+), 69 deletions(-) create mode 100644 models/ScannedSystem.json diff --git a/models/ScannedSystem.json b/models/ScannedSystem.json new file mode 100644 index 0000000..504c1c0 --- /dev/null +++ b/models/ScannedSystem.json @@ -0,0 +1,34 @@ +{ + "description": "", + "type": "object", + "properties": { + "symbol": { + "type": "string", + "minLength": 1 + }, + "sectorSymbol": { + "type": "string", + "minLength": 1 + }, + "type": { + "$ref": "./SystemType.json" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" + }, + "distance": { + "type": "integer" + } + }, + "required": [ + "symbol", + "sectorSymbol", + "type", + "x", + "y", + "distance" + ] +} \ No newline at end of file diff --git a/models/SystemWaypoint.json b/models/SystemWaypoint.json index 39c74e1..8ca378c 100644 --- a/models/SystemWaypoint.json +++ b/models/SystemWaypoint.json @@ -6,10 +6,18 @@ }, "type": { "$ref": "./WaypointType.json" + }, + "x": { + "type": "integer" + }, + "y": { + "type": "integer" } }, "required": [ "symbol", - "type" + "type", + "x", + "y" ] } \ No newline at end of file diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index bb4e65f..3be2869 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1738,7 +1738,7 @@ ] } }, - "/my/ships/{shipSymbol}/scan": { + "/my/ships/{shipSymbol}/scan/systems": { "parameters": [ { "in": "path", @@ -1750,43 +1750,8 @@ } ], "post": { - "description": "Activate your ship's sensor arrays to scan for arriving ships, departing ships, system information, or waypoint information. Send a scan mode to select the type of scan performed by your ship.", - "operationId": "create-ship-scan", - "requestBody": { - "content": { - "application/json": { - "examples": { - "Approaching Ships": { - "value": { - "mode": "APPROACHING_SHIPS" - } - }, - "Departing Ships": { - "value": { - "mode": "DEPARTING_SHIPS" - } - } - }, - "schema": { - "properties": { - "mode": { - "enum": [ - "APPROACHING_SHIPS", - "DEPARTING_SHIPS", - "WAYPOINT" - ], - "type": "string" - } - }, - "required": [ - "mode" - ], - "type": "object" - } - } - }, - "description": "" - }, + "description": "Activate your ship's sensor arrays to scan for system information.", + "operationId": "create-ship-system-scan", "responses": { "201": { "content": { @@ -1795,38 +1760,20 @@ "description": "", "properties": { "data": { - "oneOf": [ - { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "ships": { - "items": { - "$ref": "../models/ScannedShip.json" - }, - "type": "array" - } - }, - "required": [ - "ships", - "cooldown" - ] + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" }, - { - "properties": { - "cooldown": { - "$ref": "../models/Cooldown.json" - }, - "waypoint": { - "$ref": "../models/Waypoint.json" - } + "systems": { + "items": { + "$ref": "../models/ScannedSystem.json" }, - "required": [ - "cooldown", - "waypoint" - ] + "type": "array" } + }, + "required": [ + "cooldown", + "systems" ], "type": "object" } @@ -1846,7 +1793,68 @@ "AgentToken": [] } ], - "summary": "Scan", + "summary": "Scan Systems", + "tags": [ + "fleet" + ] + } + }, + "/my/ships/{shipSymbol}/scan/ships": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Activate your ship's sensor arrays to scan for ship information.", + "operationId": "create-ship-ship-scan", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "description": "", + "properties": { + "data": { + "properties": { + "cooldown": { + "$ref": "../models/Cooldown.json" + }, + "ships": { + "items": { + "$ref": "../models/ScannedShip.json" + }, + "type": "array" + } + }, + "required": [ + "cooldown", + "ships" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Scan Ships", "tags": [ "fleet" ]