From 754b5784386a0601f5fd0ad6c601698c6e09e572 Mon Sep 17 00:00:00 2001 From: Space Admiral Date: Fri, 16 Dec 2022 19:03:59 -0800 Subject: [PATCH] add transfer endpoint, tweaks to market --- models/Market.json | 8 ++-- models/Waypoint.json | 2 +- reference/SpaceTraders.json | 95 ++++++++++++++++++++++++++++++++++++- 3 files changed, 97 insertions(+), 8 deletions(-) diff --git a/models/Market.json b/models/Market.json index 141e8d1..dca15cf 100644 --- a/models/Market.json +++ b/models/Market.json @@ -34,14 +34,14 @@ }, "transactions": { "type": "array", - "description": "The list of recent transactions at this market.", + "description": "The list of recent transactions at this market. Visible only when a ship is present at the market.", "items": { "$ref": "./MarketTransaction.json" } }, "tradeGoods": { "type": "array", - "description": "The list of goods that are traded at this market.", + "description": "The list of goods that are traded at this market. Visible only when a ship is present at the market.", "items": { "$ref": "./MarketTradeGood.json" } @@ -50,8 +50,6 @@ "required": [ "symbol", "exports", - "imports", - "transactions", - "tradeGoods" + "imports" ] } \ No newline at end of file diff --git a/models/Waypoint.json b/models/Waypoint.json index 50aaf18..b0ab1a2 100644 --- a/models/Waypoint.json +++ b/models/Waypoint.json @@ -26,7 +26,7 @@ } }, "faction": { - "$ref": "./Faction.json" + "$ref": "./WaypointFaction.json" }, "traits": { "type": "array", diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index d905571..a95ecd3 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -68,9 +68,19 @@ "schema": { "properties": { "faction": { - "default": "COMMERCE_REPUBLIC", "description": "The faction you choose determines your headquarters.", - "type": "string" + "enum": [ + "COSMIC", + "VOID", + "GALLACTIC", + "QUANTUM", + "DOMINION", + "ASTRO", + "CORSAIRS", + "UNITED", + "SOLITARY", + "COBALT" + ] }, "symbol": { "description": "How other agents will see your ships and information.", @@ -1984,6 +1994,87 @@ "fleet" ] } + }, + "/my/ships/{shipSymbol}/transfer": { + "parameters": [ + { + "in": "path", + "name": "shipSymbol", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "description": "Transfer cargo between ships.", + "operationId": "transfer-cargo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "title": "Transfer Cargo Request", + "properties": { + "tradeSymbol": { + "type": "string" + }, + "units": { + "type": "integer" + }, + "shipSymbol": { + "type": "string" + } + }, + "required": [ + "tradeSymbol", + "units", + "shipSymbol" + ], + "type": "object" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "title": "Transfer Cargo 200 Response", + "description": "", + "properties": { + "data": { + "properties": { + "cargo": { + "$ref": "../models/ShipCargo.json" + } + }, + "required": [ + "cargo" + ], + "type": "object" + } + }, + "required": [ + "data" + ], + "type": "object" + } + } + }, + "description": "Created" + } + }, + "security": [ + { + "AgentToken": [] + } + ], + "summary": "Transfer Cargo", + "tags": [ + "fleet" + ] + } } } } \ No newline at end of file