diff --git a/schemas/journal-v1.0.json b/schemas/journal-v1.0.json new file mode 100644 index 0000000..2df857a --- /dev/null +++ b/schemas/journal-v1.0.json @@ -0,0 +1,65 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema#", + "id" : "http://schemas.elite-markets.net/eddn/journal/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", + "description" : "Contains all properties from the listed events in the client's journal minus Localised strings and the properties marked below as 'disallowed'", + "additionalProperties" : true, + "required" : [ "timestamp", "event", "StarSystem" ], + "properties" : { + "timestamp": { + "type" : "string", + "format" : "date-time" + }, + "event" : { + "enum" : [ "Docked", "FSDJump", "Scan" ] + }, + "StarSystem": { + "type" : "string", + "minLength" : 1, + "description" : "Must be added by the sender if not present in the journal event" + }, + + "CockpitBreach" : { "$ref" : "#/definitions/disallowed" }, + "BoostUsed" : { "$ref" : "#/definitions/disallowed" }, + "FuelLevel" : { "$ref" : "#/definitions/disallowed" }, + "FuelUsed" : { "$ref" : "#/definitions/disallowed" }, + "JumpDist" : { "$ref" : "#/definitions/disallowed" } + }, + "patternProperties" : { + "_Localised$" : { "$ref" : "#/definitions/disallowed" } + } + } + }, + "definitions": { + "disallowed" : { "not" : { "type": [ "array", "boolean", "integer", "number", "null", "object", "string" ] } } + } +} diff --git a/src/eddn/conf/Settings.py b/src/eddn/conf/Settings.py index e5dad0d..80fc195 100644 --- a/src/eddn/conf/Settings.py +++ b/src/eddn/conf/Settings.py @@ -53,6 +53,9 @@ class _Settings(object): "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", + + "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", } GATEWAY_OUTDATED_SCHEMAS = [