{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/onclarity-com/json-schema/onclarity-com-create-function-request-schema.json",
  "title": "CreateFunctionRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/onclarity-com-cloud-functions-admin-api-openapi.yml#/components/schemas/CreateFunctionRequest",
  "properties": {
    "name": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9-]{0,62}$",
      "title": "Name",
      "description": "Unique in the project: lowercase letters, digits, hyphens."
    },
    "description": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "handler": {
      "type": "string",
      "title": "Handler",
      "description": "`module.function`, e.g. `main.handler`.",
      "default": "main.handler"
    },
    "timeout_s": {
      "type": "integer",
      "maximum": 900.0,
      "minimum": 1.0,
      "title": "Timeout S",
      "description": "Seconds before Lambda stops a run.",
      "default": 60
    },
    "memory_mb": {
      "type": "integer",
      "maximum": 2048.0,
      "minimum": 128.0,
      "title": "Memory Mb",
      "description": "Memory in MB; CPU scales with it.",
      "default": 256
    },
    "code_zip_base64": {
      "type": "string",
      "minLength": 1,
      "title": "Code Zip Base64",
      "description": "The zip, base64: the handler module at its root plus vendored packages."
    },
    "http_enabled": {
      "type": "boolean",
      "title": "Http Enabled",
      "description": "Serve the function's own routes to mini-apps (`voc.functions.fetch`): the handler gets API Gateway HTTP API v2 events. Needs `timeout_s` <= 30.",
      "default": false
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "name",
    "code_zip_base64"
  ]
}