[IMPLEMENTED] CLI Import from JSON

Hi Sebastian, I want to import the content from the json file.
The json file looks like:

[
    {
        "author": "朱貞白",
        "paragraphs": [
            "當塗當塗見,蕪湖蕪湖見。",
            "八月十五夜,一似沒柄扇。"
        ],
        "title": "詠月",
        "id": "f0890360-c046-4c63-8121-76d8fe8d6195"
    },
    {
        "author": "朱貞白",
        "paragraphs": [
            "蟬眼龜形脚似蛛,未嘗正面向人趨。",
            "如今飣在盤筵上,得似江湖亂走無。"
        ],
        "title": "詠螃蟹",
        "id": "cb8d923e-6592-41ab-8948-013063676207"
    },
]

The schema as follow:

{
    "properties": {},
    "scripts": {},
    "fieldsInLists": [],
    "fieldsInReferences": [],
    "fields": [
        {
            "name": "title",
            "properties": {
                "fieldType": "String",
                "editor": "Input"
            },
            "partitioning": "invariant"
        },
        {
            "name": "author",
            "properties": {
                "fieldType": "String",
                "editor": "Input"
            },
            "partitioning": "invariant"
        },
        {
            "name": "paragraphs",
            "properties": {
                "fieldType": "Json"
            },
            "partitioning": "invariant"
        }
    ],
    "isPublished": true
}

How the create a Json2SquidexConverter?

Hi,

You have to use the API for that.

I would have a look to the CLI: https://github.com/Squidex/squidex-samples/blob/master/cli/Squidex.CLI/Squidex.CLI/Commands/App_Content.cs#L192

It is an CSV importer but the code can be used to write a JSON importer as well. PRs would be also welcome

Thanks for your quick reply, I will have a try.:grinning:

I have changed this to a feature request. Awesome work done by @Jason_Ma, who has already provided a pull request for this feature :slight_smile: