{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/codai-ro/json-schema/codai-ro-project-schema.json",
  "title": "Project",
  "description": "The stored project row (camelCase, as persisted).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/codai-ro-projects-environments-api-openapi.yml#/components/schemas/Project",
  "type": "object",
  "required": [
    "id",
    "ownerUserId",
    "orgId",
    "name",
    "slug",
    "repoUrl",
    "defaultBranch",
    "devcontainerPath",
    "isolation",
    "settings",
    "createdAt",
    "updatedAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "ownerUserId": {
      "type": "string",
      "format": "uuid"
    },
    "orgId": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "slug": {
      "type": "string",
      "description": "Unique among the owner's projects; also the prefix of generated environment slugs."
    },
    "repoUrl": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "defaultBranch": {
      "type": "string"
    },
    "devcontainerPath": {
      "type": [
        "string",
        "null"
      ]
    },
    "isolation": {
      "$ref": "#/$defs/ProjectIsolation"
    },
    "settings": {
      "type": "object",
      "additionalProperties": true
    },
    "prebuildPoolSize": {
      "type": "integer",
      "minimum": 0,
      "maximum": 5,
      "default": 0,
      "description": "Stopped, ready-to-claim prebuild machines kept for this project (0 = off)."
    },
    "prebuildProvider": {
      "type": "string",
      "enum": [
        "openstack",
        "hetzner"
      ],
      "default": "openstack"
    },
    "prebuildSize": {
      "type": "string",
      "default": "small"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "ProjectIsolation": {
      "type": "string",
      "enum": [
        "shared_vm",
        "container",
        "vm_per_dev"
      ],
      "description": "How a project's environments are shared. `shared_vm` (default) — one machine, many members; `container` — one container per member; `vm_per_dev` — one machine per developer, pinned via `for_user_id`."
    }
  }
}