{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/xiaojiou176-open/Switchyard/docs/provider-runtime-catalog.schema.json",
  "title": "Switchyard Provider Runtime Catalog",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "catalogVersion",
    "providers"
  ],
  "properties": {
    "$schema": {
      "type": "string"
    },
    "catalogVersion": {
      "type": "integer",
      "minimum": 1
    },
    "providers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/provider"
      }
    }
  },
  "$defs": {
    "lane": {
      "type": "string",
      "enum": [
        "byok",
        "web-login"
      ]
    },
    "authMode": {
      "type": "string",
      "enum": [
        "byok",
        "web-login"
      ]
    },
    "stabilityTarget": {
      "type": "string",
      "enum": [
        "high-stability",
        "baseline"
      ]
    },
    "provider": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "providerId",
        "displayName",
        "lane",
        "authMode",
        "stabilityTarget",
        "truthfulMeaning"
      ],
      "properties": {
        "providerId": {
          "type": "string",
          "minLength": 1
        },
        "displayName": {
          "type": "string",
          "minLength": 1
        },
        "lane": {
          "$ref": "#/$defs/lane"
        },
        "authMode": {
          "$ref": "#/$defs/authMode"
        },
        "stabilityTarget": {
          "$ref": "#/$defs/stabilityTarget"
        },
        "truthfulMeaning": {
          "type": "string",
          "minLength": 1
        }
      }
    }
  }
}
