From d1b5716252617c2ddaa8a5f780c2d6b2f812a777 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 6 Dec 2021 19:56:05 +0000 Subject: [PATCH] Fix data bindings from JSON fields not correctly squashing nested structures beyond the first level --- packages/builder/src/builderStore/jsonUtils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/builderStore/jsonUtils.js b/packages/builder/src/builderStore/jsonUtils.js index 6f6db763a6..74e6863126 100644 --- a/packages/builder/src/builderStore/jsonUtils.js +++ b/packages/builder/src/builderStore/jsonUtils.js @@ -28,7 +28,10 @@ const extractJSONSchemaKeys = (jsonSchema, squashObjects = false) => { Object.keys(jsonSchema).forEach(key => { const type = jsonSchema[key].type if (type === "json" && squashObjects) { - const childKeys = extractJSONSchemaKeys(jsonSchema[key].schema) + const childKeys = extractJSONSchemaKeys( + jsonSchema[key].schema, + squashObjects + ) keys = keys.concat( childKeys.map(childKey => ({ key: `${key}.${childKey.key}`,