I need to write a test in Python to validate that the payload I am returning is a valid JSON.
import json
s = '{"position": NaN, "score": 0.3}'
json.loads(s)
the code above doesn't throw an exception, while the string is obviously not a valid JSON according to my backend friend and jsonlint.com/.
What should I do?