ShreyasGhodke commented on issue #3347:
URL:
https://github.com/apache/apisix-dashboard/issues/3347#issuecomment-4109820268
## Feature request
### Please describe your feature
Plugin configuration in Apache APISIX Dashboard is currently edited
primarily as raw JSON.
While flexible, this approach increases cognitive load, especially for new
users, and can lead to invalid configurations due to schema unfamiliarity.
Since APISIX plugins already provide JSON Schema definitions, the dashboard
can leverage this to provide a schema-driven configuration UI.
---
### Describe the solution you'd like
I propose building a **reusable, schema-driven form engine** for plugin
configuration by **extending and aligning with the existing PoC (#3274)**
rather than introducing a parallel implementation.
The goal is to deliver a **progressively enhanced SchemaForm system** that:
* reuses the existing SchemaForm foundation (#3274)
* improves correctness and stability
* incrementally adds missing capabilities required for production use
---
## Core Design Approach
### 1. Schema Integration Layer
* Reuse schema parsing logic from #3274 where available
* Normalize plugin schema into a consistent internal structure
* Handle:
* nested objects
* default values
* required fields
Focus: **stability and correctness over reimplementation**
---
### 2. Field Rendering Layer
Extend existing component mappings:
* string → input / textarea
* number/integer → numeric input
* boolean → switch
* enum → select / radio
* object → nested sections
* array → dynamic list editor
Enhancements:
* better label/description extraction
* improved layout consistency
* support for default value hydration
---
### 3. Conditional Rendering (Focused Improvement)
Instead of rebuilding logic, improve correctness of existing patterns:
* fix branch switching inconsistencies
* ensure inactive branches:
* do not leak values into submission
* properly clean up form state
Supported:
* if / then / else (priority)
* oneOf / anyOf (incremental support)
---
### 4. Validation Layer
* Integrate AJV for schema validation
* Normalize validation errors into:
* field-level messages
* form-level summary
Focus:
* accurate error mapping to field paths
* preventing invalid submissions
---
### 5. Form ↔ JSON Sync Layer
* Maintain two modes:
* Schema Form Mode
* Raw JSON Mode
* Ensure:
* no data loss during switching
* consistent serialization/deserialization
---
## Implementation Plan
### Phase 1 — MVP Stabilization (High Priority)
Focus on improving and extending #3274:
* reuse SchemaForm base
* implement:
* primitive + object rendering
* enum support
* required fields
* default values
* fix:
* inconsistent form state behavior
**Deliverables:**
* stable SchemaForm MVP
* unit tests for schema parsing + rendering
* demo with real plugin schemas
---
### Phase 2 — Conditional Logic (Correctness First)
* improve if/then/else handling
* fix branch switching issues:
* stale values
* incorrect payload submission
**Deliverables:**
* deterministic conditional rendering
* tests for branch transitions
* reproducible edge case scenarios
---
### Phase 3 — Validation + UX
* integrate AJV validation
* map errors to UI fields
* improve UX:
* inline errors
* section highlighting
**Deliverables:**
* full validation pipeline
* user-friendly error display
* regression tests
---
### Phase 4 — Hardening + Coverage
* test with multiple real plugin schemas
* optimize rendering for nested schemas
* improve documentation for contributors
**Deliverables:**
* production-ready behavior
* developer guide for schema mapping
* test coverage for critical flows
---
## Alignment with Existing Work
This proposal **builds directly on GSOC PoC #3274** by:
* reusing its SchemaForm foundation
* improving correctness instead of duplicating logic
* extending missing capabilities incrementally
No parallel implementation will be introduced.
---
## Expected Outcomes
* Reduced configuration errors
* Improved onboarding for new users
* Scalable form generation from plugin schemas
* Maintainable and extensible UI architecture
---
## Alternatives Considered
**Raw JSON only**
* Flexible but error-prone
**Manual forms per plugin**
* High quality but not scalable
**Schema-driven + JSON fallback (chosen)**
* balances usability and flexibility
---
## Additional Context
* Builds upon existing PoC: #3274
* Designed for incremental merging (MVP-first approach)
* Focused on correctness, not just feature coverage
---
## Initial Acceptance Criteria
* Schema Form mode available in plugin editor
* Primitive + object fields render correctly
* Required fields enforced
* Conditional rendering works for if/then/else
* Validation errors mapped to correct fields
* Raw JSON fallback remains available and safe
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]