Fixing traceback caused by incorrect argument passing to json.dumps

Fixes #5756
Merge pull request #5783 from jimi-c/issue_5756

Fixing traceback caused by incorrect argument passing to json.dumps