JSON schema reference

You can modify the reference JSON node URL. You can expand this in the JSON tree as a read-only node after the reference node has successfully loaded from the server side.

Changes to reference are validated on the user interface and server sides.

reference can be expanded in the JSON tree as a read-only node. When you right-click a reference node, a dialog box opens with Copy, Delete, and Move down options.

After you edit the ref value, the JSON Schema Configurator verifies the ref value with these methods:

Client-side validation

On the client side, the ref value must contain at least one “#” followed by a definition name.

An Invalid ref! error message opens to alert you when the ref value does not apply the rule. The cursor then moves to the ref value's text field.

Server-side validation

Server-side validation goes through these steps:

  1. Search the reference file from the local site, master site, and root level. The local file URI is supported in the JSON Schema Configurator.
    • If the configuration begins with “/”, then search the file starting from $HCIROOT\formats\json.
    • If the ref value does not begin with "/", then search the file starting from $HCIROOT\formats\json\Package name.

      If the file cannot be found, then a Cannot find xxxx reference file! warning message opens.

  2. Validate the ref node, that it is in the reference file.

    If the node is not found in the reference file, then a Cannot find xxx definition in yyyy file! warning message opens..

When the user opens a JSON schema file, the same validation applies to the ref value.

Saving the configuration

The JSON Schema configurator only saves the ref node configuration.

This structure displays on the JSON tree:

{
   "$schema": "http://json-schema.org/draft-04/schema#",
   "ordering”: false,
   "validationcheck”: true,
   "properties”: {
     "REF”: {
       "$schema”: "http://json-schema.org/draft-04/schema#",
       "ordering”: false,
       "validationcheck”: true,
       "$ref”: "p1/p2/Ref_nest1.json#/definitions/nest1_0"
     }
   }
}