{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/krobar-ai/json-schema/krobar-ai-graph-patch-schema.json",
  "title": "GraphPatch",
  "description": "Schema for atomic, partial updates to a graph.\nOnly the fields provided will be updated. For dict fields (illustrations, graph_metadata, canvas_view_filters),\nthe update will merge the provided key-value pairs into the existing object, not replace the entire object.",
  "x-generated": "2026-11-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/krobar-ai-openapi.json#/components/schemas/GraphPatch",
  "properties": {
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Name",
      "description": "Name of the graph"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "Description of the graph"
    },
    "nodes": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Nodes",
      "description": "Nodes in the graph"
    },
    "edges": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Edges",
      "description": "Edges in the graph"
    },
    "graph_metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Graph Metadata",
      "description": "Additional metadata for the graph (merged)"
    },
    "project_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ],
      "title": "Project Id",
      "description": "ID of the project to move this graph to"
    },
    "time_period_unit": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Time Period Unit",
      "description": "Unit of time for simulation periods (e.g., 'month')"
    },
    "estimation_percentile": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Estimation Percentile",
      "description": "Percentile used for estimation calculations"
    },
    "simulation_trials": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Simulation Trials",
      "description": "Number of simulation trials to run"
    },
    "simulation_time_periods": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Simulation Time Periods",
      "description": "Number of time periods to simulate"
    },
    "simulation_goal_node": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Simulation Goal Node",
      "description": "Node ID used as the simulation goal"
    },
    "simulation_goal_value": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Simulation Goal Value",
      "description": "Value to reach for the goal node"
    },
    "simulation_goal_direction": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "MAXIMIZE",
            "MINIMIZE"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Simulation Goal Direction",
      "description": "Direction for the simulation goal ('MAXIMIZE' or 'MINIMIZE')"
    },
    "simulation_goal_time_period": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Simulation Goal Time Period",
      "description": "Time period to use for goal calculation (1-based index)"
    },
    "starting_time_period": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Starting Time Period",
      "description": "Actual start date/time for the simulation (e.g., 2025-08-01T00:00:00)"
    },
    "display_timezone": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Timezone",
      "description": "IANA timezone identifier for displaying the start time (e.g., 'America/New_York', 'Europe/London')"
    },
    "parameter_display_mode": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Parameter Display Mode",
      "description": "How parameters are displayed in the UI"
    },
    "canvas_view": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Canvas View",
      "description": "Current view mode of the canvas"
    },
    "illustration_style": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Illustration Style",
      "description": "Style of illustrations"
    },
    "illustrations": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Illustrations",
      "description": "Mapping of illustration keys to image IDs or URLs (merged)"
    },
    "journey_columns": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Journey Columns",
      "description": "Number of journey columns for the graph"
    },
    "canvas_view_filters": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "boolean"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Canvas View Filters",
      "description": "Filters for the canvas view (merged)"
    },
    "tags": {
      "anyOf": [
        {
          "items": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "boolean"
                }
              ]
            },
            "type": "array"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Tags",
      "description": "Tags for the graph as a list of [string, boolean] pairs, e.g. [['journey', true], ['costs', true]]"
    },
    "client_change_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client Change Id",
      "description": "Client-supplied change ID used to correlate SSE chains to a specific local edit"
    },
    "client_edit_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client Edit At",
      "description": "Client local edit timestamp (ISO)"
    }
  },
  "additionalProperties": false,
  "type": "object"
}