Checklist
Steps to reproduce
from rest_framework import serializers
class TestSerializer(serializers.Serializer):
json = serializers.JSONField()
s = TestSerializer(data={'json': "{broken JSON"})
assert s.is_valid() is False
Expected behavior
Invalid JSON should result in is_valid() returning False.
Actual behavior
is_valid() returns True
Specifying binary=True for the field definition results in the desired behavior for serialization, but causes deserialization to fail on Python 3.
Checklist
masterbranch of Django REST framework.Steps to reproduce
Expected behavior
Invalid JSON should result in
is_valid()returningFalse.Actual behavior
is_valid()returnsTrueSpecifying
binary=Truefor the field definition results in the desired behavior for serialization, but causes deserialization to fail on Python 3.