Hello everyone,
Can schema variables be 'filled out' from a json string/object? if so, how do you do it.
I tried with the following "user.promoModInfoObject = zui.fromJsonSchema(JSON.parse(largeJson))" method, but I get an error saying that "zui is not defined".
I wrote this schema and I created a user variable from this schema.
user.promoModInfoObject = zui.fromJsonSchema(JSON.parse(largeJson))
zui.object({
id: zui.string(),
title: zui.string(),
description: zui.string(),
price: zui.number(),
imageUrl: zui.string().url(),
categoryId: zui.string(),
modGroups: zui.array( //modGroups array
zui.object({
id: zui.string(),
title: zui.string(),
splitsAllowed: zui.number(),
modMinReq: zui.number().min(NaN),
modMaxReq: zui.number().max(10),
modFreeQty: zui.number().max(10),
modifiers: zui.array( //modifiers array
zui.object({
id: zui.string(),
title: zui.string(),
extraPrice: zui.number(),
isDefault: zui.boolean(),
isIncluded: zui.boolean(),
showForSplits: zui.boolean(),
imageUrl: zui.string().url()
})) //modifiers array
})) //modGroups array
})