Improve invalid JSON warning visibility in Variable edit form#68392
Open
bramhanandlingala wants to merge 4 commits into
Open
Improve invalid JSON warning visibility in Variable edit form#68392bramhanandlingala wants to merge 4 commits into
bramhanandlingala wants to merge 4 commits into
Conversation
Author
|
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 |
Member
|
👍🏻 You should have been able to re-open the previous PR too. |
Member
|
@bramhanandlingala Could you include screenshots of the three cases you mention above please? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.