How to write schemas with dynamic component extensions?

template
Nzuodj.aia (197.5 KB)

{
“name”: “Nzuodj”,
“metadata-version”: 1,
“author”: “Developer DXH”,
“platforms”: [
“Kodular”
],
“keys”: [
“count”,
“title”,
“subtitle”,
“image”,
“url”
],
“components”: [
{
“id”: “cardnhacyeuthich_{count}”,
“type”: “MakeroidCardView”,
“properties”: {
“AlignVertical”: 1,
“AlignHorizontal”: 1,
“BackgroundColor”: -14869219,
“Elevation”: 0,
“ContentPaddingBottom”: 0,
“ContentPaddingLeft”: 0,
“ContentPaddingRight”: 0,
“ContentPaddingTop”: 0,
“FullClickable”: true,
“StrokeWidth”: 0,
“Width”: 200,
“Height”: -2,
“CornerRadius”: 0
},
“components”: [
{
“id”: “Image_{count}”,
“type”: “Image”,
“properties”: {
“HeightPercent”: 200,
“WidthPercent”: 200,
“ScalePictureToFit”: true,
“Picture”: “{image}”
}
]
},
“components”: [
{
“id”: “Item-Cards_{number}”,
“type”: “MakeroidCardView”,
“properties”: {
“WidthPercent”: 90,
“HeightPercent”: 15,
“ContentPaddingTop”: 10,
“ContentPaddingBottom”: 10,
“ContentPaddingRight”: 10,
“ContentPaddingLeft”: 10,
“BackgroundColor”: -526345,
“AlignVertical”: 2,
“AlignHorizontal”: 3,
“FullClickable”: true,
“Elevation”: 0,
“CornerRadius”: 10
},
]
“components”: [
{
“id”: “Item-TitleLabel_{number}”,
“type”: “Label”,
“properties”: {
“FontSize”: 16,
“FontTypefaceImport”: “Comfortaa-Bold.ttf”,
“Text”: “{item-title}”
}
},
{
“id”: “Item-QuantityLabel_{number}”,
“type”: “Label”,
“properties”: {
“FontSize”: 14,
“FontTypefaceImport”: “Comfortaa-Medium.ttf”,
“Text”: “{item-subtitle}”
}
}
]
},
}
]
}

I tried searching on the writing community and got the error.

Will you show the error message?

Unterminated object at character 984 of { “name”: “Nzuodj”, “metadata-version”: 1, “author”: “Developer DXH”, “platforms”: [ “Kodular” ], “keys”: [ “count”, “title”, “subtitle”, “image”, “url” ], “components”: [ { “id”: “cardnhacyeuthich_{count}”, “type”: “MakeroidCardView”, “properties”: { “AlignVertical”: 1, “AlignHorizontal”: 1, “BackgroundColor”: -14869219, “Elevation”: 0, “ContentPaddingBottom”: 0, “ContentPaddingLeft”: 0, “ContentPaddingRight”: 0, “ContentPaddingTop”: 0, “FullClickable”: true, “StrokeWidth”: 0, “Width”: 200, “Height”: -2, “CornerRadius”: 0 }, “components”: [ { “id”: “Image_{count}”, “type”: “Image”, “properties”: { “HeightPercent”: 200, “WidthPercent”: 200, “ScalePictureToFit”: true, “Picture”: “{image}” } ] }, “components”: [ { “id”: “Item-Cards_{number}”, “type”: “MakeroidCardView”, “properties”: { “WidthPercent”: 90, “HeightPercent”: 15, “ContentPaddingTop”: 10, “ContentPaddingBottom”: 10, “ContentPaddingRight”: 10, “ContentPaddingLeft”: 10, “BackgroundColor”: -526345, “AlignVertical”: 2, “AlignHorizontal”: 3, “FullClickable”: true, “Elevation”: 0, “CornerRadius”: 10 }, ] “components”: [ { “id”: “Item-TitleLabel_{number}”, “type”: “Label”, “properties”: { “FontSize”: 16, “FontTypefaceImport”: “Comfortaa-Bold.ttf”, “Text”: “{item-title}” } }, { “id”: “Item-QuantityLabel_{number}”, “type”: “Label”, “properties”: { “FontSize”: 14, “FontTypefaceImport”: “Comfortaa-Medium.ttf”, “Text”: “{item-subtitle}” } } ] }, } ] }
Note: You will not see another error reported for 5 seconds.

The whole json is just invalid and not following the Schema format. Please learn json before using it.
https://jsonparseronline.com/ for checking if it’s valid.

Here's a modified one
{
    "name": "Nzuodj",
    "metadata-version": 1,
    "author": "Developer DXH",
    "platforms": [
        "Kodular"
    ],
    "keys": [
        "count",
        "title",
        "subtitle",
        "image",
        "url"
    ],
    "components": [
        {
            "id": "cardnhacyeuthich_{count}",
            "type": "MakeroidCardView",
            "properties": {
                "AlignVertical": 1,
                "AlignHorizontal": 1,
                "BackgroundColor": -14869219,
                "Elevation": 0,
                "ContentPaddingBottom": 0,
                "ContentPaddingLeft": 0,
                "ContentPaddingRight": 0,
                "ContentPaddingTop": 0,
                "FullClickable": true,
                "StrokeWidth": 0,
                "Width": 200,
                "Height": -2,
                "CornerRadius": 0
            },
            "components": [
                {
                    "id": "Image_{count}",
                    "type": "Image",
                    "properties": {
                        "HeightPercent": 200,
                        "WidthPercent": 200,
                        "ScalePictureToFit": true,
                        "Picture": "{image}"
                    }
                },
                {
                    "id": "Item-Cards_{number}",
                    "type": "MakeroidCardView",
                    "properties": {
                        "WidthPercent": 90,
                        "HeightPercent": 15,
                        "ContentPaddingTop": 10,
                        "ContentPaddingBottom": 10,
                        "ContentPaddingRight": 10,
                        "ContentPaddingLeft": 10,
                        "BackgroundColor": -526345,
                        "AlignVertical": 2,
                        "AlignHorizontal": 3,
                        "FullClickable": true,
                        "Elevation": 0,
                        "CornerRadius": 10
                    },
                    "components": [
                        {
                            "id": "Item-TitleLabel_{number}",
                            "type": "Label",
                            "properties": {
                                "FontSize": 16,
                                "FontTypefaceImport": "Comfortaa-Bold.ttf",
                                "Text": "{item-title}"
                            }
                        },
                        {
                            "id": "Item-QuantityLabel_{number}",
                            "type": "Label",
                            "properties": {
                                "FontSize": 14,
                                "FontTypefaceImport": "Comfortaa-Medium.ttf",
                                "Text": "{item-subtitle}"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}
4 Likes

Thank you, I’ll give it a try

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.