From 4f3225c3af604f6bbdd2c5380dc0c671766c62f0 Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Thu, 27 Jan 2022 11:10:59 +0000 Subject: [PATCH 1/7] Add Approachsettlement --- schemas/approachsettlement-README.md | 33 +++++++++++ schemas/approachsettlement-v1.0.json | 89 ++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 schemas/approachsettlement-README.md create mode 100644 schemas/approachsettlement-v1.0.json diff --git a/schemas/approachsettlement-README.md b/schemas/approachsettlement-README.md new file mode 100644 index 0000000..e4af2af --- /dev/null +++ b/schemas/approachsettlement-README.md @@ -0,0 +1,33 @@ +# EDDN ApproachSettlement Schema + +## Introduction +Here we document how to take data from an ED `FSSAllBodiesFound` Journal +Event and properly structure it for sending to EDDN. + +Please consult [EDDN Schemas README](./README-EDDN-schemas.md) for general +documentation for a schema such as this. + +## Senders +The primary data source for this schema is the ED Journal event +`ApproachSettlement`. + +### Key Renames +Many of the key names have a different case defined in this schema, make +sure you are renaming them as appropriate. + +### Elisions +None + +### Augmentations +#### horizons flag +You SHOULD add this key/value pair, using the value from the `LoadGame` event. + +#### odyssey flag +You SHOULD add this key/value pair, using the value from the `LoadGame` event. + +#### StarSystem + +You MUST add a StarSystem key/value pair representing the name of the system this event occurred in. Source this from either Location, FSDJump or CarrierJump as appropriate. + +#### StarPos +You MUST add a `StarPos` array containing the system co-ordinates from the last `FSDJump`, `CarrierJump`, or `Location` event. diff --git a/schemas/approachsettlement-v1.0.json b/schemas/approachsettlement-v1.0.json new file mode 100644 index 0000000..958d5d3 --- /dev/null +++ b/schemas/approachsettlement-v1.0.json @@ -0,0 +1,89 @@ +{ + "$schema" : "http://json-schema.org/draft-04/schema#", + "id" : "https://eddn.edcd.io/schemas/approachsettlement/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 the event key, Localised strings and the properties marked below as 'disallowed'", + "additionalProperties" : false, + "required" : [ "timestamp", "StarSystem", "StarPos", "SystemAddress", "Name", "MarketID", "BodyID", "BodyName", "Latitude", "Longitude" ], + "properties" : { + "timestamp": { + "type" : "string", + "format" : "date-time" + }, + "horizons": { + "type" : "boolean", + "description" : "Whether the sending Cmdr has a Horizons pass." + }, + "odyssey": { + "type" : "boolean", + "description" : "Whether the sending Cmdr has an Odyssey expansion." + }, + "StarSystem": { + "type" : "string", + "minLength" : 1 + }, + "StarPos": { + "type" : "array", + "items" : { "type": "number" }, + "minItems" : 3, + "maxItems" : 3, + "description" : "Must be added by the sender" + }, + "SystemAddress": { + "type" : "integer", + }, + "Name" : { + "type" : "string", + "description" : "Name of settlement" + }, + "MarketID": { + "type" : "integer" + }, + "BodyID": { + "type" : "integer" + }, + "BodyName": { + "type" : "string" + }, + "Latitude": { + "type" : "number" + }, + "Longitude": { + "type" : "number" + } + } + } + }, + "definitions": { + "disallowed" : { "not" : { "type": [ "array", "boolean", "integer", "number", "null", "object", "string" ] } } + } +} From 42742ae9e6a9b283a1bf5379ac250b2e3748fd5f Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Thu, 27 Jan 2022 11:30:57 +0000 Subject: [PATCH 2/7] Add back in event after discussion --- schemas/approachsettlement-v1.0.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/schemas/approachsettlement-v1.0.json b/schemas/approachsettlement-v1.0.json index 958d5d3..7f974a6 100644 --- a/schemas/approachsettlement-v1.0.json +++ b/schemas/approachsettlement-v1.0.json @@ -31,7 +31,7 @@ }, "message": { "type" : "object", - "description" : "Contains all properties from the listed events in the client's journal minus the event key, Localised strings and the properties marked below as 'disallowed'", + "description" : "Contains all properties from the listed events in the client's journal minus the Localised strings and the properties marked below as 'disallowed'", "additionalProperties" : false, "required" : [ "timestamp", "StarSystem", "StarPos", "SystemAddress", "Name", "MarketID", "BodyID", "BodyName", "Latitude", "Longitude" ], "properties" : { @@ -39,6 +39,9 @@ "type" : "string", "format" : "date-time" }, + "event" : { + "enum" : [ "ApproachBody" ] + }, "horizons": { "type" : "boolean", "description" : "Whether the sending Cmdr has a Horizons pass." From e85e3d4b85f032d828bc05a1aa8f123ac4a1873f Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Thu, 27 Jan 2022 13:09:50 +0000 Subject: [PATCH 3/7] Fix tab issue, add description --- schemas/approachsettlement-v1.0.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/schemas/approachsettlement-v1.0.json b/schemas/approachsettlement-v1.0.json index 7f974a6..c5cfb2e 100644 --- a/schemas/approachsettlement-v1.0.json +++ b/schemas/approachsettlement-v1.0.json @@ -53,6 +53,7 @@ "StarSystem": { "type" : "string", "minLength" : 1 + "description" : "Must be added by the sender" }, "StarPos": { "type" : "array", @@ -67,17 +68,17 @@ "Name" : { "type" : "string", "description" : "Name of settlement" - }, + }, "MarketID": { "type" : "integer" }, - "BodyID": { + "BodyID": { "type" : "integer" }, "BodyName": { "type" : "string" }, - "Latitude": { + "Latitude": { "type" : "number" }, "Longitude": { From 3b7c002b51255f8b153babdbaa6183e09a598c93 Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Fri, 28 Jan 2022 08:14:45 +0000 Subject: [PATCH 4/7] Add schema to settings --- src/eddn/conf/Settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/eddn/conf/Settings.py b/src/eddn/conf/Settings.py index faac1c0..af15e95 100644 --- a/src/eddn/conf/Settings.py +++ b/src/eddn/conf/Settings.py @@ -73,6 +73,9 @@ class _Settings(object): "https://eddn.edcd.io/schemas/navroute/1" : "schemas/navroute-v1.0.json", "https://eddn.edcd.io/schemas/navroute/1/test" : "schemas/navroute-v1.0.json", + + "https://eddn.edcd.io/schemas/approachsettlement/1" : "schemas/approachsettlement-v1.0.json", + "https://eddn.edcd.io/schemas/approachsettlement/1/test" : "schemas/approachsettlement-v1.0.json", } GATEWAY_OUTDATED_SCHEMAS = [ From 87a81aaa376c4f318d43082303569af59b05f9ab Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Fri, 28 Jan 2022 13:47:01 +0000 Subject: [PATCH 5/7] Fix comma typo in ApproachSettlement JSON and fix readme --- schemas/approachsettlement-README.md | 2 +- schemas/approachsettlement-v1.0.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/schemas/approachsettlement-README.md b/schemas/approachsettlement-README.md index e4af2af..44d72ca 100644 --- a/schemas/approachsettlement-README.md +++ b/schemas/approachsettlement-README.md @@ -1,7 +1,7 @@ # EDDN ApproachSettlement Schema ## Introduction -Here we document how to take data from an ED `FSSAllBodiesFound` Journal +Here we document how to take data from an ED `ApproachSettlement` Journal Event and properly structure it for sending to EDDN. Please consult [EDDN Schemas README](./README-EDDN-schemas.md) for general diff --git a/schemas/approachsettlement-v1.0.json b/schemas/approachsettlement-v1.0.json index c5cfb2e..6685f29 100644 --- a/schemas/approachsettlement-v1.0.json +++ b/schemas/approachsettlement-v1.0.json @@ -52,7 +52,7 @@ }, "StarSystem": { "type" : "string", - "minLength" : 1 + "minLength" : 1, "description" : "Must be added by the sender" }, "StarPos": { @@ -63,7 +63,7 @@ "description" : "Must be added by the sender" }, "SystemAddress": { - "type" : "integer", + "type" : "integer" }, "Name" : { "type" : "string", From 5ff342cc8bf56451d2c605ddf6a2e33063d5b630 Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Fri, 28 Jan 2022 13:52:20 +0000 Subject: [PATCH 6/7] Add event to required list --- schemas/approachsettlement-v1.0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/approachsettlement-v1.0.json b/schemas/approachsettlement-v1.0.json index 6685f29..a656bb7 100644 --- a/schemas/approachsettlement-v1.0.json +++ b/schemas/approachsettlement-v1.0.json @@ -33,7 +33,7 @@ "type" : "object", "description" : "Contains all properties from the listed events in the client's journal minus the Localised strings and the properties marked below as 'disallowed'", "additionalProperties" : false, - "required" : [ "timestamp", "StarSystem", "StarPos", "SystemAddress", "Name", "MarketID", "BodyID", "BodyName", "Latitude", "Longitude" ], + "required" : [ "timestamp", "event", "StarSystem", "StarPos", "SystemAddress", "Name", "MarketID", "BodyID", "BodyName", "Latitude", "Longitude" ], "properties" : { "timestamp": { "type" : "string", From 3690aab87eef04f37071fd45ca095e41317686eb Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Fri, 28 Jan 2022 15:10:36 +0000 Subject: [PATCH 7/7] Fix another typo in ApproachSettlement event tag --- schemas/approachsettlement-v1.0.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/approachsettlement-v1.0.json b/schemas/approachsettlement-v1.0.json index a656bb7..571db77 100644 --- a/schemas/approachsettlement-v1.0.json +++ b/schemas/approachsettlement-v1.0.json @@ -40,7 +40,7 @@ "format" : "date-time" }, "event" : { - "enum" : [ "ApproachBody" ] + "enum" : [ "ApproachSettlement" ] }, "horizons": { "type" : "boolean",