From 341f159b7cd423351717db86c518ddfdb3c93086 Mon Sep 17 00:00:00 2001 From: Jonathan Harris Date: Thu, 6 Oct 2016 11:10:24 +0100 Subject: [PATCH] Retire v2 commodities schema and v1 outfitting and shipyard schemas. --- schemas/commodity-v2.0.json | 96 --------------------------- schemas/outfitting-v1.0.json | 121 ----------------------------------- schemas/shipyard-v1.0.json | 61 ------------------ src/eddn/conf/Settings.py | 16 ++--- 4 files changed, 8 insertions(+), 286 deletions(-) delete mode 100644 schemas/commodity-v2.0.json delete mode 100644 schemas/outfitting-v1.0.json delete mode 100644 schemas/shipyard-v1.0.json diff --git a/schemas/commodity-v2.0.json b/schemas/commodity-v2.0.json deleted file mode 100644 index 68efc4c..0000000 --- a/schemas/commodity-v2.0.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema#", - "id" : "http://schemas.elite-markets.net/eddn/commodity/2#", - "type" : "object", - "additionalProperties" : false, - "required": [ "$schemaRef", "header", "message" ], - "properties": { - "$schemaRef": { - "type" : "string" - }, - "header": { - "type" : "object", - "additionalProperties" : true, - "required" : [ "uploaderID", "softwareName", "softwareVersion" ], - "properties" : { - "uploaderID": { - "type" : "string" - }, - "softwareName": { - "type" : "string" - }, - "softwareVersion": { - "type" : "string" - }, - "gatewayTimestamp": { - "type" : "string", - "format" : "date-time", - "description" : "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property." - } - } - }, - "message": { - "type" : "object", - "additionalProperties" : false, - "required" : [ "systemName", "stationName", "timestamp", "commodities" ], - "properties" : { - "systemName": { - "type" : "string", - "minLength" : 1 - }, - "stationName": { - "type" : "string", - "minLength" : 1 - }, - "timestamp": { - "type" : "string", - "format" : "date-time" - }, - "commodities": { - "type" : "array", - "minItems" : 1, - "items" : { - "oneOf" : [ - { - "type" : "object", - "additionalProperties" : false, - "required" : [ "name", "buyPrice", "supply", "sellPrice", "demand" ], - "properties" : { - "name": { - "type" :"string", - "minLength" :1 - }, - "buyPrice": { - "type" :"integer", - "description" :"Price to buy from the market" - }, - "supply": { - "type" : "integer" - }, - "supplyLevel": { - "$ref" : "#/definitions/levelType" - }, - "sellPrice": { - "type" : "integer", - "description" : "Price to sell to the market" - }, - "demand":{ - "type":"integer" - }, - "demandLevel":{ - "$ref":"#/definitions/levelType" - } - } - } - ] - } - } - } - } - }, - "definitions": { - "levelType": { - "enum": [ "Low", "Med", "High" ] - } - } -} \ No newline at end of file diff --git a/schemas/outfitting-v1.0.json b/schemas/outfitting-v1.0.json deleted file mode 100644 index b0cf30b..0000000 --- a/schemas/outfitting-v1.0.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema#", - "id" : "http://schemas.elite-markets.net/eddn/outfitting/1#", - "type" : "object", - "additionalProperties" : false, - "required" : [ "$schemaRef", "header", "message" ], - "properties" : { - "$schemaRef" : { "type": "string" }, - - "header" : { - "type" : "object", - "additionalProperties" : true, - "required": [ "uploaderID", "softwareName", "softwareVersion" ], - "properties" : { - "uploaderID" : { "type": "string" }, - "softwareName" : { "type": "string" }, - "softwareVersion" : { "type": "string" }, - "gatewayTimestamp" : { - "type": "string", - "format": "date-time", - "description": "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property." - } - } - }, - - "message": { - "type": "object", - "additionalProperties": false, - "required": [ "systemName", "stationName", "timestamp", "modules" ], - "properties": { - "systemName": { - "type" : "string", - "minLength" : 1 - }, - "stationName": { - "type" : "string", - "minLength" : 1 - }, - "timestamp": { - "type" : "string", - "format" : "date-time" - }, - "modules": { - "type" : "array", - "description" : "List of available modules in English as displayed in-game. Modules that depend on the Cmdr's purchases (e.g. paintjobs) or rank (e.g. decals and PowerPlay faction-specific modules) should be omitted.", - "uniqueItems" : true, - "items" : { - "oneOf": [ - { - "type" : "object", - "properties" : { - "category" : { "enum": [ "hardpoint" ] }, - "name" : { "type": "string", "minLength": 1 }, - "mount" : { "$ref": "#/definitions/mount" }, - "guidance" : { "$ref": "#/definitions/guidance" }, - "class" : { "$ref": "#/definitions/class" }, - "rating" : { "$ref": "#/definitions/rating" } - }, - "required" : [ "category", "name", "mount", "class", "rating" ], - "additionalProperties" : false - }, - { - "type" : "object", - "properties" : { - "category" : { "enum": [ "utility" ] }, - "name" : { "type": "string", "minLength": 1 }, - "class" : { "$ref": "#/definitions/class" }, - "rating" : { "$ref": "#/definitions/rating" } - }, - "required" : [ "category", "name", "class", "rating" ], - "additionalProperties" : false - }, - { - "type" : "object", - "properties" : { - "category" : { "enum": [ "standard" ] }, - "name" : { "type": "string", "minLength": 1 }, - "ship" : { "type": "string", - "minLength" : 1, - "description" : "For ship-specific modules (e.g. armour) must be one of the ship names defined in http://schemas.elite-markets.net/eddn/shipyard/1" }, - "class" : { "$ref": "#/definitions/class" }, - "rating" : { "$ref": "#/definitions/rating" } - }, - "required" : [ "category", "name", "class", "rating" ], - "additionalProperties" : false - }, - { - "type" : "object", - "properties" : { - "category" : { "enum": [ "internal" ] }, - "name" : { "type": "string", "minLength": 1 }, - "class" : { "$ref": "#/definitions/class" }, - "rating" : { "$ref": "#/definitions/rating" } - }, - "required" : [ "category", "name", "class", "rating" ], - "additionalProperties" : false - } - ] - } - } - } - } - }, - - "definitions": { - "class": { - "enum": [ "0", "1", "2", "3", "4", "5", "6", "7", "8" ] - }, - "rating": { - "enum": [ "I", "A", "B", "C", "D", "E", "F", "G", "H" ] - }, - "mount": { - "enum": [ "Fixed", "Gimballed", "Turreted" ], - "description": "Weapon mounting mode" - }, - "guidance": { - "enum": [ "Dumbfire", "Seeker" ], - "description": "Missile and Torpedo weapon guidance mode" - } - } -} diff --git a/schemas/shipyard-v1.0.json b/schemas/shipyard-v1.0.json deleted file mode 100644 index 2ac2996..0000000 --- a/schemas/shipyard-v1.0.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$schema" : "http://json-schema.org/draft-04/schema#", - "id" : "http://schemas.elite-markets.net/eddn/shipyard/1#", - "type" : "object", - "additionalProperties" : false, - "required" : [ "$schemaRef", "header", "message" ], - "properties" : { - "$schemaRef": { - "type" : "string" - }, - "header": { - "type" : "object", - "additionalProperties" : true, - "required" : [ "uploaderID", "softwareName", "softwareVersion" ], - "properties" : { - "uploaderID": { - "type" : "string" - }, - "softwareName": { - "type" : "string" - }, - "softwareVersion": { - "type" : "string" - }, - "gatewayTimestamp": { - "type" : "string", - "format" : "date-time", - "description" : "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property." - } - } - }, - "message": { - "type" : "object", - "additionalProperties" : false, - "required" : [ "systemName", "stationName", "timestamp", "ships" ], - "properties" : { - "systemName": { - "type" : "string", - "minLength" : 1 - }, - "stationName": { - "type" : "string", - "minLength" : 1 - }, - "timestamp": { - "type" : "string", - "format" : "date-time" - }, - "ships": { - "type" : "array", - "uniqueItems" : true, - "items" : { - "type" : "string", - "minLength" : 1, - "description" : "Ship name in English as displayed in-game. i.e. one of: Adder, Anaconda, Asp, Asp Scout, Cobra Mk III, Cobra MkIV, DiamondBack Scout, Diamondback Explorer, Eagle, Federal Assault Ship, Federal Corvette, Federal Dropship, Federal Gunship, Fer-de-Lance, Hauler, Imperial Clipper, Imperial Courier, Imperial Cutter, Imperial Eagle, Keelback, Orca, Python, Sidewinder, Type-6 Transporter, Type-7 Transporter, Type-9 Heavy, Viper, Viper MkIV, Vulture" - } - } - } - } - } -} diff --git a/src/eddn/conf/Settings.py b/src/eddn/conf/Settings.py index d9d2c3b..fc6beff 100644 --- a/src/eddn/conf/Settings.py +++ b/src/eddn/conf/Settings.py @@ -39,18 +39,12 @@ class _Settings(object): GATEWAY_IP_KEY_SALT = None GATEWAY_JSON_SCHEMAS = { - "http://schemas.elite-markets.net/eddn/commodity/2": "schemas/commodity-v2.0.json", - "http://schemas.elite-markets.net/eddn/commodity/2/test": "schemas/commodity-v2.0.json", "http://schemas.elite-markets.net/eddn/commodity/3": "schemas/commodity-v3.0.json", "http://schemas.elite-markets.net/eddn/commodity/3/test": "schemas/commodity-v3.0.json", - "http://schemas.elite-markets.net/eddn/shipyard/1": "schemas/shipyard-v1.0.json", - "http://schemas.elite-markets.net/eddn/shipyard/1/test": "schemas/shipyard-v1.0.json", "http://schemas.elite-markets.net/eddn/shipyard/2": "schemas/shipyard-v2.0.json", "http://schemas.elite-markets.net/eddn/shipyard/2/test": "schemas/shipyard-v2.0.json", - "http://schemas.elite-markets.net/eddn/outfitting/1": "schemas/outfitting-v1.0.json", - "http://schemas.elite-markets.net/eddn/outfitting/1/test": "schemas/outfitting-v1.0.json", "http://schemas.elite-markets.net/eddn/outfitting/2": "schemas/outfitting-v2.0.json", "http://schemas.elite-markets.net/eddn/outfitting/2/test": "schemas/outfitting-v2.0.json", @@ -58,12 +52,18 @@ class _Settings(object): "http://schemas.elite-markets.net/eddn/blackmarket/1/test": "schemas/blackmarket-v1.0.json", "http://schemas.elite-markets.net/eddn/journal/1": "schemas/journal-v1.0.json", - "http://schemas.elite-markets.net/eddn/journal/1/test": "schemas/journal-v1.0.json" + "http://schemas.elite-markets.net/eddn/journal/1/test": "schemas/journal-v1.0.json", } GATEWAY_OUTDATED_SCHEMAS = [ "http://schemas.elite-markets.net/eddn/commodity/1", - "http://schemas.elite-markets.net/eddn/commodity/1/test" + "http://schemas.elite-markets.net/eddn/commodity/1/test", + "http://schemas.elite-markets.net/eddn/commodity/2", + "http://schemas.elite-markets.net/eddn/commodity/2/test", + "http://schemas.elite-markets.net/eddn/outfitting/1", + "http://schemas.elite-markets.net/eddn/outfitting/1/test", + "http://schemas.elite-markets.net/eddn/shipyard/1", + "http://schemas.elite-markets.net/eddn/shipyard/1/test", ] ###############################################################################