json containing tabs is rejected
open | Created 2018-04-06 | Last updated 2019-04-22| Posted by EvanTheB | See in Github


User Requested Improvement 🐛Bug


I was running through the tutorial, https://cromwell.readthedocs.io/en/develop/tutorials/ServerMode/. I typed the inputs.json file with a tab instead of spaces.

curl -X POST http://localhost:8000/api/workflows/v1 -F workflowSource=@hello.wdl -F workflowInputs=@inputs.json

{
  "status": "fail",
  "message": "Error(s): Input file is not valid yaml nor json: while scanning for the next token\nfound character '\\t(TAB)' that cannot start any token. (Do not use \\t(TAB) for indentation)\n in 'reader', line 2, column 1:\n    \t\"test.hello.name\": \"World\"\n    ^\n"
}

However per the JSON spec, tabs, or any whitespace, "can be inserted between any pair of tokens" https://www.json.org/.

Python:

json.loads("{\n\t\"valid\":\"json\"\n}")

Sadly I do not know Java very well or I would just check and or fix whichever parser you are using.

Thanks


Return to top