<p dir="auto"><strong>Description</strong></p>
<p dir="auto">Looking at our variables, every single one of them is JSON, the largest being 100 lines long. I will assume that most other users are mainly using JSON vars as well.</p>
<p dir="auto">I can think of a few quality of life changes that could be made to make working with these variables easier:</p>
<ul dir="auto">
<li>Make the 'Val' field on /admin/variable/edit use a fixed width font. This would probably not hurt non-JSON users either.</li>
<li>Add JSON syntax highlighting to the textarea there.</li>
<li>Add optional JSON syntax validation; perhaps a boolean flag in the DB for whether the var is supposed to be JSON. If true, reject updates with non-valid JSON syntax to the variable, and perhaps don't require deserialize_json=True to be specified in the code every time it's accessed.</li>
<li>This last one might be a bit far-fetched, but: Make it possible to add a JSON schema file that will be validated against on updates.</li>
</ul>
<p dir="auto">Let me know if you want these split into separate JIRA issues.</p>
<p dir="auto"><strong>Use case / motivation</strong></p>
<p dir="auto"><strong>Related Issues</strong></p>
<p dir="auto">Moved here from <a href="https://issues.apache.org/jira/browse/AIRFLOW-310" rel="nofollow">https://issues.apache.org/jira/browse/AIRFLOW-310</a></p>
<p dir="auto"><strong>Description</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="                Looking at our variables, every single one of them is JSON, the largest being 100 lines long. I will assume that most other users are mainly using JSON vars as well."><pre class="notranslate"><code class="notranslate">                Looking at our variables, every single one of them is JSON, the largest being 100 lines long. I will assume that most other users are mainly using JSON vars as well.
</code></pre></div>
<p dir="auto">I can think of a few quality of life changes that could be made to make working with these variables easier:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Make the 'Val' field on /admin/variable/edit use a fixed width font. This would probably not hurt non-JSON users either.
Add JSON syntax highlighting to the textarea there.
Add optional JSON syntax validation; perhaps a boolean flag in the DB for whether the var is supposed to be JSON. If true, reject updates with non-valid JSON syntax to the variable, and perhaps don't require deserialize_json=True to be specified in the code every time it's accessed.
This last one might be a bit far-fetched, but: Make it possible to add a JSON schema file that will be validated against on updates."><pre class="notranslate"><code class="notranslate">Make the 'Val' field on /admin/variable/edit use a fixed width font. This would probably not hurt non-JSON users either.
Add JSON syntax highlighting to the textarea there.
Add optional JSON syntax validation; perhaps a boolean flag in the DB for whether the var is supposed to be JSON. If true, reject updates with non-valid JSON syntax to the variable, and perhaps don't require deserialize_json=True to be specified in the code every time it's accessed.
This last one might be a bit far-fetched, but: Make it possible to add a JSON schema file that will be validated against on updates.
</code></pre></div>
<p dir="auto">Let me know if you want these split into separate JIRA issues.</p>
<p dir="auto"><strong>Use case / motivation</strong></p>
<p dir="auto"><strong>Related Issues</strong></p>
<p dir="auto">Moved here from <a href="https://issues.apache.org/jira/browse/AIRFLOW-310" rel="nofollow">https://issues.apache.org/jira/browse/AIRFLOW-310</a></p>