Starting with JSONBuddy 4.6, you can add custom formats for the JSON validator as regular expressions using a simple configuration file. The JSON editor has two commands to give you easy access to this functionality:
Commands for JSON custom formats.
Use the Open JSON validator custom formats command to open the JSON configuration file for custom formats directly in JSONBuddy. This is a standard JSON document and the default one will be loaded in the editor. You can then add your own entries to the JSON array for your validation tasks. You can also replace some existing formats already provided by the JSON validator of JSONBuddy. A user-defined format overrides the built-in definition.
The standard configuration has the following entry:
[
{
"format": "my-custom-format",
"regex": "^[a-z, A-Z, /]+$"
}
]
As you can see, all you need to do is provide two simple strings: the identifier of the new format and a valid regular expression. After you finish adding entries, save the configuration file and activate the new formats with the Reload JSON validator custom formats command. All open JSON documents are immediately validated using the new format definitions.
You can also see the names of your own formats while editing JSON data in the editor:
library example with custom format definition.
The library example, which is part of the standard installation, also uses a custom format. Check it out and try different regular expressions.
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.