{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "sailpoint.isc.transforms.join.schema.json",
  "title": "SailPoint ISC Transform Schema - join",
  "description": "Strict schema derived from SailPoint official Join operation documentation. Join concatenates an array of values into a single string output using an optional separator (default ',').",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "name",
    "attributes"
  ],
  "properties": {
    "type": {
      "const": "join"
    },
    "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": [
        "values"
      ],
      "properties": {
        "values": {
          "type": "array",
          "minItems": 2,
          "description": "Array of items to join. Each item can be a static string or a nested transform object.",
          "items": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/NestedTransform"
              }
            ]
          }
        },
        "separator": {
          "type": "string",
          "default": ",",
          "description": "Separator used between joined values. Default ','."
        }
      }
    }
  },
  "$defs": {
    "NestedTransform": {
      "type": "object",
      "description": "Nested transform object used inside values[]. Docs examples often omit 'name' for nested transforms.",
      "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": "join",
      "name": "Join Transform",
      "attributes": {
        "separator": ";",
        "values": [
          {
            "type": "accountAttribute",
            "attributes": {
              "sourceName": "HR Source",
              "attributeName": "role1"
            }
          },
          {
            "type": "accountAttribute",
            "attributes": {
              "sourceName": "HR Source",
              "attributeName": "role2"
            }
          }
        ]
      }
    }
  ]
}
