You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be a nice bonus feature to be able to fix JSON Lines syntax, if a parameter is provided to switch to a jsonl mode. The added benefit would be being able to take lines of objects from a .json file, copy and paste them into a .jsonl file, remove the outer [ ] surrounding the objects after squishing the data into a single line each, and then having fixjson remove trailing commas where it should. I'm experiencing this need right now as I'm taking data out of a GET REST API response and quickly copy and paste a few lines to POST to another place.
If implemented, I'd add an ALE fixer for running this with the right arguments, plus some default detection of the .jsonl filetype.
High Level Suggested Implementation
In a --jsonl mode, read data from a file a single line at a time, and apply existing fixes to JSON to each line as if it were itself a file, but wrap the fixed output into one compact line. I don't believe we need to do anything to make the output pretty for JSON Lines.
The text was updated successfully, but these errors were encountered:
It would be a nice bonus feature to be able to fix JSON Lines syntax, if a parameter is provided to switch to a jsonl mode. The added benefit would be being able to take lines of objects from a
.json
file, copy and paste them into a.jsonl
file, remove the outer[ ]
surrounding the objects after squishing the data into a single line each, and then havingfixjson
remove trailing commas where it should. I'm experiencing this need right now as I'm taking data out of a GET REST API response and quickly copy and paste a few lines to POST to another place.If implemented, I'd add an ALE fixer for running this with the right arguments, plus some default detection of the
.jsonl
filetype.High Level Suggested Implementation
In a
--jsonl
mode, read data from a file a single line at a time, and apply existing fixes to JSON to each line as if it were itself a file, but wrap the fixed output into one compact line. I don't believe we need to do anything to make the output pretty for JSON Lines.The text was updated successfully, but these errors were encountered: