question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Invalid json list. A tag list submitted in string form must be valid json.

See original GitHub issue

When I try to create object from test client I get this error {'tag': ['Invalid json list. A tag list submitted in string form must be valid json.']}. Here is the code:

self.client.post('/api/notes/', data={'tag': ["xyz"], 'iv': 'random', 'content': "New content",
                                                         'date': self.current_date_time})

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:20 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
ppnchbcommented, Jun 9, 2017

I found the forum article says request.data is sometimes QueryDict, sometimes normal dict. Maybe converting request.data from QueryDict to dict in views.py can temporally solve the problem…

2reactions
SauravKanchancommented, Jan 2, 2021

I have the same problem Is there a proposed soltion ? Thanks

[ “tag1”, “tag2” ]

This worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

django rest framework , Invalid json list - Stack Overflow
A tag list submitted in string form must be valid json." ] } I am using django-taggit and django-taggit-serializer packages.
Read more >
The given data was not valid JSON. | Apple Developer Forums
The error message is accurate. In your example data, the token NULL is not valid JSON. It's case-sensitive so it needs to be...
Read more >
How to Fix the Invalid JSON Error in WordPress? - Rank Math
In this article, learn how to fix the invalid JSON error - 'Updating failed. The response is not a valid JSON response.' with...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >
[Solved]-json.loads converts valid JSON to invalid JSON-django
JSON library in python converts JSON string into a python understandable, list and dictionary. That is the reason the 'true' and 'false' strings...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found