JSON Validation

Well-Formedness Check

Oxygen includes a built-in JSON validator (based on the free Java source code available at www.json.org), integrated with the general validation support.

Built-in JSON Validator

Oxygen provides basic validation via a built-in JSON validator that checks whether or not JSON documents are well formed.

JSON Document Validation

Validate JSON Against JSON Schema

Oxygen also provides validation against an associated JSON Schema used to better describe the data format. It is also useful for automated testing and for ensuring the quality of user submitted data. A JSON Schema can be associated to a JSON instance either through a validation scenario or directly within a JSON document.

Association Using a Validation Scenario

A JSON Schema can be associated to any JSON instance using the Validation Scenario configuration dialog box. Once you associate a JSON Schema to a JSON instance, you also benefit from content completion assistance while editing the instance according to the definitions in the associated schema.

Association Directly in a JSON Document

A JSON Schema can also be associated directly in a JSON document using the Associate Schema toolbar action. It adds a $schema property at the beginning of the document with its value set to the specified URL or relative file path.

Validate JSON Against Schematron

As an additional validation layer, Oxygen supports JSON validation against Schematron. This allows you to make further assertions about patterns found in JSON documents. For instance, it allows you to state mandatory structures, structures that should not be used, or to express integrity requirements such as sum checks, date comparisons, element dependencies, or conditional value requirements. Schematron validation rules also provide the ability to specify custom, precise, and helpful messages if errors are encountered.

Validate JSON Against Schematron

Schematron Association

Oxygen includes a built-in JSON Schematron Validator engine to validate JSON documents against a Schematron schema specified in a custom validation scenario. You just need to configure a validation scenario, choose the JSON Schematron Validator engine, and specify the Schematron schema. You can also specify a Schematron schema using the Validate with action.

JSON Schematron Validation

Showing Validation Errors

Validation errors and warnings in JSON documents are marked in the main editing pane, in the vertical stripe on the right side of the editor, and in the Outline view. Colors help indicate the severity of the issue and details are presented in a popup window when hovering over an issue and in the stripe at the bottom of the editor.

JSON Validation Errors