UI: Show an empty object for object params with no value - #71710
Conversation
A param declared as an object but left without a value pre-filled the trigger form's JSON editor with an empty array, so anyone editing it started from the wrong JSON literal for the field's declared type.
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
|
Thanks for the contribution! |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Backport successfully created: v3-3-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…71710) (#71876) A param declared as an object but left without a value pre-filled the trigger form's JSON editor with an empty array, so anyone editing it started from the wrong JSON literal for the field's declared type. (cherry picked from commit 0cfc4ef) Co-authored-by: Kole Harvey <145766958+arose26@users.noreply.github.com>


FieldObjectrenders the JSON editor for params whose declared type isobject—FieldSelectorroutes arrays toFieldStringArray,FieldAdvancedArrayandFieldMultiSelect, so an array never reaches it. It nonetheless falls back to an empty array when the param has no value:So a param declared as an object but left unset opens the trigger form's editor showing
[], and anyone editing it starts from the wrong JSON literal for the field's declared type.The submitted
confis built fromparam.valuerather than the editor text, so an untouched field still submitsnull— this is about what the user is shown and edits from, not about the value sent when the field is left alone.related: #55213
Tests
Adds
FieldObject.test.tsxcovering both branches of the fallback — a param with no value, and one with an existing value. The first fails before this change (Expected {} / Received []) and passes after.pnpm lint(eslint + tsc) is clean and the fulluisuite passes — 935 tests across 121 files.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines