Skip to content

Improve invalid JSON warning visibility in Variable edit form#68392

Open
bramhanandlingala wants to merge 4 commits into
apache:mainfrom
bramhanandlingala:fix-variable-invalid-json-warning
Open

Improve invalid JSON warning visibility in Variable edit form#68392
bramhanandlingala wants to merge 4 commits into
apache:mainfrom
bramhanandlingala:fix-variable-invalid-json-warning

Conversation

@bramhanandlingala

Copy link
Copy Markdown

Improves the invalid JSON warning shown in the Variable edit form.

When a variable value appears to be JSON but contains invalid syntax, the UI now displays a more prominent warning message along with the JSON parsing error details to help users identify and fix the issue more quickly.

Previously, the UI only displayed a small "Invalid JSON" message, which was easy to overlook. This could lead to operators saving malformed JSON values and discovering the problem later through downstream DAG failures.

This change improves visibility of the warning while still allowing non-JSON/plain-text variables to be saved, since Airflow Variables are not required to contain JSON.

Changes
Added a more prominent invalid JSON warning in the Variable edit form.
Added an alert icon to draw attention to the warning.
Displayed JSON parser error details to help users locate and fix syntax issues.
Preserved support for plain-text variables.
Did not block saving variables based solely on client-side JSON validation.
Testing

Tested with:

Valid JSON value → no warning displayed.
Invalid JSON value → warning and parser error displayed.
Plain text value → no warning displayed and save works normally.

@bramhanandlingala

Copy link
Copy Markdown
Author

@ashb

I understand that client-side validation alone is not sufficient and that Variables can contain plain-text values. I've updated the implementation accordingly. If any further changes are needed, please let me know. I would appreciate keeping the PR open so I can address the feedback directly rather than opening a new PR.

Thanks

@ashb

ashb commented Jun 11, 2026

Copy link
Copy Markdown
Member

👍🏻 You should have been able to re-open the previous PR too.

@ashb

ashb commented Jun 11, 2026

Copy link
Copy Markdown
Member

@bramhanandlingala Could you include screenshots of the three cases you mention above please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants