{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-create-subgraph-request-schema.json",
  "title": "CreateSubgraphRequest",
  "description": "Request model for creating a subgraph.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-graph-operations-api-openapi.yml#/components/schemas/CreateSubgraphRequest",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 20,
      "minLength": 1,
      "title": "Name",
      "description": "Alphanumeric name for the subgraph (e.g., dev, staging, prod1)"
    },
    "display_name": {
      "type": "string",
      "maxLength": 100,
      "minLength": 1,
      "title": "Display Name",
      "description": "Human-readable display name for the subgraph"
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Description",
      "description": "Optional description of the subgraph's purpose"
    },
    "schema_extensions": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Schema Extensions",
      "description": "Schema extensions to include (inherits from parent by default)"
    },
    "subgraph_type": {
      "$ref": "#/$defs/SubgraphType",
      "description": "Type of subgraph: 'static' (parent's base + extensions), 'knowledge' (knowledge-only schema), or 'empty' (bare database, no schema).",
      "default": "static"
    },
    "metadata": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Metadata",
      "description": "Additional metadata for the subgraph"
    },
    "fork_parent": {
      "type": "boolean",
      "title": "Fork Parent",
      "description": "If true, copy all data from parent graph to create a 'fork'",
      "default": false
    }
  },
  "type": "object",
  "required": [
    "name",
    "display_name"
  ],
  "$defs": {
    "SubgraphType": {
      "type": "string",
      "enum": [
        "static",
        "knowledge",
        "empty"
      ],
      "title": "SubgraphType",
      "description": "Types of subgraphs."
    }
  }
}