{
  "openapi": "3.1.0",
  "info": {
    "title": "mizan Server Functions",
    "description": "Auto-generated schema for mizan server functions",
    "version": "1.0.0"
  },
  "paths": {
    "/mizan/echo": {
      "post": {
        "summary": "Echoes the input text.",
        "operationId": "echo",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/echoInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/echoOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/add": {
      "post": {
        "summary": "Returns a + b.",
        "operationId": "add",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/addInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/addOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/multiply": {
      "post": {
        "summary": "Returns x * y.",
        "operationId": "multiply",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/multiplyInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/multiplyOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/whoami": {
      "post": {
        "summary": "Returns the authenticated user's identity. Anonymous → UNAUTHORIZED.",
        "operationId": "whoami",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/whoamiOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/staff_only": {
      "post": {
        "summary": "Staff-only endpoint.",
        "operationId": "staffOnly",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/staffOnlyOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/superuser_only": {
      "post": {
        "summary": "Superuser-only endpoint.",
        "operationId": "superuserOnly",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/superuserOnlyOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/verified_only": {
      "post": {
        "summary": "Verified-users-only endpoint. Anonymous → FORBIDDEN.",
        "operationId": "verifiedOnly",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/verifiedOnlyOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/not_implemented_fn": {
      "post": {
        "summary": "Always raises NotImplementedError → NOT_IMPLEMENTED.",
        "operationId": "notImplementedFn",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/notImplementedFnOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/buggy_fn": {
      "post": {
        "summary": "Always raises a generic exception → INTERNAL_ERROR.",
        "operationId": "buggyFn",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/buggyFnOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/permission_check_fn": {
      "post": {
        "summary": "Wrong secret → FORBIDDEN; correct secret → success.",
        "operationId": "permissionCheckFn",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/permissionCheckFnInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/permissionCheckFnOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    },
    "/mizan/current_user": {
      "post": {
        "summary": "The global context — auto-mounted at the React root.",
        "operationId": "currentUser",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/currentUserOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": "global"
        }
      }
    },
    "/mizan/morph_groups": {
      "post": {
        "summary": "Summary-shape slot — server must route MorphLayer mutations away from here.",
        "operationId": "morphGroups",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/morphGroupsOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": "morphs"
        }
      }
    },
    "/mizan/morph_layers": {
      "post": {
        "summary": "Detailed-shape slot — server routes MorphLayer mutations here.",
        "operationId": "morphLayers",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/morphLayersOutput"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": "morphs"
        }
      }
    },
    "/mizan/set_morph_value": {
      "post": {
        "summary": "Mutation that returns the changed row; kernel splices into morph_layers.",
        "operationId": "setMorphValue",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/setMorphValueInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/setMorphValueOutput"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "x-mizan": {
          "transport": "http",
          "isContext": false
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "MorphGroupMeta": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "count"
        ],
        "title": "MorphGroupMeta",
        "description": "Group summary — narrower shape than MorphLayer. Listed alongside\nmorph_layers so the server's slot resolver has to discriminate by\nreturn-type rather than by bundle order."
      },
      "MorphLayer": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "group_id": {
            "type": "integer",
            "title": "Group Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "value": {
            "type": "number",
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "id",
          "group_id",
          "label",
          "value"
        ],
        "title": "MorphLayer"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "addInput": {
        "properties": {
          "a": {
            "type": "integer",
            "title": "A"
          },
          "b": {
            "type": "integer",
            "title": "B"
          }
        },
        "type": "object",
        "required": [
          "a",
          "b"
        ],
        "title": "addInput"
      },
      "addOutput": {
        "properties": {
          "result": {
            "type": "integer",
            "title": "Result"
          }
        },
        "type": "object",
        "required": [
          "result"
        ],
        "title": "addOutput"
      },
      "buggyFnOutput": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "buggyFnOutput"
      },
      "currentUserOutput": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "authenticated": {
            "type": "boolean",
            "title": "Authenticated"
          },
          "is_staff": {
            "type": "boolean",
            "title": "Is Staff",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "email",
          "authenticated"
        ],
        "title": "currentUserOutput"
      },
      "echoInput": {
        "properties": {
          "text": {
            "type": "string",
            "title": "Text"
          }
        },
        "type": "object",
        "required": [
          "text"
        ],
        "title": "echoInput"
      },
      "echoOutput": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "echoOutput"
      },
      "morphGroupsOutput": {
        "items": {
          "$ref": "#/components/schemas/MorphGroupMeta"
        },
        "type": "array",
        "title": "morphGroupsOutput"
      },
      "morphLayersOutput": {
        "items": {
          "$ref": "#/components/schemas/MorphLayer"
        },
        "type": "array",
        "title": "morphLayersOutput"
      },
      "multiplyInput": {
        "properties": {
          "x": {
            "type": "integer",
            "title": "X"
          },
          "y": {
            "type": "integer",
            "title": "Y"
          }
        },
        "type": "object",
        "required": [
          "x",
          "y"
        ],
        "title": "multiplyInput"
      },
      "multiplyOutput": {
        "properties": {
          "product": {
            "type": "integer",
            "title": "Product"
          }
        },
        "type": "object",
        "required": [
          "product"
        ],
        "title": "multiplyOutput"
      },
      "notImplementedFnOutput": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "notImplementedFnOutput"
      },
      "permissionCheckFnInput": {
        "properties": {
          "secret": {
            "type": "string",
            "title": "Secret"
          }
        },
        "type": "object",
        "required": [
          "secret"
        ],
        "title": "permissionCheckFnInput"
      },
      "permissionCheckFnOutput": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "permissionCheckFnOutput"
      },
      "setMorphValueInput": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "value": {
            "type": "number",
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "id",
          "value"
        ],
        "title": "setMorphValueInput"
      },
      "setMorphValueOutput": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "group_id": {
            "type": "integer",
            "title": "Group Id"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "value": {
            "type": "number",
            "title": "Value"
          }
        },
        "type": "object",
        "required": [
          "id",
          "group_id",
          "label",
          "value"
        ],
        "title": "setMorphValueOutput"
      },
      "staffOnlyOutput": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "staffOnlyOutput"
      },
      "superuserOnlyOutput": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "superuserOnlyOutput"
      },
      "verifiedOnlyOutput": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "verifiedOnlyOutput"
      },
      "whoamiOutput": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email"
          },
          "authenticated": {
            "type": "boolean",
            "title": "Authenticated"
          },
          "is_staff": {
            "type": "boolean",
            "title": "Is Staff",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "email",
          "authenticated"
        ],
        "title": "whoamiOutput"
      }
    }
  },
  "x-mizan-functions": [
    {
      "name": "echo",
      "camelName": "echo",
      "hasInput": true,
      "inputType": "echoInput",
      "outputType": "echoOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "add",
      "camelName": "add",
      "hasInput": true,
      "inputType": "addInput",
      "outputType": "addOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "multiply",
      "camelName": "multiply",
      "hasInput": true,
      "inputType": "multiplyInput",
      "outputType": "multiplyOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "whoami",
      "camelName": "whoami",
      "hasInput": false,
      "inputType": null,
      "outputType": "whoamiOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "staff_only",
      "camelName": "staffOnly",
      "hasInput": false,
      "inputType": null,
      "outputType": "staffOnlyOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "superuser_only",
      "camelName": "superuserOnly",
      "hasInput": false,
      "inputType": null,
      "outputType": "superuserOnlyOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "verified_only",
      "camelName": "verifiedOnly",
      "hasInput": false,
      "inputType": null,
      "outputType": "verifiedOnlyOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "not_implemented_fn",
      "camelName": "notImplementedFn",
      "hasInput": false,
      "inputType": null,
      "outputType": "notImplementedFnOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "buggy_fn",
      "camelName": "buggyFn",
      "hasInput": false,
      "inputType": null,
      "outputType": "buggyFnOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "permission_check_fn",
      "camelName": "permissionCheckFn",
      "hasInput": true,
      "inputType": "permissionCheckFnInput",
      "outputType": "permissionCheckFnOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "current_user",
      "camelName": "currentUser",
      "hasInput": false,
      "inputType": null,
      "outputType": "currentUserOutput",
      "transport": "http",
      "isContext": "global",
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "morph_groups",
      "camelName": "morphGroups",
      "hasInput": false,
      "inputType": null,
      "outputType": "morphGroupsOutput",
      "transport": "http",
      "isContext": "morphs",
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "morph_layers",
      "camelName": "morphLayers",
      "hasInput": false,
      "inputType": null,
      "outputType": "morphLayersOutput",
      "transport": "http",
      "isContext": "morphs",
      "isForm": false,
      "formName": null,
      "formRole": null
    },
    {
      "name": "set_morph_value",
      "camelName": "setMorphValue",
      "hasInput": true,
      "inputType": "setMorphValueInput",
      "outputType": "setMorphValueOutput",
      "transport": "http",
      "isContext": false,
      "isForm": false,
      "formName": null,
      "formRole": null,
      "merge": [
        "morphs"
      ]
    }
  ],
  "x-mizan-contexts": {
    "global": {
      "functions": [
        "current_user"
      ],
      "params": {}
    },
    "morphs": {
      "functions": [
        "morph_groups",
        "morph_layers"
      ],
      "params": {}
    }
  }
}