﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32410	An empty list is considered as an empty value for JSONField.	Dave White	nobody	"
Environment:   Django 3.1.5,  Python 3.8.7,  MariaDB 10.5.6

Expected behavior:  I should be able to edit an object that contains a JSONField with default=list without having any validation errors if I save without changing the JSONField.

Steps to reproduce:
1.  Define a field in an Object using models.JSONField(default=list).
2.  Create a new Object.
3.  Go to edit view of that Object in Django Admin.  You will see the default [] empty list in the JSONField.  Don’t change any field.
4.  Click Save; without having changed anything, you’ll receive a validation error that “This field is required”
5.  Workaround:  put quotes around the ""[]”  or replace with any valid JSON object.  If you try to put random characters in the field you'll receive a ""Enter a valid JSON."" validation.



Note: This bug seems similar to #31157 https://groups.google.com/g/django-updates/c/BshBo_jmUTA/m/Lu2ZY9mDCQAJ


Cheers,
Dave White


"	Bug	closed	Forms	3.1	Normal	duplicate	JSONField	toksvig@…	Unreviewed	0	0	0	0	0	0
