From e1261e76b0dcca9596021cc1f2f68cb83a3fd535 Mon Sep 17 00:00:00 2001 From: Alinson S Xavier Date: Fri, 6 Mar 2020 12:51:45 -0600 Subject: [PATCH] Add JSON schema for input file --- src/schemas/input.json | 83 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/schemas/input.json diff --git a/src/schemas/input.json b/src/schemas/input.json new file mode 100644 index 0000000..c60b0b9 --- /dev/null +++ b/src/schemas/input.json @@ -0,0 +1,83 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://axavier.org/ReverseManufacturing/input/schema", + "title": "Schema for ReverseManufacturing Input File", + "definitions": { + "Plant": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "input": { "type": "string" }, + "outputs": { + "type": "object", + "additionalProperties": { "type": "number" } + }, + "locations": { "$ref": "#/definitions/PlantLocation" } + }, + "required": [ + "input", + "locations" + ] + } + }, + "PlantLocation": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "latitude": { "type": "number" }, + "longitude": { "type": "number" }, + "variable operating cost": { "type": "number" }, + "fixed operating cost": { "type": "number" }, + "opening cost": { "type": "number" } + }, + "required": [ + "latitude", + "longitude", + "variable operating cost", + "fixed operating cost", + "opening cost" + ] + } + }, + "InitialAmount": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "latitude": { "type": "number" }, + "longitude": { "type": "number" }, + "amount": { "type": "number" } + }, + "required": [ + "latitude", + "longitude", + "amount" + ] + } + }, + "Product": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "transportation cost": { "type": "number" }, + "initial amounts": { "$ref": "#/definitions/InitialAmount" } + }, + "required": [ + "transportation cost" + ] + } + } + }, + "type": "object", + "properties": { + "plants": { "$ref": "#/definitions/Plant" }, + "products": { "$ref": "#/definitions/Product" } + }, + "required": [ + "plants", + "products" + ] +} \ No newline at end of file