{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "sailpoint.isc.transforms.reference.schema.json",
  "title": "SailPoint ISC Transform Schema - reference",
  "description": "Strict schema derived from SailPoint official Reference operation documentation. References (reuses) another transform by its id.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "name",
    "attributes"
  ],
  "properties": {
    "type": {
      "const": "reference"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "requiresPeriodicRefresh": {
      "type": "boolean",
      "default": false,
      "description": "Whether the transform should be reevaluated nightly as part of identity refresh. Default false."
    },
    "attributes": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "ID of the transform to reference."
        },
        "input": {
          "description": "Optional explicit input. Some docs show input for reference; if present, it is an object. Modeled as a nested transform object to align with other operations.",
          "oneOf": [
            {
              "$ref": "#/$defs/NestedTransform"
            }
          ]
        }
      }
    }
  },
  "$defs": {
    "NestedTransform": {
      "type": "object",
      "description": "Nested transform object used as explicit input (name optional in docs).",
      "additionalProperties": false,
      "required": [
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "minLength": 1
        },
        "type": {
          "type": "string",
          "minLength": 1
        },
        "requiresPeriodicRefresh": {
          "type": "boolean"
        },
        "attributes": {
          "type": "object",
          "additionalProperties": true,
          "description": "Operation-specific attributes for the nested transform."
        }
      }
    }
  },
  "examples": [
    {
      "type": "reference",
      "name": "Reference Transform",
      "attributes": {
        "id": "2c91808a7c9b5d0c017c9c2a12345678"
      }
    }
  ]
}
