diff --git a/schemas/commodity-README.md b/schemas/commodity-README.md index c2a4516..18c9cc5 100644 --- a/schemas/commodity-README.md +++ b/schemas/commodity-README.md @@ -24,18 +24,12 @@ See [Using CAPI data](#using-capi-data) below. So, as per the schema, do include it if available. ### Key Renames -Many of the key names have a different case defined in this schema, make -sure you are renaming them as appropriate. - -#### StarSystem to systemName -Rename the `StarSystem` key name to `systemName`. +Some key names in this Schema are different from how they appear in 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. The names +used are as found in the CAPI source data. ### Elisions -#### Remove _Localised key/values -All keys whose name ends with `_Localised`, i.e. the `Name_Localised` -key/values in Items. - -#### Other Elisions You MUST remove the following key/value pairs from the data: - `StationType` key/value. @@ -50,15 +44,13 @@ In the list of commodites: string (not normally traded at this station market). #### Item Category -Remove not only the `Category_Localised` key/value, as above, but also the -`Category` key/value pair from each Item. +Remove not only the `Category_Localised` key:values, but also the +`Category` key:value pair from each Item. ### 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. +#### horizons and odyssey flags +Please read [horizons and odyssey flags](../../docs/Developers.md#horizons-and-odyssey-flags) +over in the Developers' documentation. ### Using CAPI data It is *not* recommended to use CAPI data as the source as it's fraught with @@ -66,10 +58,10 @@ additional issues. EDMarketConnector does so in order to facilitate obtaining data without the player needing to open the commodities screen. Please read -[the guidance on checking for CAPI lag](README-EDDN-schemas.md#detecting-capi-data-lag) +[the guidance on checking for CAPI lag](../docs/Developers.md#detecting-capi-data-lag) before utilising CAPI data for EDDN messages. -Note that CAPI `/market` data will sometimes have the `StatusFlasg` per +Note that CAPI `/market` data will sometimes have the `statusFlasg` per item, which are defined as optional in this schema (because they're not in the Market.json data). You SHOULD include this data in your message if using CAPI as the source. @@ -91,4 +83,4 @@ any of the listed ships or modules have a `sku` value of #### CAPI odyssey flag Unfortunately there is no method to be *certain* of this from CAPI data, so you will have to trust in the system/station name check and use the value -from the Journal `LoadGame` event. \ No newline at end of file +from the Journal `LoadGame` event. diff --git a/schemas/commodity-v3.0.json b/schemas/commodity-v3.0.json index 3d4450b..60c5c78 100644 --- a/schemas/commodity-v3.0.json +++ b/schemas/commodity-v3.0.json @@ -40,10 +40,12 @@ }, "stationName": { "type" : "string", + "renamed" : "StarSystem", "minLength" : 1 }, "marketId": { - "type" : "integer" + "type" : "integer", + "renamed" : "MarketID" }, "horizons": { "type" : "boolean", @@ -67,31 +69,39 @@ "properties" : { "name": { "type" : "string", + "renamed" : "Name", "minLength" : 1, "description" : "Symbolic name as returned by the Companion API" }, "meanPrice": { - "type" : "integer" + "type" : "integer", + "renamed" : "MeanPrice" }, "buyPrice": { "type" : "integer", + "renaamed" : "BuyPrice", "description" : "Price to buy from the market" }, "stock": { - "type" : "integer" + "type" : "integer", + "renamed" : "Stock" }, "stockBracket": { - "$ref" : "#/definitions/levelType" + "$ref" : "#/definitions/levelType", + "renamed" : "StockBracket" }, "sellPrice": { "type" : "integer", + "renamed" : "SellPrice", "description" : "Price to sell to the market" }, "demand": { - "type" : "integer" + "type" : "integer", + "renamed" : "Demand" }, "demandBracket": { - "$ref" : "#/definitions/levelType" + "$ref" : "#/definitions/levelType", + "renamed" : "DemandBracket" }, "statusFlags": { "type" : "array", @@ -101,6 +111,18 @@ "type" : "string", "minLength" : 1 } + }, + "Producer": { + "$ref" : "#/definitions/disallowed", + "description" : "Not present in CAPI data, so removed from Journal-sourced data" + }, + "Rare" : { + "$ref" : "#/definitions/disallowed", + "description" : "Not present in CAPI data, so removed from Journal-sourced data" + }, + "id": { + "$ref" : "#/definitions/disallowed", + "description" : "Not wanted for historical reasons?" } } } @@ -130,11 +152,16 @@ "type" : "string", "minLength" : 1 } + }, + "StationType": { + "$ref" : "#/definitions/disallowed", + "description" : "Not present in CAPI data, so removed from Journal-sourced data" } } } }, "definitions": { + "disallowed" : { "not" : { "type": [ "array", "boolean", "integer", "number", "null", "object", "string" ] } }, "levelType": { "enum" : [0, 1, 2, 3, ""], "description" : "Note: A value of \"\" indicates that the commodity is not normally sold/purchased at this station, but is currently temporarily for sale/purchase"