{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.soustack.org/stacks/substitutions.schema.json",
  "title": "Substitutions Stack",
  "type": "object",
  "properties": {
    "substitutions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "for": { "type": "string" },
          "alternatives": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "ratio": { "type": "string" },
                "metadata": { "type": "object", "additionalProperties": true }
              },
              "required": ["name", "ratio"],
              "additionalProperties": false,
              "patternProperties": {
                "^x-": { "$ref": "../defs/common.schema.json#/properties/extensionLaneValue" }
              }
            },
            "minItems": 1
          },
          "metadata": { "type": "object", "additionalProperties": true }
        },
        "required": ["for", "alternatives"],
        "additionalProperties": false,
        "patternProperties": {
          "^x-": { "$ref": "../defs/common.schema.json#/properties/extensionLaneValue" }
        }
      },
      "minItems": 1
    }
  },
  "required": ["substitutions"],
  "additionalProperties": false
}
