{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {
        "disallowed": {
            "not": {
                "type": [
                    "array",
                    "boolean",
                    "integer",
                    "number",
                    "null",
                    "object",
                    "string"
                ]
            }
        }
    },
    "id": "https://eddn.edcd.io/schemas/journal/1#",
    "properties": {
        "$schemaRef": {
            "type": "string"
        },
        "header": {
            "additionalProperties": true,
            "properties": {
                "gatewayTimestamp": {
                    "_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.",
                    "type": "string"
                },
                "softwareName": {
                    "type": "string"
                },
                "softwareVersion": {
                    "type": "string"
                },
                "uploaderID": {
                    "type": "string"
                }
            },
            "required": [
                "uploaderID",
                "softwareName",
                "softwareVersion"
            ],
            "type": "object"
        },
        "message": {
            "additionalProperties": true,
            "description": "Contains all properties from the listed events in the client's journal minus Localised strings and the properties marked below as 'disallowed'",
            "patternProperties": {
                "^(Materials|StationEconomies|Signals)$": {
                    "description": "Present in Scan, Docked and SAASignalsFound messages",
                    "items": {
                        "patternProperties": {
                            "_Localised$": {
                                "$ref": "#/definitions/disallowed"
                            }
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "_Localised$": {
                    "$ref": "#/definitions/disallowed"
                }
            },
            "properties": {
                "ActiveFine": {
                    "$ref": "#/definitions/disallowed"
                },
                "BoostUsed": {
                    "$ref": "#/definitions/disallowed"
                },
                "CockpitBreach": {
                    "$ref": "#/definitions/disallowed"
                },
                "Factions": {
                    "description": "Present in Location, FSDJump and CarrierJump messages",
                    "items": {
                        "patternProperties": {
                            "_Localised$": {
                                "$ref": "#/definitions/disallowed"
                            }
                        },
                        "properties": {
                            "HappiestSystem": {
                                "$ref": "#/definitions/disallowed"
                            },
                            "HomeSystem": {
                                "$ref": "#/definitions/disallowed"
                            },
                            "MyReputation": {
                                "$ref": "#/definitions/disallowed"
                            },
                            "SquadronFaction": {
                                "$ref": "#/definitions/disallowed"
                            }
                        },
                        "type": "object"
                    },
                    "type": "array"
                },
                "FuelLevel": {
                    "$ref": "#/definitions/disallowed"
                },
                "FuelUsed": {
                    "$ref": "#/definitions/disallowed"
                },
                "JumpDist": {
                    "$ref": "#/definitions/disallowed"
                },
                "Latitude": {
                    "$ref": "#/definitions/disallowed"
                },
                "Longitude": {
                    "$ref": "#/definitions/disallowed"
                },
                "StarPos": {
                    "description": "Must be added by the sender if not present in the journal event",
                    "items": {
                        "type": "number"
                    },
                    "maxItems": 3,
                    "minItems": 3,
                    "type": "array"
                },
                "StarSystem": {
                    "description": "Must be added by the sender if not present in the journal event",
                    "minLength": 1,
                    "type": "string"
                },
                "SystemAddress": {
                    "description": "Should be added by the sender if not present in the journal event",
                    "type": "integer"
                },
                "Wanted": {
                    "$ref": "#/definitions/disallowed"
                },
                "event": {
                    "enum": [
                        "Docked",
                        "FSDJump",
                        "Scan",
                        "Location",
                        "SAASignalsFound",
                        "CarrierJump"
                    ]
                },
                "timestamp": {
                    "_format": "date-time",
                    "type": "string"
                }
            },
            "required": [
                "timestamp",
                "event",
                "StarSystem",
                "StarPos",
                "SystemAddress"
            ],
            "type": "object"
        }
    },
    "required": [
        "$schemaRef",
        "header",
        "message"
    ],
    "type": "object"
}