serializers.JSONField(required=True) might have validation issue for invalid JSON data #8671
Unanswered
Karunamay-murmu
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this model serializer for create a new post.
As the body is JSONField it should validate if the body field holds a valid JSON right?
Here is the view:
The
serializer.is_valid()
is returnTrue
, while theserializer.initial_data['body']
data is a invalid JSON.If that is a expected behavior than how can I validate for a valid JSON in body?
Beta Was this translation helpful? Give feedback.
All reactions