# Array JSON Mask (ArrayJsonMaskGenerator)

The [Array JSON Mask](https://docs.tonic.ai/app/generation/generators/generator-reference/array-json-mask) generator is a composite generator. It is a version of the JSON Mask generator that can be used for array values. It runs a selected generator on values that match a specified JSONPath.

## Link object structure <a href="#generator-api-array-json-mask-link-object" id="generator-api-array-json-mask-link-object"></a>

For the Array JSON Mask generator, you provide a link object for each sub-generator configuration.

The generator does not itself support consistency or differential privacy.

The `metadata` object is populated from the [`JsonMaskMetadata`](https://app.tonic.ai/apidocs/index.html#/models/JsonMaskMetadata) object. For the Array JSON Mask generator, `metadata` includes:

* `pathExpression`, which is the path expression that identifies the value to apply the sub-generator to.
* The types of values to apply the sub-generator to.
* The `subGeneratorMetadata` object, which identifies and configures the sub-generator.

Here is the basic structure of a link object for an Array JSON Mask sub-generator.

{% code overflow="wrap" %}

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",
  "metadata": {
    "generatorId": "ArrayJsonMaskGenerator",
    "presetId": "ArrayJsonMaskGenerator",
    "customValueProcessor": "string", //If custom value processor applied to the generator
    "pathExpression": "string",
    "jsonFilterTypes": [ enum ],
    "subGeneratorMetadata": {
      "generatorId": "string",
      "presetId": "string",
      //Metadata for the selected sub-generator
      "customValueProcessor": "string" //If custom value processor applied to the sub-generator
    }
  }
}
```

{% endcode %}

## Example replacement <a href="#generator-api-array-json-mask-replacement" id="generator-api-array-json-mask-replacement"></a>

The following example replacement applies the built-in generator preset for the Geo generator to the value at the specified path expression.

The configuration for the Geo generator indicates that it is a latitude value.

```json
{
  "name": "location",
  "schema": "public",
  "table": "offices",
  "links": [
    {
      "schema": "public",
      "table": "offices",
      "column": "location",
      "metadata": {
        "generatorId": "ArrayJsonMaskGenerator",
        "presetId": "ArrayJsonMaskGenerator",
        "pathExpression": "$.value",
        "jsonFilterTypes": [
          0
        ],
        "subGeneratorMetadata": {
          "presetId": "GeoGenerator",
          "generatorId": "GeoGenerator",
          "geoType": "Latitude"
        }
      }
    }
  ]
}
```
