From 969fa5da188d76ae4df3d757445a9f1427b1e378 Mon Sep 17 00:00:00 2001 From: Joel Brubaker Date: Sat, 15 Oct 2022 21:34:08 -0700 Subject: [PATCH] change to 3.0.0 for generator support --- models/Agent.yaml | 7 +- models/Contract.yaml | 23 +---- models/ContractDelivery.yaml | 8 +- models/Cooldown.yaml | 18 ---- models/Extraction.yaml | 7 +- models/Faction.json | 14 --- models/Meta.yaml | 6 +- models/Ship.json | 6 +- models/ShipCargoItem.json | 14 +-- models/ShipRegistration.json | 12 +-- models/Survey.yaml | 5 -- models/System.yaml | 29 ++----- models/Trade.yaml | 7 +- reference/SpaceTraders.json | 163 ++++++++--------------------------- 14 files changed, 52 insertions(+), 267 deletions(-) delete mode 100644 models/Cooldown.yaml diff --git a/models/Agent.yaml b/models/Agent.yaml index 29839da..a628421 100644 --- a/models/Agent.yaml +++ b/models/Agent.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object x-examples: example-1: @@ -23,8 +23,3 @@ required: - symbol - headquarters - credits -examples: - - accountId: cl0hok34m0003ks0jjql5q8f2 - symbol: EMBER - headquarters: X1-OE-PM - credits: 0 diff --git a/models/Contract.yaml b/models/Contract.yaml index 90a8114..fcea507 100644 --- a/models/Contract.yaml +++ b/models/Contract.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: id: @@ -72,7 +72,7 @@ x-examples: faction: COMMERCE_REPUBLIC type: PROCUREMENT terms: - deadline: "2022-03-11T05:16:59.113Z" + deadline: '2022-03-11T05:16:59.113Z' payment: onAccepted: 20000 onFulfilled: 100000 @@ -83,21 +83,4 @@ x-examples: fulfilled: 0 accepted: false fulfilled: false - expiresAt: "2022-03-09T05:16:59.112Z" -examples: - - id: cl0hok38t0014ks0jnoy8o5vh - faction: COMMERCE_REPUBLIC - type: PROCUREMENT - terms: - deadline: "2022-03-11T05:16:59.113Z" - payment: - onAccepted: 20000 - onFulfilled: 100000 - deliver: - - tradeSymbol: IRON_ORE - destination: X1-OE-PM - units: 10000 - fulfilled: 0 - accepted: false - fulfilled: false - expiresAt: "2022-03-09T05:16:59.112Z" + expiresAt: '2022-03-09T05:16:59.112Z' diff --git a/models/ContractDelivery.yaml b/models/ContractDelivery.yaml index 8d3e18b..eab93e9 100644 --- a/models/ContractDelivery.yaml +++ b/models/ContractDelivery.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: data: @@ -28,9 +28,3 @@ x-examples: destination: X1-OE-PM units: 10000 fulfilled: 500 -examples: - - data: - tradeSymbol: IRON_ORE - destination: X1-OE-PM - units: 10000 - fulfilled: 500 diff --git a/models/Cooldown.yaml b/models/Cooldown.yaml deleted file mode 100644 index 85f7efc..0000000 --- a/models/Cooldown.yaml +++ /dev/null @@ -1,18 +0,0 @@ -description: "" -type: object -properties: - duration: - type: integer - expiration: - type: string - minLength: 1 -required: - - duration - - expiration -x-examples: - example-1: - duration: 119 - expiration: "2022-03-12T00:41:29.285Z" -examples: - - duration: 119 - expiration: "2022-03-12T00:41:29.285Z" diff --git a/models/Extraction.yaml b/models/Extraction.yaml index 3b415b5..7d2943c 100644 --- a/models/Extraction.yaml +++ b/models/Extraction.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: shipSymbol: @@ -24,8 +24,3 @@ x-examples: yield: tradeSymbol: SILICON units: 16 -examples: - - shipSymbol: 4B902A-1 - yield: - tradeSymbol: SILICON - units: 16 diff --git a/models/Faction.json b/models/Faction.json index ae066d3..c383928 100644 --- a/models/Faction.json +++ b/models/Faction.json @@ -15,20 +15,6 @@ ] } }, - "examples": [ - { - "symbol": "COMMERCE_REPUBLIC", - "name": "Commerce Repubic", - "description": "The Commerce Republic takes capital from top tier worlds and invests it into new systems with high potential for growth.", - "headquarters": "X1-OE-PM", - "traits": [ - "BUREAUCRATIC", - "CAPITALISTIC", - "GUILD", - "ESTABLISHED" - ] - } - ], "properties": { "symbol": { "type": "string", diff --git a/models/Meta.yaml b/models/Meta.yaml index 53922c0..6fb23a0 100644 --- a/models/Meta.yaml +++ b/models/Meta.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: total: @@ -16,7 +16,3 @@ x-examples: total: 6 page: 1 limit: 20 -examples: - - total: 10 - page: 1 - limit: 10 diff --git a/models/Ship.json b/models/Ship.json index 7693032..04b5a75 100644 --- a/models/Ship.json +++ b/models/Ship.json @@ -5,11 +5,7 @@ "symbol": { "type": "string", "description": "The globally unique identifier of the ship in the following format: `[AGENT_SYMBOL]_[HEX_ID]`", - "minLength": 8, - "examples": [ - "FALCON_0A1", - "FALCON_00A" - ] + "minLength": 8 }, "registration": { "$ref": "./ShipRegistration.json" diff --git a/models/ShipCargoItem.json b/models/ShipCargoItem.json index 3fc82bf..a8760bd 100644 --- a/models/ShipCargoItem.json +++ b/models/ShipCargoItem.json @@ -3,20 +3,10 @@ "description": "The type of cargo item and the number of units.", "properties": { "symbol": { - "type": "string", - "examples": [ - "ORE_COPPER", - "MICROPROCESSORS", - "FOOD" - ] + "type": "string" }, "name": { - "type": "string", - "examples": [ - "Copper Ore", - "Microprocessors", - "Food" - ] + "type": "string" }, "units": { "type": "integer", diff --git a/models/ShipRegistration.json b/models/ShipRegistration.json index 8017311..8068c2a 100644 --- a/models/ShipRegistration.json +++ b/models/ShipRegistration.json @@ -10,20 +10,12 @@ "name": { "type": "string", "description": "The agent's registered name of the ship", - "minLength": 1, - "examples": [ - "Red Falcon", - "Black Pearl IV", - "The Flying Dutchman" - ] + "minLength": 1 }, "factionSymbol": { "type": "string", "description": "The symbol of the faction the ship is registered with", - "minLength": 1, - "examples": [ - "F_COMM" - ] + "minLength": 1 }, "role": { "$ref": "./ShipRole.json" diff --git a/models/Survey.yaml b/models/Survey.yaml index f45910e..11ceea6 100644 --- a/models/Survey.yaml +++ b/models/Survey.yaml @@ -21,8 +21,3 @@ required: - signature - deposits - expiration -examples: - - signature: X1-OE-D2DD38 - deposits: - - COPPER_ORE - expiration: '2022-03-08T05:41:55.514Z' diff --git a/models/System.yaml b/models/System.yaml index 8581157..fedeec8 100644 --- a/models/System.yaml +++ b/models/System.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object x-examples: example-1: @@ -6,24 +6,7 @@ x-examples: sector: X1 type: RED_STAR x: 0 - "y": 0 - waypoints: - - X1-OE-PM - - X1-OE-PM01 - - X1-OE-A005 - - X1-OE-25X - factions: - - COMMERCE_REPUBLIC - - MINERS_COLLECTIVE - - SPACERS_GUILD - charted: true - chartedBy: null -examples: - - symbol: X1-OE - sector: X1 - type: RED_STAR - x: 0 - "y": 0 + 'y': 0 waypoints: - X1-OE-PM - X1-OE-PM01 @@ -47,7 +30,7 @@ properties: minLength: 1 x: type: integer - "y": + 'y': type: integer waypoints: type: array @@ -60,15 +43,13 @@ properties: charted: type: boolean chartedBy: - type: - - string - - "null" + type: string required: - symbol - sector - type - x - - "y" + - 'y' - waypoints - factions - charted diff --git a/models/Trade.yaml b/models/Trade.yaml index 1d8b987..6931790 100644 --- a/models/Trade.yaml +++ b/models/Trade.yaml @@ -1,4 +1,4 @@ -description: "" +description: '' type: object properties: waypointSymbol: @@ -22,8 +22,3 @@ x-examples: tradeSymbol: MICROPROCESSORS credits: -843 units: 1 -examples: - - waypointSymbol: X1-OE-PM - tradeSymbol: MICROPROCESSORS - credits: 843 - units: 1 diff --git a/reference/SpaceTraders.json b/reference/SpaceTraders.json index 85969c7..a2e43f5 100644 --- a/reference/SpaceTraders.json +++ b/reference/SpaceTraders.json @@ -1,9 +1,8 @@ { - "openapi": "3.1.0", + "openapi": "3.0.0", "info": { "title": "SpaceTraders API", "version": "2.0.0-rc.2", - "summary": "[Alpha] SpaceTraders is a multiplayer sci-fi strategy game where you acquire and manage a fleet of ships.", "contact": { "name": "Joel Brubaker", "email": "joel@spacetraders.io" @@ -816,7 +815,7 @@ "$ref": "../models/Extraction.yaml" }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -824,25 +823,6 @@ "required": [ "data" ] - }, - "examples": { - "Success": { - "value": { - "data": { - "extraction": { - "shipSymbol": "4B902A-1", - "yield": { - "tradeSymbol": "SILICON", - "units": 16 - } - }, - "cooldown": { - "duration": 119, - "expiration": "2022-03-12T00:41:29.371Z" - } - } - } - } } } } @@ -853,10 +833,7 @@ "content": { "application/json": { "schema": { - "type": [ - "object", - "null" - ], + "type": "object", "properties": { "survey": { "$ref": "../models/Survey.yaml" @@ -922,7 +899,7 @@ ], "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1064,7 +1041,7 @@ } }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1169,7 +1146,7 @@ "type": "object", "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1259,7 +1236,7 @@ } }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1339,7 +1316,7 @@ ], "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -1812,7 +1789,7 @@ } }, "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } }, "required": [ @@ -1823,7 +1800,7 @@ { "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" }, "system": { "$ref": "../models/System.yaml" @@ -1833,7 +1810,7 @@ { "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" }, "waypoint": { "$ref": "../models/Waypoint.json" @@ -1911,7 +1888,7 @@ "type": "object", "properties": { "cooldown": { - "$ref": "../models/Cooldown.yaml" + "$ref": "../models/Cooldown.json" } } } @@ -2179,7 +2156,12 @@ "description": "Attempt to negotiate with the faction at a waypoint. The request will only succeed if the waypoint is a negotiable location, and your ship is capable of negotiating using an envoy.", "tags": [ "ships" - ] + ], + "responses": { + "200": { + "description": "" + } + } } }, "/my/contracts": { @@ -2544,8 +2526,7 @@ "MINERS_COLLECTIVE", "SPACERS_GUILD" ], - "charted": true, - "chartedBy": null + "charted": true } ], "meta": { @@ -2630,8 +2611,7 @@ "y": 9, "waypoints": [], "factions": [], - "charted": false, - "chartedBy": null + "charted": false } } } @@ -2818,94 +2798,9 @@ "schema": { "description": "", "type": "object", - "x-examples": { - "example-1": { - "data": [ - { - "system": "X1-OE", - "symbol": "X1-OE-PM", - "type": "PLANET", - "x": 10, - "y": 5, - "orbitals": [ - "X1-OE-PM01" - ], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE", - "SHIPYARD" - ], - "traits": [ - "OVERCROWDED", - "HIGH_TECH", - "BUREAUCRATIC", - "TRADING_HUB", - "TEMPERATE" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-PM01", - "type": "MOON", - "x": 10, - "y": 5, - "orbitals": [], - "faction": "COMMERCE_REPUBLIC", - "features": [ - "MARKETPLACE" - ], - "traits": [ - "WEAK_GRAVITY" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-A005", - "type": "ASTEROID_FIELD", - "x": -1, - "y": -29, - "orbitals": [], - "faction": "MINERS_COLLECTIVE", - "features": [], - "traits": [ - "COMMON_METAL_DEPOSITS" - ], - "charted": true, - "chartedBy": null - }, - { - "system": "X1-OE", - "symbol": "X1-OE-25X", - "type": "JUMP_GATE", - "x": -38, - "y": 47, - "orbitals": [], - "faction": "SPACERS_GUILD", - "features": [], - "traits": [], - "charted": true, - "chartedBy": null - } - ], - "meta": { - "total": 4, - "page": 1, - "limit": 20 - } - } - }, "properties": { "data": { - "type": "array", - "uniqueItems": true, - "minItems": 1, - "items": { - "$ref": "../models/Waypoint.json" - } + "$ref": "../models/Waypoint.json" }, "meta": { "$ref": "../models/Meta.yaml" @@ -2920,7 +2815,7 @@ } } }, - "operationId": "get-systems-systemSymbol-waypoints", + "operationId": "get-system-waypoint", "security": [ { "AgentToken": [] @@ -3057,7 +2952,12 @@ "tags": [ "factions" ], - "operationId": "get-factions" + "operationId": "get-factions", + "responses": { + "200": { + "description": "" + } + } } }, "/factions/{factionSymbol}": { @@ -3079,7 +2979,12 @@ "factions" ], "operationId": "get-factions-factionSymbol", - "description": "View the details of a faction." + "description": "View the details of a faction.", + "responses": { + "200": { + "description": "" + } + } } } },