×
Menu

JSON Schema editor

 
In order to help people writing JSON schemas, XML ValidatorBuddy provides special syntax-coloring and auto-completion for schema keywords together with a built-in validator.
To tell the editor that you are working on a JSON schema, simply use the "Quick Associations" pane and set the "Document is JSON Schema" checkmark. From this moment on the editor knows that this JSON content should be treated as JSON schema:
 
 
You will notice that the way JSON syntax-coloring works changes immediately after telling the editor that this JSON is actually a schema. All of the schema keywords are now green and all of the keywords are also present in the auto-completion. The picture below shows how the sample library schema, which is part of the installation, is displayed afterwards in the editor:
 
 
JSON Schema keywords like "properties" or "description" appear in green, while arbitrary names like "book" are still in red. This improves the readability of the schema in the editor a lot and helps on editing the document. The sample has been modified in a way that the built-in JSON schema validator reports an error. As you can see on the screenshot the "type" field contains a wrong "obect" value. The editor will point you to the error location in the schema and also shows the exact description in the "Results" pane at the bottom. You can jump to the error position at any time on clicking the entry in the Results window.
 
Auto-completion is a very important feature and helps tremendously on creating and editing any text-based standard. As you can see on the screenshot below, the editor provides a list of JSON schema keywords also for the auto-completion window:
 
 
Quickly test any JSON instance while editing the schema
 
To check a JSON document against any JSON Schema, enter the path to the JSON schema at the "JSON Schema" field of the "Quick Associations" pane when the JSON instance is the active document. Now the editor keeps a reference to the schema for this instance document. It is also possible to put a relative path here. If both documents are located in the same folder just enter the name of the schema here. Whenever you use the "Validate against JSON Schema" command the schema content is either loaded from disk or directly taken from the editor and the validation results appear in the "Results" pane. This makes it possible to quickly test the schema while it is still open in XML ValidatorBuddy for editing.
 
Most of the reported errors also contain the location as JSON pointer. Simply click on the error in the Results window to use the jump-to-error functionality and to go to the position where the error was detected.
 
Validator for JSON Schema files
 
To validate JSON Schema documents the editor provides a built-in schema for schemas. If the current document is marked as JSON schema the "Validate against JSON Schema" command will use the built-in schema to detect errors in the active schema. This makes it easy to create error free JSON schema files in less time.
 
Any errors in the JSON schema are displayed in the standard Results window.