flavio / qjson

QJson is a qt-based library that maps JSON data to QVariant objects.
http://qjson.sourceforge.net
GNU Lesser General Public License v2.1
288 stars 140 forks source link

JSON Indentation bug in list #30

Closed pasnox closed 10 years ago

pasnox commented 11 years ago

Hi,

There is some indentation problems using full indentation mode with list. Here is an example of the content that is generated by qjson (note that i give all because i don't know which part is generating the bug):

HINT: Search for "columns" / "constraints" list and see blank lines and unindented values. "references" looks to have it's opening bracket very far : "references" : {

{
 "connection" :  {
  "connectOptions" : "",
  "connectionName" : "my connection",
  "databaseName" : "/ramdisk/db.sqlite",
  "driverName" : "QSQLITE",
  "hostName" : "",
  "numericalPrecisionPolicy" : -1,
  "password" : "XXXXXXXXX",
  "port" : -1,
  "userName" : ""
 },
 "schemas" : [
  {
   "isForeignKeyEnabled" : true,
   "revision" : "2013-07-21T00:00:00Z",
   "tables" : [
    {
     "columns" : [
      {
       "constraints" : [
        {
         "collationName" : "",
         "conflictClause" : "",
         "defaultValue" : null,
         "expression" : "",
         "name" : "artists_id_pk",
         "references" :          {
          "columns" : [

          ],
          "tableName" : ""
         },
         "sortOrder" : -1,
         "type" : 257
        }
       ],
       "name" : "id",
       "type" : 4
      },
      {
       "constraints" : [
        {
         "collationName" : "",
         "conflictClause" : "",
         "defaultValue" : null,
         "expression" : "",
         "name" : "artists_first_name_index",
         "references" :          {
          "columns" : [

          ],
          "tableName" : ""
         },
         "sortOrder" : -1,
         "type" : 128
        },
        {
         "collationName" : "",
         "conflictClause" : "",
         "defaultValue" : null,
         "expression" : "",
         "name" : "artists_first_name_not_null",
         "references" :          {
          "columns" : [

          ],
          "tableName" : ""
         },
         "sortOrder" : -1,
         "type" : 2
        }
       ],
       "name" : "first_name",
       "type" : 10
      },
      {
       "constraints" : [
        {
         "collationName" : "",
         "conflictClause" : "",
         "defaultValue" : null,
         "expression" : "",
         "name" : "artists_last_name_index",
         "references" :          {
          "columns" : [

          ],
          "tableName" : ""
         },
         "sortOrder" : -1,
         "type" : 128
        },
        {
         "collationName" : "",
         "conflictClause" : "",
         "defaultValue" : null,
         "expression" : "",
         "name" : "artists_last_name_not_null",
         "references" :          {
          "columns" : [

          ],
          "tableName" : ""
         },
         "sortOrder" : -1,
         "type" : 2
        }
       ],
       "name" : "last_name",
       "type" : 10
      },
      {
       "constraints" : [

       ],
       "name" : "birthday",
       "type" : 16
      },
      {
       "constraints" : [

       ],
       "name" : "scene_name",
       "type" : 10
      }
     ],
     "constraints" : [
      {
       "columns" : [
"birthday"
       ],
       "conflictClause" : "",
       "expression" : "",
       "name" : "artists_birthday_index",
       "references" :        {
        "columns" : [

        ],
        "tableName" : ""
       },
       "sortOrder" : -1,
       "type" : 128
      },
      {
       "columns" : [
"scene_name"
       ],
       "conflictClause" : "",
       "expression" : "",
       "name" : "artists_scene_name_index",
       "references" :        {
        "columns" : [

        ],
        "tableName" : ""
       },
       "sortOrder" : -1,
       "type" : 128
      }
     ],
     "name" : "artists"
    }
   ]
  }
 ]
}
flavio commented 10 years ago

Should have been fixed by PR40.