EDDN/schemas/codexentry-v1.0.json
Athanasius 916fe73f35 schemas: codexentry: NearestDestination *can* be an empty string.
We had one user with EDMC trying to send:

```python
OrderedDict([('$schemaRef',
'https://eddn.edcd.io/schemas/codexentry/1'), ('message',
OrderedDict([('timestamp', '2021-10-26T11:37:57Z'), ('event',
'CodexEntry'), ('EntryID', 2420702), ('Name',
'$Codex_Ent_Stratum_07_K_Name;'), ('SubCategory',
'$Codex_SubCategory_Organic_Structures;'), ('Category',
'$Codex_Category_Biology;'), ('Region', '$Codex_RegionName_18;'),
('System', 'Xi Ophiuchi'), ('SystemAddress', 2072061675891),
('NearestDestination', ''), ('Latitude', 79.352364), ('Longitude',
121.434044), ('horizons', True), ('odyssey', True), ('StarPos', [-3.875,
8.15625, 55.875]), ('BodyName', 'Xi Ophiuchi B 5'), ('BodyID', 14)]))])
```
as the message.  The EDDN Gateway then complains:

`FAIL: [<ValidationError: "'' is too short">]`
2021-10-27 11:08:16 +00:00

131 lines
5.3 KiB
JSON

{
"$schema" : "http://json-schema.org/draft-04/schema#",
"id" : "https://eddn.edcd.io/schemas/codexentry/1#",
"description" : "EDDN schema for CodexEntry Journal events. Full documentation at https://github.com/EDCD/EDDN/tree/master/schemas/codexentry-README.md",
"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" : false,
"required" : [ "timestamp", "event", "System", "StarPos", "SystemAddress", "EntryID" ],
"properties" : {
"timestamp": {
"type" : "string",
"format" : "date-time"
},
"event": {
"enum" : [ "CodexEntry" ]
},
"horizons": {
"type" : "boolean",
"description" : "Whether the sending Cmdr has a Horizons pass."
},
"odyssey": {
"type" : "boolean",
"description" : "Whether the sending Cmdr has an Odyssey expansion."
},
"System": {
"type" : "string",
"minLength" : 1
},
"StarPos": {
"type" : "array",
"items" : { "type": "number" },
"minItems" : 3,
"maxItems" : 3,
"description" : "Must be added by the sender if not present in the journal event"
},
"SystemAddress": {
"type" : "integer",
"description" : "Should be added by the sender if not present in the journal event"
},
"Name": {
"type" : "string",
"minLength" : 1
},
"Region": {
"type" : "string",
"minLength" : 1
},
"EntryID": {
"type" : "integer"
},
"Category": {
"type" : "string",
"minLength" : 1
},
"Latitude": {
"type" : "number"
},
"Longitude": {
"type" : "number"
},
"SubCategory": {
"type" : "string",
"minLength" : 1
},
"NearestDestination": {
"type" : "string"
},
"VoucherAmount": {
"type" : "integer"
},
"Traits": {
"type" : "array",
"items" : {
"type" : "string",
"minLength" : 1
}
},
"BodyID": {
"type" : "integer"
},
"BodyName": {
"type" : "string"
},
"IsNewEntry": {
"$ref" : "#/definitions/disallowed",
"description" : "Contains personal data"
},
"NewTraitsDiscovered": {
"$ref" : "#/definitions/disallowed",
"description" : "Contains personal data"
}
},
"patternProperties": {
"_Localised$" : { "$ref" : "#/definitions/disallowed" }
}
}
},
"definitions": {
"disallowed" : { "not" : { "type": [ "array", "boolean", "integer", "number", "null", "object", "string" ] } }
}
}