-
Notifications
You must be signed in to change notification settings - Fork 603
Open
Description
Feature request
Please describe your feature
APISIX Dashboard plugin configuration is currently edited mostly as raw JSON.
This creates friction for users who are not deeply familiar with each plugin schema and increases the chance of invalid or incomplete configurations.
A schema-driven UI can improve correctness and usability by rendering form controls directly from JSON Schema metadata while preserving raw JSON for advanced users.
Describe the solution you'd like
I propose a production-ready JSON Schema -> Form UI engine for plugin configuration, built incrementally on top of the existing PoC:
- PoC PR: feat(poc): add schema form prototype with raw json fallback #3346
- PoC scope: Prototype form mode + raw JSON fallback + basic schema mapping
Core solution architecture
- Schema Resolver Layer
- Parse and normalize plugin schema definitions
- Resolve nested object paths and defaults
- Support APISIX-specific schema extensions where applicable
- Field Mapping Layer
- Map schema types/formats to UI widgets:
string-> text/password/textareanumber/integer-> numeric inputboolean-> switch/checkboxenum-> select/radioarray-> tags/list editorobject-> grouped/nested form section
- Generate labels/help text/placeholders from schema metadata
- Conditional Rendering Engine
- Render dynamic branches for:
if / then / elseanyOf/oneOf(phased)- dependencies / required-on-condition
- Recompute active form tree when discriminator values change
- Validation Layer
- Integrate AJV-based validation for schema compliance
- Provide field-level and form-level errors
- Show user-friendly messages mapped to exact field paths
- Sync + Fallback Layer
- Two-way sync between Form Mode and Raw JSON Mode
- Safe fallback to JSON editor for unsupported/advanced cases
- Preserve values during mode switching without data loss
Detailed implementation proposal
Phase 1: Foundation (Parser + Renderer MVP)
- Build schema normalization utilities
- Implement base widget mapping for common primitive/object/array types
- Add typed form state integration and value serialization
- Deliver plugin editor mode switch: Schema Form <-> Raw JSON
Deliverables
- Stable schema parser + renderer
- Coverage for high-frequency plugin schema patterns
- Initial unit tests for parser and widget mapping
Phase 2: Conditional Logic + Advanced Schema Support
- Implement robust
if/then/else - Add
anyOfbranch selection and branch-specific validation - Handle nested conditional sections and dependencies
- Improve UX for hidden/disabled fields in inactive branches
Deliverables
- Condition engine with deterministic re-render behavior
- Extended test matrix for branch transitions and edge cases
- Demo scenarios proving dynamic behavior
Phase 3: Validation + Error UX
- AJV integration with compiled validators
- Normalize AJV errors into UI-friendly field errors
- Add inline errors, summary panel, and invalid-section highlighting
- Prevent unsafe submission when schema validation fails
Deliverables
- End-to-end validation flow
- Clear error reporting and recovery UX
- Regression tests for validation scenarios
Phase 4: Hardening + Rollout
- Add E2E tests for representative plugins
- Performance optimization for large/nested schemas
- Documentation for contributors and schema authors
- Progressive enablement for more plugin forms
Deliverables
- Production-quality behavior and docs
- Verified compatibility across supported plugin config flows
- Rollout checklist and maintenance guidance
Expected outcomes
- Reduced configuration errors and invalid submissions
- Faster plugin setup for first-time and intermediate users
- Better maintainability through schema-first form generation
- Retained power-user control through raw JSON fallback
Describe alternatives you've considered
- Keep raw JSON only
- Lowest implementation effort, but poor UX and higher error rate.
- Handcrafted form per plugin
- Good UX per plugin, but not scalable and expensive to maintain.
- Hybrid schema-driven + JSON fallback (proposed)
- Best tradeoff: scalable generation with escape hatch for advanced cases.
Additional context
Related work
Demo video
20260321-2249-53.6838486.mp4
Initial acceptance criteria
- Schema Form mode available in plugin editor
- Supported primitive/object/array fields render correctly
- Conditional sections (
if/then/else) render correctly - Validation errors shown with accurate field mapping
- Raw JSON fallback remains available and sync-safe
- Unit + E2E tests cover core flows
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels