User guide

JSON Schema debugger

Use the JSON Schema debugger to step through the validation process and learn how a schema is applied to your JSON. The debugger is available with the JSONBuddy Plus edition of the editor.
Starting the JSON validation debugger
Set the JSON instance for debugging as the active document in the editor window and use the "Debug validation" command from the Toolbar to start the debugger. As a prerequisite, the instance document needs to have a JSON Schema assigned. The JSON editor will then arrange the instance document to the left and the root JSON Schema file to the right. The locations of the first validation steps are marked with yellow arrows in the left margin areas of the editor windows. The current lines are also indicated with an alternative background color. Therefore, the current validation step is always clearly visible.
Debugging commands
The debugger toolbar
You can find all of the usual debugger commands in the toolbar. Often it will be quicker to use the keyboard. Press F8 for a single step and Ctrl+F8 to run until the next breakpoint or validation error. There is also an option to toggle if the debugger should break whenever a validation error occurred.
A breakpoint can be set in the instance document and any referenced JSON Schema file with the right-mouse-click context menu in the text editor window.
Set a breakpoint in the JSON instance document
Debugging stopped at a breakpoint
Getting a deeper understanding of the JSON Schema validation process is not the only reason to use the debugger. It can save a lot of time on getting a schema ready for production. But don’t forget to restart the debugger session if you modify any of the JSON Schema files.
Editing the JSON input data while debugging
Furthermore, it is possible to edit the JSON data while the debugger session is still active. Jump from error to error to resolve and fix any issues in the instance. In order to give additional details about the error, all of the usual context information and indicators are also available while running the debugger. As a consequence, it is often easy to apply the fix.
Fixing the error and continuing with debugging
Please note, that major changes to the structure of the JSON input can result in making it impossible for the debugger to find any subsequent error locations. In this case, it is recommended to restart the validation in the JSON editor.