{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/venvplus-schema-v1.0.0.json",
  "$ref": "#/definitions/92ca5/full",
  "type": "object",
  "title": "venvplus schema",
  "definitions": {
    "f427d": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Version",
        "description": "Json schema version for the venvplus configuration file. Acceptance criteria: equal major version, less/equal minor and patch version.",
        "const": "1.0.0",
        "type": "string",
        "examples": ["1.0.0"]
      }
    },
    "f631a": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Offline config",
        "description": "Settings for offline mode",
        "type": "object",
        "additionalProperties": false,
        "required": ["source-files"],
        "properties": {
          "source-files": {
            "description": "List of offline source files. A reference to a channel mapping set can be specified.",
            "type": "array",
            "items": {
              "$ref": "#/definitions/a91e9/full"
            }
          },
          "processing-sequence": {
            "description": "Processing sequence of the offline sources.\n\"timestamp-only\": The offline sources are processed according to their timestamp, date and time are irrelevant.\n\"date-and-time\": The offline sources are processed according to date/time and the time stamp. Only available if all sources have absolute time stamps.\n\"source-file-sequence\": The offline sources are replayed in the order in which they are given in \"source-files\".",
            "default": "timestamp-only",
            "enum": ["timestamp-only", "date-and-time", "source-file-sequence"],
            "examples": [
              "timestamp-only",
              "date-and-time",
              "source-file-sequence"
            ]
          },
          "channel-mappings": {
            "$ref": "#/definitions/54ff4/full"
          },
          "default-channel-mapping": {
            "$ref": "#/definitions/9a523/full",
            "description": "Reference to a channel mapping set used for all source files, except if set explicitly in \"source-files\".",
            "examples": ["channelSet1"]
          }
        },
        "examples": [
          {
            "source-files": [
              {
                "file-path": ["path/to/my.blf", "path/to/another.blf"]
              }
            ]
          },
          {
            "source-files": [
              {
                "file-path": "path/to/my.blf"
              },
              {
                "file-path": "path/to/another.blf"
              }
            ],
            "processing-sequence": "source-file-sequence",
            "default-channel-mapping": "set1",
            "channel-mappings": [
              {
                "name": "set1",
                "default-mapping": "as-in-original",
                "mappings": [
                  {
                    "source-channel": "Eth1",
                    "target-network": "AEthNetworkName",
                    "target-port": "APort"
                  },
                  {
                    "source-network": "ALINNetwork",
                    "target-network": "AnotherLIN"
                  },
                  {
                    "ignore-source-network": "CANnetwork"
                  },
                  {
                    "ignore-source-channel": "CAN1"
                  }
                ]
              }
            ]
          },
          {
            "source-files": [
              {
                "file-path": "path/to/my.blf",
                "channel-mapping": "set1"
              },
              {
                "file-path": "path/to/one.blf",
                "channel-mapping": "set2"
              }
            ],
            "channel-mappings": [
              {
                "name": "set1",
                "mappings": [
                  {
                    "ignore-source-channel": "CAN1"
                  }
                ]
              },
              {
                "name": "set2",
                "default-mapping": "ignore-all",
                "mappings": [
                  {
                    "source-network": "ALINNetwork",
                    "target-network": "AnotherLIN"
                  }
                ]
              }
            ]
          }
        ]
      }
    },
    "a91e9": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "additionalProperties": false,
        "required": ["file-path"],
        "properties": {
          "file-path": {
            "oneOf": [
              {
                "$ref": "#/definitions/e0f9d/full"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/e0f9d/full"
                }
              }
            ],
            "examples": [
              "path/to/my.blf",
              ["path/to/my.blf"],
              ["path/to/my.blf", "path/to/another.blf"]
            ]
          },
          "channel-mapping": {
            "$ref": "#/definitions/9a523/full",
            "description": "Name of a channel mapping set defined in \"channel-mapping\"."
          }
        }
      }
    },
    "e0f9d": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "description": "Absolute or relative path to a logging file (.blf). Relative path specifications are resolved relative to the configuration file.",
        "type": "string",
        "anyOf": [
          {
            "pattern": "^.*\\.[bB][lL][fF]$"
          }
        ]
      }
    },
    "fe601": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Channel mapping",
        "description": "A channel mapping for one or more offline sources.",
        "type": "object",
        "additionalProperties": false,
        "required": ["name"],
        "properties": {
          "name": {
            "$ref": "#/definitions/9a523/full",
            "description": "A C-identifier for this element (case sensitive)."
          },
          "default-mapping": {
            "description": "The default mapping of a channel if not explicitly mapped.",
            "default": "as-in-original",
            "oneOf": [
              {
                "const": "as-in-original",
                "description": "The channel is mapped to itself if there is an active network."
              },
              {
                "const": "ignore-all",
                "description": "The channels are ignored by default."
              }
            ],
            "examples": ["as-in-original", "ignore-all"]
          },
          "mappings": {
            "title": "Explicit mappings",
            "description": "The explicitly mapped channels. Overwrites the default mapping for the source.",
            "type": "array",
            "items": {
              "anyOf": [
                {
                  "title": "Map source channel",
                  "type": "object",
                  "description": "Mapping from application channel of the replay file to a target network.",
                  "additionalProperties": false,
                  "required": ["source-channel", "target-network"],
                  "properties": {
                    "source-channel": {
                      "description": "The source application channel for a given network type from the replayed file.",
                      "anyOf": [
                        {
                          "$ref": "#/definitions/d9e2f/full"
                        },
                        {
                          "$ref": "#/definitions/1b26c/full"
                        },
                        {
                          "$ref": "#/definitions/a8944/full"
                        }
                      ]
                    },
                    "target-network": {
                      "$ref": "#/definitions/9a523/full",
                      "description": "The target network name."
                    }
                  }
                },
                {
                  "title": "Map source channel",
                  "type": "object",
                  "description": "The source application channel for a given network type from the replayed file.",
                  "additionalProperties": false,
                  "required": ["source-channel", "target-network"],
                  "properties": {
                    "source-channel": {
                      "$ref": "#/definitions/56e73/full",
                      "description": "The source bus type and application channel from the replayed file."
                    },
                    "target-network": {
                      "$ref": "#/definitions/9a523/full",
                      "description": "The target network name."
                    },
                    "target-port": {
                      "$ref": "#/definitions/9a523/full",
                      "description": "Target port (applies to Ethernet networks only)."
                    }
                  }
                },
                {
                  "title": "Map source network",
                  "type": "object",
                  "description": "Mapping from a named source network of the replay file to a named target network.",
                  "additionalProperties": false,
                  "required": ["source-network", "target-network"],
                  "properties": {
                    "source-network": {
                      "description": "The source network name. Only works if the replay file was created by CANoe and contains the relevant metadata.",
                      "type": "string"
                    },
                    "target-network": {
                      "description": "The target network name.",
                      "oneOf": [
                        {
                          "$ref": "#/definitions/9a523/full"
                        }
                      ]
                    },
                    "target-port": {
                      "$ref": "#/definitions/9a523/full",
                      "description": "Target port (applies to Ethernet networks only)."
                    }
                  }
                },
                {
                  "title": "Ignore source channel",
                  "type": "object",
                  "description": "Ignores an application channel of the replay file.",
                  "additionalProperties": false,
                  "required": ["ignore-source-channel"],
                  "properties": {
                    "ignore-source-channel": {
                      "description": "The ignored source channel",
                      "oneOf": [
                        {
                          "$ref": "#/definitions/d9e2f/full"
                        },
                        {
                          "$ref": "#/definitions/1b26c/full"
                        },
                        {
                          "$ref": "#/definitions/a8944/full"
                        },
                        {
                          "$ref": "#/definitions/56e73/full"
                        }
                      ]
                    }
                  }
                },
                {
                  "title": "Ignore source network",
                  "type": "object",
                  "description": "Ignores a named source network of the replay file.",
                  "additionalProperties": false,
                  "required": ["ignore-source-network"],
                  "properties": {
                    "ignore-source-network": {
                      "description": "The ignored source network name. Only works if the replay file was created by CANoe and contains the relevant metadata.",
                      "type": "string"
                    }
                  },
                  "examples": [
                    {
                      "ignore-source-network": "networkName"
                    }
                  ]
                }
              ]
            }
          }
        },
        "examples": []
      }
    },
    "d9e2f": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "string",
        "pattern": "^((CAN)([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))$",
        "examples": ["CAN1", "CAN255"]
      }
    },
    "a8944": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "string",
        "pattern": "^((FlexRay)([1-9]|[12][0-9]|3[0-2]))$",
        "examples": ["FlexRay1", "FlexRay32"]
      }
    },
    "92ca5": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "venvplus schema",
        "type": "object",
        "additionalProperties": false,
        "required": ["version"],
        "properties": {
          "version": {
            "$ref": "#/definitions/f427d/full"
          },
          "offline-config": {
            "$ref": "#/definitions/f631a/full"
          }
        }
      }
    },
    "54ff4": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Channel mappings",
        "description": "List of channel mappings.",
        "type": "array",
        "items": {
          "$ref": "#/definitions/fe601/full"
        }
      }
    },
    "9a523": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "string",
        "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
        "examples": ["myid", "THIS_IS_CASE_SENSITIVE", "__1_2_3_4_5__"]
      }
    },
    "1b26c": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "string",
        "pattern": "^((LIN)([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]))$",
        "examples": ["LIN1", "LIN255"]
      }
    },
    "56e73": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "string",
        "pattern": "^((Eth)([1-9]|[12][0-9]|3[0-2]))$",
        "examples": ["Eth1", "Eth32"]
      }
    }
  }
}
