From f4b9eab178efd2ea62e780b1c98ad5f8cf151e55 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 31 Aug 2022 15:17:56 +0000 Subject: [PATCH] schemas: fcmaterials: Adjust to allow for CAPI-sourced data * Add new mandatory `data-source` field. * `CarrierName` now optional (not in CAPI data). * `Items` is defined a lot more loosely, due to Journal vs CAPI differences. --- schemas/fcmaterials-v1.0.json | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/schemas/fcmaterials-v1.0.json b/schemas/fcmaterials-v1.0.json index 04f821c..b0cf9cb 100644 --- a/schemas/fcmaterials-v1.0.json +++ b/schemas/fcmaterials-v1.0.json @@ -33,12 +33,15 @@ "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", "event", "MarketID", "CarrierName", "CarrierID", "Items" ], + "required" : [ "timestamp", "data-source", "event", "MarketID", "CarrierID", "Items" ], "properties" : { "timestamp": { "type" : "string", "format" : "date-time" }, + "data-source": { + "enum" : [ "Journal", "CAPI", "CAPI-Journal" ] + }, "event" : { "enum" : [ "FCMaterials" ] }, @@ -66,28 +69,10 @@ }, "Items": { - "type" : "array", - "required" : [ "id", "Name", "Price", "Stock", "Demand" ], - "properties" : { - "id" : { - "type" : "integer" - }, - "Name": { - "type" : "string", - "minLength" : 1 - }, - "Price": { - "type" : "integer" - }, - "Stock": { - "type" : "integer" - }, - "Demand": { - "type" : "integer" - } - }, + "type" : [ "array", "object" ], "patternProperties": { - "_Localised$" : { "$ref" : "#/definitions/disallowed" } + "_Localised$" : { "$ref" : "#/definitions/disallowed" }, + "locName" : { "$ref" : "#/definitions/disallowed" } } } }