-
Notifications
You must be signed in to change notification settings - Fork 600
Description
GSoC 2026 Proposal: JSON Schema Driven Form Component [APISIX-39]
1. Project Information
- Project Name: JSON Schema to Form UI for APISIX Dashboard (APISIX-39)
- Student Name: Deep Shekhar Singh
- GitHub: @DSingh0304
- Timezone: IST (UTC+5:30)
2. Why I am the Right Candidate for this Project
Over the past few months, I have become deeply involved in the APISIX Dashboard codebase, significantly improving its stability and test coverage. I am intimately familiar with its React 19 + Mantine + react-hook-form architecture.
My Key Core Contributions:
- Massive E2E Test Suite Expansion (10+ Merged PRs): Authored comprehensive E2E tests for almost every major resource, including Services (test(e2e): add comprehensive service CRUD tests and UI utility functions #3258), Stream Routes (test: add stream route E2E tests with detail page flows #3255), Consumer Groups (test: add E2E tests for Consumer Groups #3250), SSLs (test: add E2E tests for SSLs (#3087) #3249), Global Rules (test: add E2E tests for global rules #3248), Plugin Metadata (test: add E2E tests for plugin metadata resource #3247), Plugin Configs (test: add comprehensive E2E tests for plugin configs #3246), Secrets (test: add comprehensive E2E tests for Secrets resource #3245), Protos (test: add E2E tests for protos #3244), and Consumers (test(e2e): Add E2E tests for consumer and credentials #3243).
- UI Crash Resolution: Resolved UI crashes caused by
varsform component array formatting viaa.trim()tags input (fix: a.trim is not a function #3286). - Advanced Search Implementation: Developed the hybrid routing search form with 9 frontend/backend filter fields (feat: add route search form with 9 filter fields #3222).
- CI Pipeline Improvement: Implemented the strict CI Linting workflow (feat: add lint workflow #3291).
3. Working Proof of Concept (Submitted in January, PR #3274)
I didn't want to just propose an idea; I wanted to prove it works natively within the dashboard. In early January, I submitted an initial Proof of Concept that addressed the core concerns in the original feature request (#2986). The maintainer (@Baoyuantop) validated this approach and the corresponding PR #3274.
(Below is a screen recording of the working SchemaForm PoC generating the UI for the proxy-rewrite plugin directly from its JSON Schema)
Screencast.from.2026-03-03.20-30-24.mp4
Since that initial validation, the PoC has been extended and currently successfully implements rendering of basic types, oneOf, dependencies, and dynamic array handling without external libraries (using RHF's useFieldArray and Mantine's TagsInput), all wrapped in an AJV validation pipeline with zero new heavy external dependencies.
4. Project Description & Approach
The Problem:
Currently, configuring APISIX plugins in the Dashboard requires writing raw JSON in a Monaco editor within PluginEditorDrawer. With over 150+ plugins, each with unique schema definitions, maintaining hand-coded forms is unsustainable. Relying on raw JSON leads to a steep learning curve, validation errors, and a poor developer experience.
The Solution & Approach:
The Admin API already exposes full JSON Schema at GET /apisix/admin/schema/plugins/{name}. We can dynamically auto-generate user-friendly forms directly from these schemas.
Instead of relying on heavy third-party JSON-to-Form libraries that are hard to customize, my approach builds exactly upon the Technical Design outlined in #2988:
- React Hook Form (RHF): For performant, un-controlled form state management.
- AJV: For deterministic validation, bridging errors to
react-hook-formsetError. - Mantine UI 8: Reusing existing widgets from
src/components/form/.
The Integration Strategy (The "Toggle" Approach):
Replacing a working JSON editor carries a risk if a complex plugin schema has unsupported edge cases. I propose integrating the SchemaForm into PluginEditorDrawer with a toggle switch. Users see the auto-generated UI form by default, but can toggle back to the raw JSON Monaco editor for unrecognized/complex schema portions. This guarantees zero regressions.
5. Deliverables & Implementation Phases
Must-have (Phase 1 - Early/Mid GSoC)
- Reusable
SchemaFormcomponent that accepts a JSON Schema object and renders a complete form. - Widget mapping for basic types: string →
TextInput, number/integer →NumberInput, boolean →Switch, object → nested fieldset, array → repeatable field group (useFieldArray). enumsupport mapping toSelectdropdown.- Support for
defaultvalues andrequiredfield enforcement. - Basic constraints:
minimum/maximum,minLength/maxLength,pattern,exclusiveMinimum,minItems/maxItems. oneOfsupport (selector to choose a variant, render corresponding fields).dependencies/ conditional fields (show/hide fields based on other field values).if/then/elseconditional sub-schema rendering.- Validation via AJV against the original JSON Schema, mapping errors inline.
encrypt_fieldsmeta handling (rendering asPasswordInput).
Should-have (Phase 2 - Mid/Late GSoC)
- Full
PluginEditorDrawerintegration with Toggle Fallback logic betweenSchemaFormand Monaco JSON editor. anyOfsupport.patternPropertiessupport (dynamic key-value editor).- Schema-to-widget override registry (e.g.,
x-widgetstandard for custom widgets). - Comprehensive Unit & E2E Testing (Playwright).
Nice-to-have (Phase 3 - End of GSoC / Post-GSoC)
allOfmerging.$ref/$defsresolution.- Read-only/disabled mode for viewing existing config.
6. APISIX Plugin Schema Patterns to Support
| Pattern | Example Plugins Utilizing Pattern |
|---|---|
oneOf |
limit-conn, limit-count, jwt-auth, response-rewrite |
dependencies |
limit-conn, jwt-auth |
if/then/else |
response-rewrite, limit-conn, openid-connect, ai-proxy |
anyOf |
Core schema_def.lua, ai-proxy-multi |
patternProperties |
ai-proxy, labels_def |
| Arrays & Objects | traffic-split |
7. Related Resources
- Admin API schema endpoint:
apisix/admin/plugins.lua - Core schemas:
apisix/schema_def.lua - Dashboard technical design: Technical Design of the New Dashboard #2988
(cc @Baoyuantop @juzhiyuan @nic-chen @LiteSun @liuxiran @bzp2010)
8. Other Commitments
- I am fully committed to completing this project. I have no other internships or full-time jobs planned for this summer.