How to validate JSON

1. Open the JSON document and assign a schema

Before the JSON validator can be used to check JSON data, a JSON schema must be assigned to the instance. Set the schema at the "JSON schema" field on the "Quick Associations" window of XML ValidatorBuddy. The assignment is saved and restored for the active document.

  • Use the "File | Open..." command or double-click the JSON document in the built-in File Explorer.
  • Assign the schema to the JSON instance at the "Quick Associations" pane.
Assign JSON schema

2. Optionally modify the JSON data

Use the JSON editor environment if you want to do any modifications to the content before you use the validator to check if the JSON data is valid. Intelligent entry-helpers provide information from the assigned schema.

  • JSON specific syntax-coloring for increased readability.
  • Context sensitive entry helpers provide schema information.
  • Folding and brace highlighting makes it easy to navigate through the JSON structure.
JSON editor

3. Use the JSON validator to find any errors

To start the validation press the F11 key or use the "Validate JSON" command either from the JSON menu or click the toolbar button. This command is only enabled if a JSON schema is assigned to the active document.

  • The JSON validator reports all validation or well-formed errors at once.
  • Errors and warnings are reported in the Results pane.
  • You can copy the complete error report to the clipboard using the "Copy results" command from the context-menu of the Results pane.
JSON instance validation

4. Fix any validation errors with the built-in JSON editor

After the validation use the editor window to modify the JSON content. If any errors are reported a click on the results entry selects the related position in the editor window and a detailed error description helps to fix the problem in the JSON. Press F11 or use the "Validate JSON" command again to see if all of the reported problems are corrected.

  • Jump-to-error functionality to quickly fix any parsing or validation errors.
  • The error description also includes the violated schema rule for this entry.
  • You can also use the JSON pointer evaluation window to check location paths.