{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/latest.json",
  "title": "mlos_bench config schema",
  "description": "Any mlos_bench config - this is the top level schema that should be used to validate any mlos_bench config",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/microsoft/MLOS/main/mlos_bench/mlos_bench/config/schemas/mlos-bench-config-schema.json",
    "sourceSha256": "b8fcdd19c3ec33455f8c8877087a71120341b8c92442f6f0bc432ab0f34a4683",
    "fileMatch": [
      "*.mlos.jsonc",
      "*.mlos.json5",
      "*.mlos.json"
    ],
    "parsers": [
      "json",
      "json5",
      "jsonc"
    ]
  },
  "if": {
    "$comment": "check if the config has a class or services property",
    "type": "object",
    "properties": {
      "class": {
        "type": "string"
      },
      "services": {
        "type": "array"
      }
    },
    "oneOf": [
      {
        "required": [
          "class"
        ]
      },
      {
        "properties": {
          "$schema": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "services": {
            "type": "array"
          }
        },
        "required": [
          "services"
        ],
        "unevaluatedProperties": false,
        "type": "object"
      }
    ]
  },
  "else": {
    "$comment": "these configs are *mostly* flat dicts",
    "anyOf": [
      {
        "description": "cli config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--cli-schema.json"
      },
      {
        "description": "globals config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--globals-schema.json"
      },
      {
        "description": "tunables params config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--tunable-params-schema.json"
      },
      {
        "description": "tunables values config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--tunable-values-schema.json"
      }
    ]
  },
  "then": {
    "oneOf": [
      {
        "description": "environment config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--environment-schema.json"
      },
      {
        "description": "optimizer config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--optimizer-schema.json"
      },
      {
        "description": "scheduler config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--scheduler-schema.json"
      },
      {
        "description": "service config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--service-schema.json"
      },
      {
        "description": "storage config",
        "type": "object",
        "$ref": "https://catalog.lintel.tools/schemas/schemastore/mlos-config-mlos-jsonc-mlos-json5-mlos-json/_shared/latest--storage-schema.json"
      }
    ]
  }
}
