From ccbbedd73f2b4034c4a2567b07551319c1b8a815 Mon Sep 17 00:00:00 2001 From: Keith Jackson Date: Sat, 16 Dec 2023 08:46:48 -0800 Subject: [PATCH 1/5] Remove $ref siblings, Agent.shipCount NOT optional, typos (#82) * Typo and descriptions * Remove $ref suiblings. * missed one when refactoring ShipNavRouteWaypointDeprecated to keep deprecated flag. * Agent.shipCount always seems to be returned. Why would this be optional? --- models/Agent.json | 3 +- models/Chart.json | 3 +- models/Contract.json | 3 +- models/ContractPayment.json | 1 + models/ContractTerms.json | 5 ++-- models/Extraction.json | 3 +- models/ExtractionYield.json | 3 +- models/Faction.json | 3 +- models/MarketTransaction.json | 3 +- models/ScannedWaypoint.json | 6 ++-- models/ShipNav.json | 6 ++-- models/ShipNavRoute.json | 4 +-- models/ShipNavRouteWaypoint.json | 3 +- models/ShipNavRouteWaypointDeprecated.json | 33 ++++++++++++++++++++++ models/ShipyardTransaction.json | 3 +- models/Siphon.json | 3 +- models/SiphonYield.json | 3 +- models/SystemSymbol.json | 1 + models/SystemWaypoint.json | 3 +- models/Waypoint.json | 6 ++-- models/WaypointSymbol.json | 1 + reference/SpaceTraders.json | 3 +- 22 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 models/ShipNavRouteWaypointDeprecated.json diff --git a/models/Agent.json b/models/Agent.json index 610526e..fb0dee4 100644 --- a/models/Agent.json +++ b/models/Agent.json @@ -37,6 +37,7 @@ "symbol", "headquarters", "credits", - "startingFaction" + "startingFaction", + "shipCount" ] } diff --git a/models/Chart.json b/models/Chart.json index 66c6063..35b116a 100644 --- a/models/Chart.json +++ b/models/Chart.json @@ -3,8 +3,7 @@ "description": "The chart of a system or waypoint, which makes the location visible to other agents.", "properties": { "waypointSymbol": { - "$ref": "./WaypointSymbol.json", - "description": "The symbol of the waypoint." + "$ref": "./WaypointSymbol.json" }, "submittedBy": { "type": "string", diff --git a/models/Contract.json b/models/Contract.json index 34b3c7f..7c20521 100644 --- a/models/Contract.json +++ b/models/Contract.json @@ -22,8 +22,7 @@ "description": "Type of contract." }, "terms": { - "$ref": "./ContractTerms.json", - "description": "The terms to fulfill the contract." + "$ref": "./ContractTerms.json" }, "accepted": { "type": "boolean", diff --git a/models/ContractPayment.json b/models/ContractPayment.json index a102adf..2146492 100644 --- a/models/ContractPayment.json +++ b/models/ContractPayment.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Payments for the contract.", "properties": { "onAccepted": { "type": "integer", diff --git a/models/ContractTerms.json b/models/ContractTerms.json index 8ca9028..f7d37cb 100644 --- a/models/ContractTerms.json +++ b/models/ContractTerms.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "Terms of the contract needed to fulfill it.", + "description": "The terms to fulfill the contract.", "properties": { "deadline": { "type": "string", @@ -8,8 +8,7 @@ "description": "The deadline for the contract." }, "payment": { - "$ref": "./ContractPayment.json", - "description": "Payments for the contract." + "$ref": "./ContractPayment.json" }, "deliver": { "type": "array", diff --git a/models/Extraction.json b/models/Extraction.json index 1f9d8e1..d82a142 100644 --- a/models/Extraction.json +++ b/models/Extraction.json @@ -8,8 +8,7 @@ "description": "Symbol of the ship that executed the extraction." }, "yield": { - "$ref": "./ExtractionYield.json", - "description": "Yields from the extract operation." + "$ref": "./ExtractionYield.json" } }, "required": [ diff --git a/models/ExtractionYield.json b/models/ExtractionYield.json index e52f87e..e52e4f8 100644 --- a/models/ExtractionYield.json +++ b/models/ExtractionYield.json @@ -3,8 +3,7 @@ "description": "A yield from the extraction operation.", "properties": { "symbol": { - "$ref": "./TradeSymbol.json", - "description": "Symbol of the good that was extracted." + "$ref": "./TradeSymbol.json" }, "units": { "type": "integer", diff --git a/models/Faction.json b/models/Faction.json index 563c69b..8dee6f8 100644 --- a/models/Faction.json +++ b/models/Faction.json @@ -3,8 +3,7 @@ "type": "object", "properties": { "symbol": { - "$ref": "./FactionSymbol.json", - "description": "Faction symbol." + "$ref": "./FactionSymbol.json" }, "name": { "type": "string", diff --git a/models/MarketTransaction.json b/models/MarketTransaction.json index 132aca9..b6216eb 100644 --- a/models/MarketTransaction.json +++ b/models/MarketTransaction.json @@ -2,8 +2,7 @@ "type": "object", "properties": { "waypointSymbol": { - "$ref": "./WaypointSymbol.json", - "description": "The symbol of the waypoint where the transaction took place." + "$ref": "./WaypointSymbol.json" }, "shipSymbol": { "type": "string", diff --git a/models/ScannedWaypoint.json b/models/ScannedWaypoint.json index b75593a..96ac311 100644 --- a/models/ScannedWaypoint.json +++ b/models/ScannedWaypoint.json @@ -3,15 +3,13 @@ "type": "object", "properties": { "symbol": { - "$ref": "./WaypointSymbol.json", - "description": "Symbol of the waypoint." + "$ref": "./WaypointSymbol.json" }, "type": { "$ref": "./WaypointType.json" }, "systemSymbol": { - "$ref": "./SystemSymbol.json", - "description": "Symbol of the system." + "$ref": "./SystemSymbol.json" }, "x": { "type": "integer", diff --git a/models/ShipNav.json b/models/ShipNav.json index 5fe1e91..d8e5bcd 100644 --- a/models/ShipNav.json +++ b/models/ShipNav.json @@ -3,12 +3,10 @@ "description": "The navigation information of the ship.", "properties": { "systemSymbol": { - "$ref": "./SystemSymbol.json", - "description": "The system symbol of the ship's current location." + "$ref": "./SystemSymbol.json" }, "waypointSymbol": { - "$ref": "./WaypointSymbol.json", - "description": "The waypoint symbol of the ship's current location, or if the ship is in-transit, the waypoint symbol of the ship's destination." + "$ref": "./WaypointSymbol.json" }, "route": { "$ref": "./ShipNavRoute.json" diff --git a/models/ShipNavRoute.json b/models/ShipNavRoute.json index 31b475e..75ad424 100644 --- a/models/ShipNavRoute.json +++ b/models/ShipNavRoute.json @@ -6,9 +6,7 @@ "$ref": "./ShipNavRouteWaypoint.json" }, "departure": { - "deprecated": true, - "description": "Deprecated. Use origin instead.", - "$ref": "./ShipNavRouteWaypoint.json" + "$ref": "./ShipNavRouteWaypointDeprecated.json" }, "origin": { "$ref": "./ShipNavRouteWaypoint.json" diff --git a/models/ShipNavRouteWaypoint.json b/models/ShipNavRouteWaypoint.json index ce706ef..431f41d 100644 --- a/models/ShipNavRouteWaypoint.json +++ b/models/ShipNavRouteWaypoint.json @@ -11,8 +11,7 @@ "$ref": "./WaypointType.json" }, "systemSymbol": { - "$ref": "./SystemSymbol.json", - "description": "The symbol of the system the waypoint is in." + "$ref": "./SystemSymbol.json" }, "x": { "type": "integer", diff --git a/models/ShipNavRouteWaypointDeprecated.json b/models/ShipNavRouteWaypointDeprecated.json new file mode 100644 index 0000000..654fee7 --- /dev/null +++ b/models/ShipNavRouteWaypointDeprecated.json @@ -0,0 +1,33 @@ +{ + "type": "object", + "deprecated": true, + "description": "Deprecated. Use origin instead.", + "properties": { + "symbol": { + "type": "string", + "minLength": 1, + "description": "The symbol of the waypoint." + }, + "type": { + "$ref": "./WaypointType.json" + }, + "systemSymbol": { + "$ref": "./SystemSymbol.json" + }, + "x": { + "type": "integer", + "description": "Position in the universe in the x axis." + }, + "y": { + "type": "integer", + "description": "Position in the universe in the y axis." + } + }, + "required": [ + "symbol", + "type", + "systemSymbol", + "x", + "y" + ] +} \ No newline at end of file diff --git a/models/ShipyardTransaction.json b/models/ShipyardTransaction.json index 5e5c481..969df36 100644 --- a/models/ShipyardTransaction.json +++ b/models/ShipyardTransaction.json @@ -3,8 +3,7 @@ "description": "Results of a transaction with a shipyard.", "properties": { "waypointSymbol": { - "$ref": "./WaypointSymbol.json", - "description": "The symbol of the waypoint where the transaction took place." + "$ref": "./WaypointSymbol.json" }, "shipSymbol": { "type": "string", diff --git a/models/Siphon.json b/models/Siphon.json index ecfc693..8430ad2 100644 --- a/models/Siphon.json +++ b/models/Siphon.json @@ -8,8 +8,7 @@ "description": "Symbol of the ship that executed the siphon." }, "yield": { - "$ref": "./SiphonYield.json", - "description": "Yields from the siphon operation." + "$ref": "./SiphonYield.json" } }, "required": [ diff --git a/models/SiphonYield.json b/models/SiphonYield.json index 6a126d2..cfec4b2 100644 --- a/models/SiphonYield.json +++ b/models/SiphonYield.json @@ -3,8 +3,7 @@ "description": "A yield from the siphon operation.", "properties": { "symbol": { - "$ref": "./TradeSymbol.json", - "description": "Symbol of the good that was siphoned." + "$ref": "./TradeSymbol.json" }, "units": { "type": "integer", diff --git a/models/SystemSymbol.json b/models/SystemSymbol.json index e23d267..a6f5d54 100644 --- a/models/SystemSymbol.json +++ b/models/SystemSymbol.json @@ -1,5 +1,6 @@ { "type": "string", + "description": "The symbol of the system.", "minLength": 1, "x-faker": { "fake": ["X1-{{random.alphaNumeric(5)}}"] diff --git a/models/SystemWaypoint.json b/models/SystemWaypoint.json index b1eea05..832a750 100644 --- a/models/SystemWaypoint.json +++ b/models/SystemWaypoint.json @@ -2,8 +2,7 @@ "type": "object", "properties": { "symbol": { - "$ref": "./WaypointSymbol.json", - "description": "The symbol of the waypoint." + "$ref": "./WaypointSymbol.json" }, "type": { "$ref": "./WaypointType.json" diff --git a/models/Waypoint.json b/models/Waypoint.json index 6b195f0..baca3de 100644 --- a/models/Waypoint.json +++ b/models/Waypoint.json @@ -3,15 +3,13 @@ "type": "object", "properties": { "symbol": { - "$ref": "./WaypointSymbol.json", - "description": "Symbol fo the waypoint." + "$ref": "./WaypointSymbol.json" }, "type": { "$ref": "./WaypointType.json" }, "systemSymbol": { - "$ref": "./SystemSymbol.json", - "description": "The symbol of the system this waypoint belongs to." + "$ref": "./SystemSymbol.json" }, "x": { "type": "integer", diff --git a/models/WaypointSymbol.json b/models/WaypointSymbol.json index 27a1d67..a31555e 100644 --- a/models/WaypointSymbol.json +++ b/models/WaypointSymbol.json @@ -1,5 +1,6 @@ { "type": "string", + "description": "The symbol of the waypoint.", "minLength": 1, "x-faker": { "fake": ["X1-{{random.alphaNumeric(5)}}-{{random.alphaNumeric(5)}}"] diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 22b08ab..dc24243 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -254,8 +254,7 @@ "schema": { "properties": { "faction": { - "$ref": "../models/FactionSymbol.json", - "example": "COSMIC" + "$ref": "../models/FactionSymbol.json" }, "symbol": { "description": "Your desired agent symbol. This will be a unique name used to represent your agent, and will be the prefix for your ships.", From 32aa98a060d501f0444eaf1512b9cd0cbe13f3f1 Mon Sep 17 00:00:00 2001 From: SpaceAdmiral Date: Thu, 7 Dec 2023 08:23:52 -0800 Subject: [PATCH 2/5] deprecate: shipSymbol in favor of shipType --- models/ShipyardTransaction.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/models/ShipyardTransaction.json b/models/ShipyardTransaction.json index 969df36..d1be15a 100644 --- a/models/ShipyardTransaction.json +++ b/models/ShipyardTransaction.json @@ -6,6 +6,11 @@ "$ref": "./WaypointSymbol.json" }, "shipSymbol": { + "type": "string", + "deprecated": true, + "description": "The symbol of the ship that was the subject of the transaction." + }, + "shipType": { "type": "string", "description": "The symbol of the ship that was the subject of the transaction." }, @@ -27,6 +32,7 @@ "required": [ "waypointSymbol", "shipSymbol", + "shipType", "price", "agentSymbol", "timestamp" From 50561de0535618751fc3e14f091e40464a0e93d4 Mon Sep 17 00:00:00 2001 From: SpaceAdmiral Date: Sat, 16 Dec 2023 08:41:39 -0800 Subject: [PATCH 3/5] update: add agent to jump response --- reference/SpaceTraders.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index dc24243..0981c70 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -2490,12 +2490,16 @@ }, "transaction": { "$ref": "../models/MarketTransaction.json" + }, + "agent": { + "$ref": "../models/Agent.json" } }, "required": [ "nav", "cooldown", - "transaction" + "transaction", + "agent" ], "type": "object" } From 92d951578a63db1285786319da700593ed5dfb51 Mon Sep 17 00:00:00 2001 From: SpaceAdmiral Date: Sat, 16 Dec 2023 08:49:38 -0800 Subject: [PATCH 4/5] breaking: remove deprecated prop departure on ShipNavRoute in favor or origin --- models/ShipNavRoute.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/models/ShipNavRoute.json b/models/ShipNavRoute.json index 75ad424..c5d074b 100644 --- a/models/ShipNavRoute.json +++ b/models/ShipNavRoute.json @@ -5,9 +5,6 @@ "destination": { "$ref": "./ShipNavRouteWaypoint.json" }, - "departure": { - "$ref": "./ShipNavRouteWaypointDeprecated.json" - }, "origin": { "$ref": "./ShipNavRouteWaypoint.json" }, From beecdb0453f1532b14506ffe62faf976e08f2b43 Mon Sep 17 00:00:00 2001 From: SpaceAdmiral Date: Sat, 16 Dec 2023 08:51:46 -0800 Subject: [PATCH 5/5] update: add symbol to jump gate --- models/JumpGate.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/models/JumpGate.json b/models/JumpGate.json index ca9203e..2b378a5 100644 --- a/models/JumpGate.json +++ b/models/JumpGate.json @@ -2,6 +2,9 @@ "type": "object", "description": "", "properties": { + "symbol": { + "$ref": "./WaypointSymbol.json" + }, "connections": { "type": "array", "description": "All the gates that are connected to this waypoint.", @@ -12,6 +15,7 @@ } }, "required": [ + "symbol", "connections" ] } \ No newline at end of file