schemas/template: Define how to tag a key as having been renamed

This commit is contained in:
Athanasius 2022-01-30 14:36:39 +00:00
parent 3b8845d31a
commit e6d0240c36
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D
2 changed files with 18 additions and 19 deletions

View File

@ -23,8 +23,8 @@
version of this Schema's Journal event name. version of this Schema's Journal event name.
4. For new Journal-based schemas no key renames should be necessary. 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 If there are no renames of key names for this Schema, then remove the
`Key Renames` section to contain only the text `None.`. `Key Renames` section.
Where such renames *are* required do **NOT** attempt to list them all here. 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. 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 If there are any, call them out in the `description` of the affected
property in the Schema. property in the Schema.
5. In the `Elisions` section clearly document any keys (and thus their values) 7. Do **NOT** remove the `horizons and odyssey flags` section. It is
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
mandatory that they are allowed (but are optional) in any Journal-based mandatory that they are allowed (but are optional) in any Journal-based
EDDN Schema. EDDN Schema.
7. If: 8. If both:
1. either the source Journal event contains information that includes the 1. either the source Journal event contains information that includes the
System name (possibly as `StarSystem` or `SystemName`), **OR** the source System name (possibly as `StarSystem` or `SystemName`), **OR** the source
data contains a `SystemAddress` value, data contains a `SystemAddress` value,
@ -83,11 +77,9 @@ discrepancy.**
The data source for this schema is the ED Journal event `NewJournalEvent`. The data source for this schema is the ED Journal event `NewJournalEvent`.
### Key Renames ### Key Renames
Many of the key names have a different case defined in this schema, make Some key names in this Schema are different from how they appear in the source
sure you are renaming them as appropriate. 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.
### Elisions
None
### Augmentations ### Augmentations
#### horizons and odyssey flags #### 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. last `FSDJump`, `CarrierJump`, or `Location` event.
## Listeners ## Listeners
The advice above for [Senders](#senders), combined with the actual Schema file *should* The advice above for [Senders](#senders), combined with the actual Schema file
provide all the information you need to process these events. *should* provide all the information you need to process these events.

View File

@ -25,7 +25,7 @@
# event is not guaranteed to contain either, depending on which client # event is not guaranteed to contain either, depending on which client
# (base, horizons, odyssey) the player is running. # (base, horizons, odyssey) the player is running.
# 7. 'some_disallowed_key' demonstrates how to specify that a key (and thus its # 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 # 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 # '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 # a valid JSON file. You should be adding **at least** one additional
@ -96,7 +96,14 @@
"maxItems" : 3, "maxItems" : 3,
"description" : "Must be added by the sender" "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"
},
} }
} }
}, },