1
0
Fork 0
mirror of synced 2024-06-29 11:31:06 +12:00

Fix data bindings from JSON fields not correctly squashing nested structures beyond the first level

This commit is contained in:
Andrew Kingston 2021-12-06 19:56:05 +00:00
parent 999d8f3d55
commit 122f8dba3a

View file

@ -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}`,