          # When HTML form input is used and the input is not valid
          # value will be a JSONString, rather than a JSON primitive.
          if not getattr(value, 'is_json_string', False):
              try:
                  value = json.dumps(self.value, sort_keys=True, indent=4)
              except (TypeError, ValueError):
                  pass
          return self.__class__(self._field, value, self.errors, self._prefix)
  
  
 
</s> remove         serializer = ExampleSerializer(data={'nested': {'bool_field': False, 'null_field': None}})
 </s> add         serializer = ExampleSerializer(
            data={'nested': {
                'bool_field': False, 'null_field': None,
                'json_field': {'bool_item': True, 'number': 1, 'text_item': 'text'},
                'custom_json_field': {'bool_item': True, 'number': 1, 'text_item': 'text'},
            }})
                value = json.dumps(
                    self.value,
                    sort_keys=True,
                    indent=4,
                    separators=(',', ': '),
                )
          # When HTML form input is used and the input is not valid
          # value will be a JSONString, rather than a JSON primitive.
          if not getattr(value, 'is_json_string', False):
              try:
                value = json.dumps(
                    self.value,
                    sort_keys=True,
                    indent=4,
                    separators=(',', ': '),
                )
              except (TypeError, ValueError):
                  pass
          return self.__class__(self._field, value, self.errors, self._prefix)
  
  
keep keep keep keep replace keep keep keep keep keep
 Render JSON fields with proper indentation in browsable API forms. (#6243)

* Fix JSONBoundField usage on nested serializers (#6211)

* Unify JSONBoundField as_form_field output between py2 and py3

When using json.dumps with indenting, in python2 the default formatting
prints whitespace after commas (,) and python3 does not. This can be
unified with the separators keyword argument. 
rest_framework/utils/serializer_helpers.py