{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/electrical.amps_to_volts/1.4.2/input.json",
  "title": "Amps to volts — input",
  "type": "object",
  "oneOf": [
    {
      "title": "a-v-ohm",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "current",
        "resistance"
      ],
      "properties": {
        "mode": {
          "const": "a-v-ohm",
          "description": "A → V (ohms): V = I × R"
        },
        "current": {
          "type": "number",
          "description": "Current in amperes. Callable envelope: 0 and negatives are schema-valid; engine may return VALUE_MUST_BE_NON_NEGATIVE."
        },
        "resistance": {
          "type": "number",
          "description": "Resistance in ohms. Callable envelope: 0 is schema-valid (product path yields 0 V)."
        }
      }
    },
    {
      "title": "v-a-ohm",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "voltage",
        "resistance"
      ],
      "properties": {
        "mode": {
          "const": "v-a-ohm",
          "description": "V → A (ohms): I = V ÷ R"
        },
        "voltage": {
          "type": "number",
          "description": "Voltage in volts. Callable envelope: 0 is schema-valid; 0/0 → UNDEFINED."
        },
        "resistance": {
          "type": "number",
          "description": "Resistance in ohms. Callable envelope: 0 is schema-valid; engine returns RESISTANCE_MUST_BE_NONZERO or UNDEFINED."
        }
      }
    },
    {
      "title": "a-v-watt",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "power",
        "current",
        "system"
      ],
      "properties": {
        "mode": {
          "const": "a-v-watt",
          "description": "A → V (watts): V = P ÷ (√3? · I · PF)"
        },
        "power": {
          "type": "number",
          "description": "Real power in watts. Callable envelope: 0 is schema-valid."
        },
        "current": {
          "type": "number",
          "description": "Current in amperes (RMS for AC). Callable envelope: 0 is schema-valid; engine returns CURRENT_MUST_BE_NONZERO or UNDEFINED."
        },
        "system": {
          "type": "string",
          "enum": [
            "dc",
            "ac_single",
            "ac_three"
          ],
          "description": "dc = DC (PF unused); ac_single = single-phase AC; ac_three = balanced three-phase L-L"
        },
        "power_factor": {
          "type": "number",
          "description": "Required for AC. Must be omitted for DC. Engine requires (0, 1]. UI initializes AC PF to 1.0; Agent must send it for AC. Legacy REST aliases: a/b, phase, pf."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "system": {
                "enum": [
                  "ac_single",
                  "ac_three"
                ]
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "required": [
              "power_factor"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "system": {
                "const": "dc"
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "not": {
              "required": [
                "power_factor"
              ]
            }
          }
        }
      ]
    },
    {
      "title": "v-a-watt",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "mode",
        "power",
        "voltage",
        "system"
      ],
      "properties": {
        "mode": {
          "const": "v-a-watt",
          "description": "V → A (watts): I = P ÷ (√3? · V · PF)"
        },
        "power": {
          "type": "number",
          "description": "Real power in watts. Callable envelope: 0 is schema-valid."
        },
        "voltage": {
          "type": "number",
          "description": "Voltage in volts (RMS for AC; L-L when system=ac_three). Callable envelope: 0 is schema-valid; engine returns VOLTAGE_MUST_BE_POSITIVE or UNDEFINED."
        },
        "system": {
          "type": "string",
          "enum": [
            "dc",
            "ac_single",
            "ac_three"
          ],
          "description": "dc = DC (PF unused); ac_single = single-phase AC; ac_three = balanced three-phase L-L"
        },
        "power_factor": {
          "type": "number",
          "description": "Required for AC. Must be omitted for DC. Engine requires (0, 1]. UI initializes AC PF to 1.0; Agent must send it for AC. Legacy REST aliases: a/b, phase, pf."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "system": {
                "enum": [
                  "ac_single",
                  "ac_three"
                ]
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "required": [
              "power_factor"
            ]
          }
        },
        {
          "if": {
            "properties": {
              "system": {
                "const": "dc"
              }
            },
            "required": [
              "system"
            ]
          },
          "then": {
            "not": {
              "required": [
                "power_factor"
              ]
            }
          }
        }
      ]
    }
  ],
  "description": "Solve voltage from current plus resistance or power, and reverse to current. Watts paths cover DC, AC single-phase, and balanced three-phase L-L. (calculation_version 1.4.2)"
}
