JSON Mask (JsonMaskGenerator)
For the JSON Mask generator, you provide a link object for each sub-generator configuration. The link object identifies the path expression and the sub-generator to run on the matching values for the expression.
The JSON Mask generator does not itself support consistency or differential privacy.
- The sub-generator type.
- The types of values to apply the sub-generator to.
- The
subGeneratorMetadata
object, which contains the generator configuration for the sub-generator.
Here is the basic structure of a link object for a JSON Mask sub-generator.
{
"generatorId": "JsonMaskGenerator",
"schema": "string",
"table": "string",
"column": "string",
"pathExpression": "string",
"subPresetId": "string",
"subGeneratorId": "string",
"metadata": {
"subPresetId": "string",
"subGeneratorId": "string",
"jsonFilterTypes": [ enum ],
"subGeneratorMetadata": {
//Metadata for the selected generator
}
}
"customValueProcessor": "string", //If custom value processor applied
"customSubGeneratorValueProcessor": "string" //If custom value processor applied to the sub-generator.
}
In the following example replacement for the JSON Mask generator:
- The Date Truncation generator is applied to all values of the JSONPath expression
$[*].start
. The value is truncated to the year, and the birthdate flag is off. - The Email generator is applied to all values of the JSONPath expression
$[0].email
. The generated email addresses all use gmail.com as the domain, and no domains are excluded. Invalid email addresses are replaced. Consistency is disabled. - If there is an error applying those generators, then the fallback generator is the Null generator.
{
"name": "json_data",
"schema": "public"
"table": "big_json",
"links": [
{
"generatorId": "JsonMaskGenerator",
"presetId": "JsonMaskGenerator",
"schema": "public",
"table": "big_json",
"column": "json_data",
"subPresetId": "DateTruncationGenerator",
"subGeneratorId": "DateTruncationGenerator",
"pathExpression": "$[*].start",
"metadata": {
"subPresetId": "DateTruncationGenerator",
"subGeneratorId": "DateTruncationGenerator",
"jsonFilterTypes": [
0
],
"subGeneratorMetadata": {
"datePart": "Year",
"isBirthDate": false
}
}
},
{
"generatorId": "JsonMaskGenerator",
"presetId": "JsonMaskGenerator",
"schema": "public",
"table": "big_json",
"column": "json_data",
"pathExpression": "$[0].email",
"subPresetId": "EmailGenerator",
"subGeneratorId": "EmailGenerator",
"metadata": {
"subPresetId": "EmailGenerator",
"subGeneratorId": "EmailGenerator",
"jsonFilterTypes": [
0
],
"subGeneratorMetadata": {
"domain": "gmail.com",
"excludedDomain": "",
"replaceInvalidEmails": true,
"isConsistent": false
}
}
}
],
"fallbackLinks": [
{
"generatorId": "NullGenerator",
"schema": "public",
"table": "big_json",
"column": "json_data",
"metadata": {}
}
]
}
Last modified 1mo ago