mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-20 16:53:54 +03:00
Draft v2.0 schema provided by AnthorNet.
This commit is contained in:
parent
e5af51d29b
commit
5bd5b001d8
119
schemas/commodity-v2.0-draft.json
Normal file
119
schemas/commodity-v2.0-draft.json
Normal file
@ -0,0 +1,119 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-04/schema#",
|
||||
"id": "http://schemas.elite-markets.net/eddn/commodity/2#",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"$schemaRef": {
|
||||
"type": "string",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"header": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"properties": {
|
||||
"uploaderID": {
|
||||
"type": "string",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"softwareName": {
|
||||
"type": "string",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"softwareVersion": {
|
||||
"type": "string",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"gatewayTimestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"description": "Timestamp upon receipt at the gateway. If present, this property will be overwritten by the gateway; submitters are not intended to populate this property.",
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"message": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"systemName": {
|
||||
"type": "string",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"stationName": {
|
||||
"type": "string",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "string",
|
||||
"format": "date-time",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"commodities": {
|
||||
"type": "array",
|
||||
"additionalProperties": false,
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type" : "object",
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"buyPrice": {
|
||||
"type": "integer",
|
||||
"description": "Price to buy from the market",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"supply": {
|
||||
"type": "integer",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"supplyLevel": {
|
||||
"$ref": "#/definitions/levelType"
|
||||
},
|
||||
"sellPrice": {
|
||||
"type": "integer",
|
||||
"description": "Price to sell to the market",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"demand": {
|
||||
"type": "integer",
|
||||
"additionalProperties": false
|
||||
},
|
||||
"demandLevel": {
|
||||
"$ref": "#/definitions/levelType"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"buyPrice",
|
||||
"supply",
|
||||
"sellPrice",
|
||||
"demand"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"systemName",
|
||||
"stationName",
|
||||
"commodities",
|
||||
"timestamp"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"$schemaRef",
|
||||
"header",
|
||||
"message"
|
||||
],
|
||||
"definitions" : {
|
||||
"levelType" : {
|
||||
"enum": ["Low", "Med", "High"]
|
||||
}
|
||||
}
|
||||
}
|
@ -35,7 +35,8 @@ class _Settings(object):
|
||||
|
||||
GATEWAY_JSON_SCHEMAS = {
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1": "schemas/commodity-v0.1.json",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1/test": "schemas/commodity-v0.1.json"
|
||||
"http://schemas.elite-markets.net/eddn/commodity/1/test": "schemas/commodity-v0.1.json",
|
||||
"http://schemas.elite-markets.net/eddn/commodity/2": "schemas/commodity-v2.0-draft.json"
|
||||
}
|
||||
|
||||
def loadFrom(self, fileName):
|
||||
|
Loading…
x
Reference in New Issue
Block a user