Merge pull request #48 from Marginal/journal

Schema for Journal entries
This commit is contained in:
AnthorNet 2016-09-20 09:01:32 +02:00 committed by GitHub
commit fff6a35d3e
2 changed files with 68 additions and 0 deletions

65
schemas/journal-v1.0.json Normal file
View File

@ -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" ] } }
}
}

View File

@ -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 = [