# JSON Validator

Updated: 10/14/2021, 2:20:00 PM
Created: 10/14/2021, 2:20:00 PM
Last Updated By: mikes
Read Time: 1 minute(s)

A JSON validator/verifier has been written.

The syntax is simple:

jsonlint filename
1

In the example below, we successfully run the program against a file containing JSON:

$ jsonlint config/test1.json
File config/test1.json parsed okay in 0 seconds using 3,392 bytes of memory
File config/test1.json parsed okay in 0 seconds using 60,288 bytes of memory including comments
    7 objects found with 14 key/value pairs
    1 arrays found with 5 values
    339 comment blocks found
1
2
3
4
5
6

In the following example, an error has been introduced to the JSON string. This will show the line containing the error, and the two lines before and after the error:

$ jsonlint config/test1.json
000084             # and for Q-pointer resolution.
000085             {
000086 +++             "name": "JEDIFILENAME_SYSTEM", THIS IS AN ERROR
           -------------------------------------------^^^ Parsing error at line 86 , offset 44
000087                 "default": "$JBCDATADIR/SYSTEM]D"},
000088             #
1
2
3
4
5
6
7

Back to Dynamic Objects - Overview