The JSON schema standard does not define a way to reference local or remote schema files for validation from within the JSON instance document. A JSON validator needs to support a way to load and assign schemas to the JSON data. Just setting a single root schema is not sufficient, if the schema itself references other components with $ref and $id. A JSON schema is identified by its $id and not by a local or remote path (Uri).
To address this, a schema pool can hold any number of JSON Schema files. One of those schemas is also set as the root schema in the configuration file.
In JSONBuddy, a schema for the active document can be selected using the Quick Associations pane. You can either set a pool or a local or remote path to the root schema as an alternative. If a schema pool is selected, the edit field to enter a path is disabled. The current schema pool assignment can be cleared with the red X button to the right.
Select a JSON Schema pool
All available JSON schema pools are configured using a settings document. This JSON file can be opened in JSONBuddy with the "Open config..." button. Add and edit the single pool entries directly in the JSON editor to change the configuration. Save the JSON file as usual and use the "Reload" button of the "Quick Associations" pane to apply the modifications to the schema pools used for JSON validation.
Here is an example of a simple schema pools configuration file:
[
{
"id": "1948DF5D-0765-4939-9F88-64CD3BB1D306-0",
"title": "Library Example Schema",
"version": 1,
"rootIndex": 0,
"entries": [
"SchemaPools\\Library\\library_schema_root.json",
"SchemaPools\\Library\\library_schema_book.json"
]
}
]
Property | Type | Description |
---|---|---|
id |
string |
A unique identifier of the pool within this configuration file. |
title |
string |
Title to be displayed. |
rootIndex |
integer |
Zero-based index to set the root schema of this pool. If omitted, the first entry is taken as root schema. |
entries |
array |
An array of strings with local or remote (Url) paths to the schema documents. For local paths, the entry can be a relative path with the configuration file as the base. |
Properties of a JSON schema pool entry.
JSONBuddy is more than just a JSON editor for Windows ®. Learn more on clicking the images and links below.
See in detail how your JSON data is validated using the JSON Schema validation debugger.
Try hereXML, JSON, CSV and HTML conversion tool. Import CSV text and get JSON, XML or HTML.
Read MoreUse the streaming JSON formatter to get pretty JSON.
Verify how a set of data files align with your JSON Schema resources. Easy and automated.
Get a complete JSON Schema designer with extended support for creating and testing JSON schema specifications.
Read MoreImport from any CSV text and get structured JSON or XML data in the editor.
Read MoreJSON editor with built-in JSON pointer engine. Useful on creating JSON Schema documents and for navigation.