feat(orchestrator): support nested objects in rjsf-widgets config - #4461
Conversation
- Update config schema to accept nested objects in orchestrator.rjsf-widgets
- Add tests for nested path resolution (flat, nested, mixed scenarios)
- Update documentation with nested configuration examples
- Maintain backward compatibility with existing flat string keys
Templates can now reference nested values using dot-path notation:
$${{rjsfConfig.widget-id.xParams.name}}
Resolves customer request for hierarchical widget parameter organization.
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
Add jest.Mock type casts to fix TypeScript compilation errors: - mockImplementation expects parameters - mockReturnValue can accept undefined
Only orchestrator-common has published code changes (config.d.ts). orchestrator-form-widgets only has test changes which don't require a changeset.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4461 +/- ##
=======================================
Coverage 61.62% 61.62%
=======================================
Files 2541 2541
Lines 101912 101912
Branches 28555 28555
=======================================
Hits 62800 62800
Misses 37308 37308
Partials 1804 1804
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
@lholmquist The schema in the video demonstrates a more detailed example with grouped sections (4 objects with nested properties), while the PR description includes a simplified version (3 flat properties) to keep the testing instructions concise. Both schemas work correctly and demonstrate the same nested config capability. If you'd like to see the exact schema from the video, you can use: The key feature this PR enables is that orchestrator.rjsf-widgets now officially supports nested objects with proper TypeScript typing, testing, and documentation. Both schemas demonstrate this works correctly. |






Story - https://redhat.atlassian.net/browse/RHIDP-16437
Summary
Adds support for nested objects in
orchestrator.rjsf-widgetsconfiguration, enabling Platform Engineers to organize widget parameters hierarchically.Changes
config.d.tsto accept[key: string]: anyinstead of[key: string]: stringorchestratorFormWidgets.mdwith nested configuration examplesVideo
Screen.Recording.2026-08-25.at.11.09.31.AM.mov
Example Configuration
How to Test
1. Add Configuration
Add to your
app-config.local.yaml:2. Create Test Workflow
Workflow:
test-nested-config.sw.yamlSchema:
schemas/test-nested-config__main-schema.json{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Test Nested Config", "type": "object", "properties": { "flatConfig": { "type": "string", "title": "Flat Config Value", "ui:widget": "ActiveText", "ui:props": { "ui:text": "**Environment:** $${{rjsfConfig.defaultEnvironment}}" } }, "nestedConfig": { "type": "string", "title": "Nested Config Values", "ui:widget": "ActiveText", "ui:props": { "ui:text": "## App Registration\n\n- **Name:** $${{rjsfConfig.app-registration.xParams.name}}\n- **Version:** $${{rjsfConfig.app-registration.xParams.version}}\n- **Env:** $${{rjsfConfig.app-registration.environment}}" } }, "mixedExample": { "type": "string", "title": "Mixed Config Summary", "ui:widget": "ActiveText", "ui:props": { "ui:text": "# Summary\n\nGlobal: **$${{rjsfConfig.defaultEnvironment}}**\n\nWidgets:\n- $${{rjsfConfig.app-registration.xParams.name}} v$${{rjsfConfig.app-registration.xParams.version}}\n- $${{rjsfConfig.cloud-run.xParams.name}} v$${{rjsfConfig.cloud-run.xParams.version}}" } } } }3. Run Tests
yarn workspace @red-hat-developer-hub/backstage-plugin-orchestrator-form-widgets test useTemplateUnitEvaluatorAll 10 tests should pass, including new tests for:
4. Test in UI
yarn devdefaultEnvironment→ "production"app-registration.xParams.name→ "app-registration"Customer Request
Resolves customer feature request for hierarchical widget parameter organization (xParams configuration).