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.
This commit is contained in:
Athanasius 2022-08-31 15:17:56 +00:00
parent f4ab9eb35a
commit f4b9eab178

View File

@ -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" }
}
}
}