Skip to main content
Skip table of contents

JSON structure

In the context of data masking, a JSON file can be uploaded and used to specify which data fields (e.g. PII) should be masked to protect sensitive information. Accurately constructing a JSON file for data masking involves understanding the structure of JSON, knowing what fields need masking, and correctly using JSON Path syntax to specify those fields.

Understanding JSON structure

JSON data is presented in name/value pairs, with fields and values enclosed within curly braces {} for objects or square brackets [] for lists. Each data element within an object is separated by a comma. The correct format must be used; otherwise, it can result in errors during the masking process.

Example 1: List format with null values

JSON
[
  {
    "First_Name": "John",
    "Last_Name": "Doe",
    "DOB": "1968-11-24",
    "SSN": "123-45-6789",
    "Address": "123 4th Ave",
    "City": "Allentown",
    "State": null,
    "Zipcode": null
  }
]

Example 2: Object format with null values

JSON
{
    "First_Name": "John",
    "Last_Name": "Doe",
    "DOB": "1968-11-24",
    "SSN": "123-45-6789",
    "Address": "123 4th Ave",
    "City": "Allentown",
    "State": null,
    "Zipcode": null
}

Basic concepts

  • Groups/fields: Only specify fields that require masking. Fields not mentioned will not be masked. The presence of the field is vital; its value can be null since it is not relevant to the masking process—this means the value is merely a placeholder.

  • JSON editing: JSON files are edited to specify which data needs masking. This involves defining the structure of your data accurately, including arrays, objects, and null values.

Understanding JSON path

A JSON Path allows you to specify and locate specific parts of a JSON document. The syntax includes a variety of operators and expressions, but at its most basic, it starts with $ to represent the root object or element.

  • The $ symbol denotes the root element of the JSON document.

  • [*] is used when targeting elements within a list.

  • ['FieldName'] targets a specific field by name.

File format XPath examples

For Example 1 (List format):

  • $[*] targets all elements in the list.

  • $[*]['First_Name'] targets the "First_Name" field of each object in the list.

For Example 2 (Object format):

  • $['First_Name'] directly targets the "First_Name" field in the root object.

Grouping and field representation

Use the list access syntax ([*]) for list structures, making sure the path points to each element in the list. For singular objects, directly reference the field names. Incorrect definitions or paths that do not match the data structure exactly will result in errors during the masking process.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.