In a module, I have the following Mappable Parameters:
{
"name": "name",
"type": "text",
"label": "Name",
"help": "Contact name"
},
{
"name": "company",
"type": "collection",
"label": "Company",
"spec": [
{
"name": "name",
"type": "text",
"label": "Company name"
},
{
"name": "address",
"spec": [
{
"name": "street",
"type": "text",
"label": "Street"
},
{
"name": "number",
"type": "number",
"label": "Number"
},
{
"name": "city",
"type": "text",
"label": "City"
},
{
"name": "country",
"type": "text",
"label": "Country"
}
],
"type": "collection",
"label": "Company Address",
"advanced": true
}
]
}
However, when the user does not provide any company data, the JSON looks like this:
[
{
"name": "Example Name",
"company": {
"address": {}
}
}
]
And in my API, since company
has a value (which in this case is address
), it does not work. How can I fix this?