{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "https://toshio.fedorapeople.org/stellarmagnate/stellar-schema.json",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "version": {
            "type": "string",
            "pattern": "^[0-9]+\\.[0-9]+$"
        },
        "system": {
            "type": "array",
            "uniqueness": true,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "location": {
                        "type": "array",
                        "uniqueness": true,
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "type": {
                                    "type": "string",
                                    "enum": [
                                        "planet",
                                        "star"
                                    ]
                                },
                                "id": {
                                    "type": "integer",
                                    "minimum": 0
                                }
                            }
                        }
                    }
                }
            }
        },
        "cargo": {
            "type": "array",
            "uniqueness": true,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "food",
                            "metal",
                            "fuel",
                            "low bulk chemical",
                            "high bulk chemical",
                            "low bulk machine",
                            "high bulk machine"
                        ]
                    },
                    "mean_price": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "standard_deviation": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "depreciation_rate": {
                        "type": "number",
                        "minimum": 0
                    },
                    "event": {
                        "type": "array",
                        "uniqueness": true,
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "enum": [
                                        "shortage",
                                        "sale"
                                    ]
                                },
                                "adjustment": {
                                    "type": "integer",
                                    "minimum": 1
                                },
                                "msg": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "equipment": {
            "type": "array",
            "uniqueness": true,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "type": {
                        "type": "string",
                        "enum": [
                            "ship parts"
                        ]
                    },
                    "mean_price": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "standard_deviation": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "depreciation_rate": {
                        "type": "number",
                        "minimum": 0
                    },
                    "holdspace": {
                        "type": "integer"
                    },
                    "event": {
                        "type": "array",
                        "uniqueness": true,
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "enum": [
                                        "sale",
                                        "shortage"
                                    ]
                                },
                                "adjustment": {
                                    "type": "integer",
                                    "minimum": 0
                                },
                                "msg": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "property": {
            "type": "array",
            "uniqueness": true,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "mean_price": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "standard_deviation": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "depreciation_rate": {
                        "type": "number",
                        "minimum": 0
                    },
                    "storage_space": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "event": {
                        "type": "array",
                        "uniqueness": true,
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "enum": [
                                        "sale",
                                        "shortage"
                                    ]
                                },
                                "adjustment": {
                                    "type": "integer",
                                    "minimum": 0
                                },
                                "msg": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        },
        "ship": {
            "type": "array",
            "uniqueness": true,
            "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "name": {
                        "type": "string"
                    },
                    "id": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "mean_price": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "standard_deviation": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "depreciation_rate": {
                        "type": "number",
                        "minimum": 0
                    },
                    "holdspace": {
                        "type": "integer",
                        "minimum": 0
                    },
                    "weaponmount": {
                        "type": "integer",
                        "minimum": 0
                    }
                }
            }
        }
    }
}