{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bloomberg-buyside-enterprise-solutions/json-schema/bloomberg-buyside-enterprise-solutions-stress-test-request-schema.json",
  "title": "StressTestRequest",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bloomberg-buyside-enterprise-solutions-stress-testing-api-openapi.yml#/components/schemas/StressTestRequest",
  "type": "object",
  "required": [
    "portfolioId"
  ],
  "properties": {
    "portfolioId": {
      "type": "string",
      "description": "Portfolio to stress test"
    },
    "scenarioIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Predefined stress scenario identifiers"
    },
    "customScenarios": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Custom scenario name"
          },
          "shocks": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/MarketShock"
            }
          }
        }
      },
      "description": "Custom stress scenarios"
    }
  },
  "$defs": {
    "MarketShock": {
      "type": "object",
      "required": [
        "variable",
        "shockType",
        "value"
      ],
      "properties": {
        "variable": {
          "type": "string",
          "enum": [
            "INTEREST_RATE",
            "CREDIT_SPREAD",
            "EQUITY_PRICE",
            "FX_RATE",
            "VOLATILITY",
            "COMMODITY_PRICE",
            "INFLATION"
          ],
          "description": "Market variable to shock"
        },
        "shockType": {
          "type": "string",
          "enum": [
            "ABSOLUTE",
            "RELATIVE",
            "OVERRIDE"
          ],
          "description": "Type of shock to apply"
        },
        "value": {
          "type": "number",
          "description": "Shock magnitude"
        },
        "tenor": {
          "type": "string",
          "description": "Specific tenor for rate shocks (e.g., \"5Y\", \"10Y\")"
        },
        "currency": {
          "type": "string",
          "description": "Currency for the shock (ISO 4217)"
        }
      }
    }
  }
}