From e6d0240c367d31d7cb40646d2cb7afa22af04356 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 30 Jan 2022 14:36:39 +0000 Subject: [PATCH] schemas/template: Define how to tag a key as having been renamed --- schemas/TEMPLATES/journalevent-README.md | 26 ++++++++---------------- schemas/TEMPLATES/journalevent-v1.0.json | 11 ++++++++-- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/schemas/TEMPLATES/journalevent-README.md b/schemas/TEMPLATES/journalevent-README.md index e56aa9d..cfb6e30 100644 --- a/schemas/TEMPLATES/journalevent-README.md +++ b/schemas/TEMPLATES/journalevent-README.md @@ -23,8 +23,8 @@ version of this Schema's Journal event name. 4. For new Journal-based schemas no key renames should be necessary. - If there are no renames of key names for this Schema, then edit the - `Key Renames` section to contain only the text `None.`. + If there are no renames of key names for this Schema, then remove the + `Key Renames` section. Where such renames *are* required do **NOT** attempt to list them all here. That would just require updating them both here and in the actual Schema. @@ -32,17 +32,11 @@ If there are any, call them out in the `description` of the affected property in the Schema. -5. In the `Elisions` section clearly document any keys (and thus their values) - that are in the source data, but that should not be in the resulting EDDN - message. - - **You do not need to list keys with a `_Localised` suffix.** - -6. Do **NOT** remove the `horizons and odyssey flags` section. It is +7. Do **NOT** remove the `horizons and odyssey flags` section. It is mandatory that they are allowed (but are optional) in any Journal-based EDDN Schema. -7. If: +8. If both: 1. either the source Journal event contains information that includes the System name (possibly as `StarSystem` or `SystemName`), **OR** the source data contains a `SystemAddress` value, @@ -83,11 +77,9 @@ discrepancy.** The data source for this schema is the ED Journal event `NewJournalEvent`. ### 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 +Some key names in this Schema are different from how they appear in the source +Journal data. Look for keys where the object contains a `renamed` key - the +value is what the name would have been in the source Journal data. ### Augmentations #### horizons and odyssey flags @@ -99,5 +91,5 @@ You MUST add a `StarPos` array containing the system co-ordinates from the last `FSDJump`, `CarrierJump`, or `Location` event. ## Listeners -The advice above for [Senders](#senders), combined with the actual Schema file *should* -provide all the information you need to process these events. +The advice above for [Senders](#senders), combined with the actual Schema file +*should* provide all the information you need to process these events. diff --git a/schemas/TEMPLATES/journalevent-v1.0.json b/schemas/TEMPLATES/journalevent-v1.0.json index 143f47b..a87c8fe 100644 --- a/schemas/TEMPLATES/journalevent-v1.0.json +++ b/schemas/TEMPLATES/journalevent-v1.0.json @@ -25,7 +25,7 @@ # event is not guaranteed to contain either, depending on which client # (base, horizons, odyssey) the player is running. # 7. 'some_disallowed_key' demonstrates how to specify that a key (and thus its -# value) is not allowed in this schema. +# value) is not allowed in this schema. Note the **MANDATORY** description. # 8. Note the trailing comma after the 'some_disallowed_key' entry in # 'messages'. If all you did was remove these comments you would NOT have # a valid JSON file. You should be adding **at least** one additional @@ -96,7 +96,14 @@ "maxItems" : 3, "description" : "Must be added by the sender" }, - "some_disallowed_key" { "$ref" : "#/definitions/disallowed" }, + "ExampleRenamedKey" : { + "type" : "string", + "renamed" : "SomeOtherKey" + } + "some_disallowed_key" { + "$ref" : "#/definitions/disallowed", + "description" : "MANDATORY brief description of why this key must be removed from source data" + }, } } },