Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Create json file with multiple arrays.



  • Hi All,
    I'm in a mess of json arrays and objects. I want to create a Json file as follows. I've tried too many combinations but I failed. How it should be? I'm waiting for your help. Thanks All.

    The format I'm trying to do;
    {
    "Titles": [
    {
    "First" : [
    {
    "Title":"Hello"
    },
    {
    "Title":"Thank"
    },
    {
    "Title":"You"
    }
    ],
    "Last":[
    {
    "Title":"Good"
    },
    {
    "Title":"Bye"
    }
    ]
    }
    ]
    }


  • Qt Champions 2019

    @Cihangir Like this

    {
    	"Titles": {
    		"First": [{
    				"Title": "Hello"
    			},
    			{
    				"Title": "Thank"
    			},
    			{
    				"Title": "You"
    			}
    		],
    		"Last": [{
    				"Title": "Good"
    			},
    			{
    				"Title": "Bye"
    			}
    		]
    	}
    }
    

    ?
    There are JSON validators you can use to validate your JSON and find errors.



  • @Cihangir
    Are you looking for the text of the JSON file which @jsulm has given you, or are you looking to generate the file from code with Qt JSON classes?


Log in to reply