Skip to content

API Reference parrot_formdesigner.ui.handlers

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.ui.handlers

View source

HTML page handlers for parrot-formdesigner.

Serves the form builder UI: index, gallery, render form, submit form.

Every handler reads the optional URL mount prefix from request.app["_form_prefix"] (populated by setup_form_routes) and forwards it to the page-template builders so that links and form actions match the routes registered by aiohttp.

Class FormPageHandler

Serves HTML pages for the form builder UI.

Parameter Type Default Description
registry FormRegistry FormRegistry instance for looking up forms.
renderer HTML5Renderer | None None HTML5Renderer for rendering form HTML.
validator FormValidator | None None FormValidator for validating submissions.

Method FormPageHandler.index

GET / — Landing page with prompt input and DB form loader.

index(request: web.Request) -> web.Response

Parameter Type Default Description
request web.Request Incoming HTTP request.

Returns: web.Response — HTML page response.

Method FormPageHandler.gallery

GET /gallery — List all previously generated forms.

gallery(request: web.Request) -> web.Response

Parameter Type Default Description
request web.Request Incoming HTTP request.

Returns: web.Response — HTML page response with the form gallery.

Method FormPageHandler.render_form

GET /forms/{form_uid} — Render the form as an HTML page.

render_form(request: web.Request) -> web.Response

Parameter Type Default Description
request web.Request Incoming HTTP request.

Returns: web.Response — HTML page with the rendered form, or 404 if not found.

Method FormPageHandler.view_schema

GET /forms/{form_uid}/schema — Display JSON Schema as an HTML page.

view_schema(request: web.Request) -> web.Response

Parameter Type Default Description
request web.Request Incoming HTTP request.

Returns: web.Response — HTML page with pretty-printed JSON Schema and Style Schema.

Method FormPageHandler.submit_form

POST /forms/{form_uid} — Validate submission, show result.

submit_form(request: web.Request) -> web.Response

Parameter Type Default Description
request web.Request Incoming HTTP request with form POST data.

Returns: web.Response — HTML page showing success or re-rendered form with errors.

Alias FormRegistry

Re-exported from parrot_formdesigner.services.registry.FormRegistry.

Alias FormValidator

Re-exported from parrot_formdesigner.services.validators.FormValidator.

Alias HTML5Renderer

Re-exported from parrot_formdesigner.renderers.html5.HTML5Renderer.

Alias JsonSchemaRenderer

Re-exported from parrot_formdesigner.renderers.jsonschema.JsonSchemaRenderer.

Alias LayoutType

Re-exported from parrot_formdesigner.core.style.LayoutType.

Alias StyleSchema

Re-exported from parrot_formdesigner.core.style.StyleSchema.

Alias error_page

Re-exported from parrot_formdesigner.ui.templates.error_page.

Alias form_page

Re-exported from parrot_formdesigner.ui.templates.form_page.

Alias gallery_page

Re-exported from parrot_formdesigner.ui.templates.gallery_page.

Alias index_page

Re-exported from parrot_formdesigner.ui.templates.index_page.

Alias page_shell

Re-exported from parrot_formdesigner.ui.templates.page_shell.

Alias schema_page

Re-exported from parrot_formdesigner.ui.templates.schema_page.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally