Configure Zeus to Use jq to Validate a Json File

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Configure Zeus to Use jq to Validate a Json File

Post by jussij »

Installation
1. Download the Windows version of the jq executable found here: https://stedolan.github.io/jq/download/

2. Copy that executable to this Zeus folder location (change the folder to match the user id):

Code: Select all

C:\Users\<your user id>\AppData\Local\Programs\Zeus (x64)\zGNU\
Using jq to Check a File Using a Tool
Use the Options, Document Types menu and edit the JScript Document Type.

In the Tools Section add the following tool:

Code: Select all

       Menu Text: jq Validate: '$fn'
    Program Name: jq-win64.exe
       Arguments: empty "$f"
  Work Directory: $fdd

    (o) Executable
    (o) Run hidden
    (o) Display on output

    [x] Capture stdout
    [x] Capture stderr
    [ ] Allow user input
    [x] Save current document before running
    [x] Add to popup menu
Using the New Tool
1. Open the following c:\temp\test.json test file:

Code: Select all

{
  "folders": [
    {
      "name": "Project: Some Application",
      "path": "Application"
    },
    {
      "name": "Project: Other Lib",
      "path": "Library"
    },
  ]
}
2. With that file open in Zeus and as the active use the Tools menu to run the jq Validate tool.

3. This will result in the following output:

Code: Select all

parse error: Expected another array element at line 11, column 3
3. Using the mouse double click on that error to be taken to the location in the file were the error will be found. Remove the errant ',' found on that line and re run the tool to find no other errors are reported.
Post Reply