{
  "$id": "https://json.schemastore.org/vtestunit-schema.json",
  "$ref": "#/definitions/636d/full",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "636d": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Json schema for test unit configuration files",
        "type": "object",
        "required": ["version"],
        "oneOf": [
          {
            "allOf": [
              {
                "properties": {
                  "version": {
                    "const": "1.0.0"
                  }
                }
              },
              {
                "$ref": "#/definitions/e4dd/full"
              }
            ]
          }
        ]
      }
    },
    "e4dd": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Json schema for test unit configuration files",
        "type": "object",
        "additionalProperties": false,
        "required": ["version"],
        "properties": {
          "version": {
            "$ref": "#/definitions/b807/full"
          },
          "includes": {
            "$ref": "#/definitions/6c39/full"
          },
          "test-unit-information": {
            "$ref": "#/definitions/52a0/full"
          },
          "test-unit-implementation": {
            "$ref": "#/definitions/d6e3/full"
          }
        }
      }
    },
    "b807": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Version",
        "description": "Json schema version for the test unit configuration file. Acceptance criteria: equal major version, less/equal minor and patch version.",
        "pattern": "^1.0.0$",
        "type": "string",
        "examples": ["1.0.0"]
      }
    },
    "6c39": {
      "local": {
        "one": {
          "type": "string",
          "pattern": "\\.([Yy][Aa][Mm][Ll]|[Jj][Ss][Oo][Nn])$"
        }
      },
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Include files",
        "description": "Include a different file (similar to #include of the c preprocessor). The order of includes does not matter. Circular / multiple includes are resolved correctly.",
        "oneOf": [
          {
            "$ref": "#/definitions/6c39/local/one"
          },
          {
            "type": "array",
            "items": {
              "$ref": "#/definitions/6c39/local/one"
            }
          }
        ],
        "examples": [
          "my_include.yaml",
          ["my_include.yaml", "my_other_include.json"]
        ]
      }
    },
    "52a0": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Test Unit Information",
        "description": "Miscellaneous test unit information can be defined. After the execution they are available in the test report.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "caption": {
            "description": "Caption of the test unit.",
            "type": "string",
            "examples": ["My caption"]
          },
          "description": {
            "description": "Description of the test unit.",
            "type": "string",
            "examples": ["My description"]
          },
          "version": {
            "description": "Version of the test unit.",
            "type": "string",
            "examples": ["v1.0"]
          },
          "test-designer": {
            "description": "Information on the test developer(s). A sequence of key-value pairs that can be freely selected.",
            "type": "array",
            "items": {
              "type": "object"
            },
            "examples": [
              [
                {
                  "prename": "Max",
                  "surname": "S.",
                  "department": "Department A"
                },
                {
                  "prename": "Linda",
                  "department": "Department B"
                }
              ]
            ]
          },
          "additional-information": {
            "description": "Additional key-value pairs. One key 'name' is required, the other keys can be freely selected.",
            "type": "array",
            "items": {
              "type": "object",
              "required": ["name"],
              "properties": {
                "name": {
                  "type": "string",
                  "examples": ["A descriptive name"]
                }
              }
            },
            "examples": [
              [
                {
                  "name": "SUT",
                  "customerName": "Customer A"
                }
              ]
            ]
          }
        },
        "examples": [
          {
            "caption": "This is a caption",
            "description": "This is a description",
            "version": "v1.0.0",
            "test-designers": [
              {
                "name": "Max",
                "department": "PND123"
              },
              {
                "name": "Lisa",
                "department": "PND345"
              }
            ],
            "additional-information": [
              {
                "name": "Software Under Test",
                "CustomerName": "My customer",
                "SpareNumber": " 012345",
                "SRSBasleine": "4.1"
              }
            ]
          }
        ]
      }
    },
    "d6e3": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "title": "Test Unit Implementation",
        "description": "Source artifacts of the test unit. Absolute and relative paths are allowed. Relative path specifications are resolved relative to the vtestunit.yaml file.",
        "type": "array",
        "items": {
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "source-file-path": {
                  "type": "string",
                  "title": "Source File Path",
                  "description": "Path to a source file (.can/.canencr/.vtesttree.yaml).",
                  "anyOf": [
                    {
                      "pattern": "^.*\\.[Cc][Aa][Nn]$"
                    },
                    {
                      "pattern": "^.*\\.[Cc][Aa][Nn][Ee][Nn][Cc][Rr]$"
                    },
                    {
                      "pattern": "^.*\\.vtesttree.[yY][aA][mM][lL]$"
                    }
                  ],
                  "examples": [
                    "Source1.can",
                    "Source2.canencr",
                    "path/to/my/Source3.vtesttree.yaml"
                  ]
                }
              }
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "capl-library-path": {
                  "title": "CAPL Library Path",
                  "description": "Path to a CAPL library file (.dll).",
                  "$ref": "#/definitions/5342/full",
                  "examples": ["path/to/my.dll"]
                }
              }
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "modeling-library-path": {
                  "type": "string",
                  "title": "Modeling Library Path",
                  "description": "Path to a modeling library file (.vmodule).",
                  "pattern": "^.*\\.[vV][mM][oO][dD][uU][lL][eE]$",
                  "examples": ["path/to/my.vmodule"]
                }
              }
            }
          ]
        }
      }
    },
    "5342": {
      "full": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "string",
        "pattern": "^.*\\.[dD][lL][lL]$"
      }
    }
  },
  "title": "Json schema for test unit configuration files",
  "type": "object"
}