{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/finology-tech/json-schema/finology-tech-comparison-request-schema.json",
  "title": "ComparisonRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/finology-tech-openapi.json#/components/schemas/ComparisonRequest",
  "required": [
    "arms"
  ],
  "type": "object",
  "properties": {
    "arms": {
      "maxItems": 10,
      "minItems": 2,
      "type": "array",
      "items": {
        "$ref": "#/$defs/ComparisonArm"
      }
    },
    "includeYearly": {
      "type": "boolean",
      "description": "Optional, default false. Send \"includeYearly\": true to add `yearly` to each projection: year 0 is the loan book as sent; year n covers repayment months 12(n-1) to 12n-1 and gives the principal and interest balance after that year's last payment, the payments that year, the cumulative paid and any balance forgiven that year (date = that month). The series ends at the payoff or forgiveness month. Payments sum to totalOutOfPocket and forgiven amounts to amountForgiven. Money in cents. Default false: the field is then absent and the response is unchanged.",
      "default": false
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ComparisonArm": {
      "required": [
        "loans",
        "scenario"
      ],
      "type": "object",
      "properties": {
        "scenario": {
          "$ref": "#/$defs/ScenarioRequest"
        },
        "loans": {
          "maxItems": 100,
          "minItems": 1,
          "type": "array",
          "items": {
            "$ref": "#/$defs/LoanRequest"
          }
        }
      },
      "additionalProperties": false
    },
    "LoanRequest": {
      "required": [
        "interestRate",
        "loanType",
        "principalBalance"
      ],
      "type": "object",
      "properties": {
        "loanType": {
          "minLength": 1,
          "type": "string"
        },
        "principalBalance": {
          "maximum": 100000000,
          "minimum": 0,
          "type": "number",
          "format": "double"
        },
        "interestBalance": {
          "maximum": 100000000,
          "minimum": 0,
          "type": "number",
          "format": "double"
        },
        "interestRate": {
          "maximum": 1,
          "minimum": 0,
          "type": "number",
          "format": "double"
        },
        "disbursedAmount": {
          "maximum": 100000000,
          "minimum": 0,
          "type": "number",
          "format": "double"
        },
        "idrMonthsInRepayment": {
          "maximum": 600,
          "minimum": 0,
          "type": "integer",
          "format": "int32"
        },
        "pslfCount": {
          "maximum": 120,
          "minimum": 0,
          "type": "integer",
          "format": "int32"
        }
      },
      "additionalProperties": false
    },
    "ScenarioRequest": {
      "required": [
        "adjustedGrossIncome",
        "dependents",
        "filingStatus",
        "planType",
        "state",
        "workingTowardsPslf"
      ],
      "type": "object",
      "properties": {
        "planType": {
          "minLength": 1,
          "type": "string"
        },
        "adjustedGrossIncome": {
          "maximum": 100000000,
          "minimum": 0,
          "type": "number",
          "format": "double"
        },
        "spouseAdjustedGrossIncome": {
          "maximum": 100000000,
          "minimum": 0,
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "spouseFederalLoanBalance": {
          "maximum": 100000000,
          "minimum": 0,
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "filingStatus": {
          "minLength": 1,
          "type": "string"
        },
        "dependents": {
          "maximum": 30,
          "minimum": 0,
          "type": "integer",
          "format": "int32"
        },
        "state": {
          "minLength": 1,
          "pattern": "^[A-Za-z]{2}$",
          "type": "string"
        },
        "workingTowardsPslf": {
          "type": "boolean"
        },
        "annualIncomeGrowth": {
          "maximum": 0.5,
          "minimum": 0,
          "type": "number",
          "format": "double"
        },
        "label": {
          "maxLength": 80,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    }
  }
}