Skip to content

Options

j-brooke edited this page Oct 1, 2026 · 25 revisions

This page covers the settings for version 5.x. Please see other pages for version 4.x, version 3.x, version 2.x or version 1.x.

The FracturedJsonOptions constructor keeps the same defaults for the whole 5.x line. FracturedJsonOptions.Recommended() may turn on newer 5.x behavior; in 5.1 that means AllowTableSegments=true. Everything else described here uses constructor defaults unless noted.

Quick Reference

Most Important Settings

Also useful in 5.1

Note about Reordering and Rewriting

Most of what FracturedJson does involves just spaces, tabs, and newlines. However, there are some cases where it is allowed to rewrite the non-whitespace parts of the document. For most users that's harmless, but if your application is picky, there are a few things to keep in mind:

  • When table formatting is enabled (i.e., MaxTableRowComplexity has any value >= 0), object properties might be reordered to match the order of other rows.
  • When NumberListAlignment is Normalize, numbers in a row will be rewritten to all have the same number of digits after the decimal point. In some cases, they'll be converted from scientific notation.
  • When comments are allowed with CommentPolicy=Preserve, comments will sometimes be moved to the other sides of commas or colons. There's no way to disable this behavior while preserving comments.

Contents - Alphabetical

AllowTableSegments - AllowTrailingCommas - AlwaysExpandDepth - CollapseClosingBrackets - CollapseOpeningBrackets - ColonBeforePropNamePadding - ColonPadding - CommaPadding - CommentPadding - CommentPolicy - IndentSpaces - JsonEolStyle - MaxCompactArrayComplexity - MaxInlineComplexity - MaxPropNamePadding - MaxTableRowComplexity - MaxTotalLineLength - MinCompactArrayRowItems - NestedBracketPadding - NumberListAlignment - PrefixString - PreserveBlankLines - SimpleBracketPadding - SplitTableSegmentsAtBlankLines - SplitTableSegmentsAtComments - TableCommaPlacement - UseTabToIndent


Contents - Categorical

Length and Complexity - MaxTotalLineLength - MaxInlineComplexity - MaxCompactArrayComplexity - MaxTableRowComplexity - MinCompactArrayRowItems - AlwaysExpandDepth

Table Layout - AllowTableSegments - SplitTableSegmentsAtBlankLines - SplitTableSegmentsAtComments - TableCommaPlacement - NumberListAlignment

Expanded Layout - CollapseOpeningBrackets - CollapseClosingBrackets - MaxPropNamePadding - ColonBeforePropNamePadding

Padding and Indenting - IndentSpaces - UseTabToIndent - SimpleBracketPadding - NestedBracketPadding - ColonPadding - CommaPadding - CommentPadding - JsonEolStyle

Comments and Preservation - CommentPolicy - PreserveBlankLines - AllowTrailingCommas - PrefixString


Length and Complexity

Length and complexity are how FracturedJson decides how much to put on one line, and which of the four layouts (inlined, compact multiline array, table, expanded) is allowed.

MaxTotalLineLength

Maximum length of a line, including indentation and everything, for purposes of deciding how much to pile together.

Example with MaxTotalLineLength=80

{
    "LongArray"    : [
          2,   3,   5,   7,  11,  13,  17,  19,  23,  29,  31,  37,  41,  43,
         47,  53,  59,  61,  67,  71,  73,  79,  83,  89,  97, 101, 103, 107,
        109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181,
        191, 193, 197, 199
    ],
    "ComplexObject": {
        "Subthing1"  : {"X": 55, "Y": 19, "Z": -4},
        "Subthing2"  : { "Q": null, "W": [-2, -1, 0, 1] },
        "Distraction": [[], null, null]
    }
}

Example with MaxTotalLineLength=50

{
    "LongArray"    : [
          2,   3,   5,   7,  11,  13,  17,  19,
         23,  29,  31,  37,  41,  43,  47,  53,
         59,  61,  67,  71,  73,  79,  83,  89,
         97, 101, 103, 107, 109, 113, 127, 131,
        137, 139, 149, 151, 157, 163, 167, 173,
        179, 181, 191, 193, 197, 199
    ],
    "ComplexObject": {
        "Subthing1"  : {
            "X": 55,
            "Y": 19,
            "Z": -4
        },
        "Subthing2"  : {
            "Q": null,
            "W": [-2, -1, 0, 1]
        },
        "Distraction": [[], null, null]
    }
}

There are still some cases where a line will go longer than this value. A single element, with indentation, property name and leading and trailing comments, can still exceed the setting. Long strings, in particular, may overrun the limit.

Example with MaxTotalLineLength=80

{
    "LongArray": [
          2,   3,   5,   7,  11,  13,  17,  19,  23,  29,  31,  37,  41,  43,
         47,  53,  59,  61,  67,  71,  73,  79,  83,  89,  97, 101, 103, 107,
        109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181,
        191, 193, 197, 199
    ],
    "SomeString1": "A particularly long string for demo purposes",
    "SomeString2": "A shorter string" // with a comment
}

Example with MaxTotalLineLength=50

{
    "LongArray": [
          2,   3,   5,   7,  11,  13,  17,  19,
         23,  29,  31,  37,  41,  43,  47,  53,
         59,  61,  67,  71,  73,  79,  83,  89,
         97, 101, 103, 107, 109, 113, 127, 131,
        137, 139, 149, 151, 157, 163, 167, 173,
        179, 181, 191, 193, 197, 199
    ],
    "SomeString1": "A particularly long string for demo purposes",
    "SomeString2": "A shorter string" // with a comment
}

The following animation demonstrates how certain types of data are handled with different line lengths.

Changing line length animation

MaxInlineComplexity

The maximum nesting level that can be displayed on a single line. A primitive type or an empty array or object has a complexity of 0. An object or array has a complexity of 1 greater than its most complex child.

Example with MaxInlineComplexity=2

{
    "ComplexObject": {
        "Subthing1"  : {"X": 55, "Y": 19, "Z": -4},
        "Subthing2"  : { "Q": null, "W": [-2, -1, 0, 1] },
        "Distraction": [[], null, null]
    }
}

Example with MaxInlineComplexity=1

{
    "ComplexObject": {
        "Subthing1"  : {"X": 55, "Y": 19, "Z": -4},
        "Subthing2"  : {
            "Q": null,
            "W": [-2, -1, 0, 1]
        },
        "Distraction": [[], null, null]
    }
}

MaxCompactArrayComplexity

Maximum nesting level that can be arranged spanning multiple lines, with multiple items per line.

Example with MaxCompactArrayComplexity=1

{
    "LongArray" : [
          2,   3,   5,   7,  11,  13,  17,  19,  23,  29,  31,  37,  41,  43,  47,  53,  59,  61,
         67,  71,  73,  79,  83,  89,  97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
        157, 163, 167, 173, 179, 181, 191, 193, 197, 199
    ],
    "LongArray2": [
        [19,  2],
        [ 3,  8],
        [14,  0],
        [ 9,  9],
        [ 9,  9],
        [ 0,  3],
        [10,  1],
        [ 9,  1],
        [ 9,  2],
        [ 6, 13],
        [18,  5],
        [ 4, 11],
        [12,  2]
    ]
}

Example with MaxCompactArrayComplexity=2

{
    "LongArray" : [
          2,   3,   5,   7,  11,  13,  17,  19,  23,  29,  31,  37,  41,  43,  47,  53,  59,  61,
         67,  71,  73,  79,  83,  89,  97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
        157, 163, 167, 173, 179, 181, 191, 193, 197, 199
    ],
    "LongArray2": [
        [19,  2], [ 3,  8], [14,  0], [ 9,  9], [ 9,  9], [ 0,  3], [10,  1], [ 9,  1], [ 9,  2],
        [ 6, 13], [18,  5], [ 4, 11], [12,  2]
    ]
}

MaxTableRowComplexity

Maximum nesting level allowed in a row of a table-formatted array/object.

Set this to -1 to disable table formatting entirely. When tables are enabled, AllowTableSegments controls whether a container must table-format all of its children together or may break them into runs.

Example with MaxTableRowComplexity=2, MaxInlineComplexity=2

{
    "Rect" : { "position": {"x": -44, "y":  3.4        }, "color": [0, 255, 255] },
    "Point": { "position": {          "y": 22.0, "z": 3}                         },
    "Oval" : { "position": null,                          "color": "#7f3e96"     }
}

Example with MaxTableRowComplexity=1, MaxInlineComplexity=2

{
    "Rect" : { "position": {"x": -44, "y": 3.4}, "color": [0, 255, 255] },
    "Point": { "position": {"y": 22.0, "z": 3} },
    "Oval" : {"position": null, "color": "#7f3e96"}
}

Example with MaxTableRowComplexity=1, MaxInlineComplexity=1

{
    "Rect" : {
        "position": {"x": -44, "y": 3.4},
        "color"   : [0, 255, 255]
    },
    "Point": {
        "position": {"y": 22.0, "z": 3}
    },
    "Oval" : {"position": null, "color": "#7f3e96"}
}

MinCompactArrayRowItems

Minimum number of items per line to be eligible for compact-multiline-array formatting. (This isn't exact - some data sets could confuse the evaluation.)

Example with MinCompactArrayRowItems=3, MaxTotalLineLength=100

{
    "Books": [
        "Harry Potter and the Philosopher's Stone",
        "The Fellowship of the Ring",
        "A Night in the Lonesome October",
        "Neuromancer",
        "The Hitchhiker's Guide to the Galaxy"
    ]
}

Example with MinCompactArrayRowItems=2, MaxTotalLineLength=100

{
    "Books": [
        "Harry Potter and the Philosopher's Stone", "The Fellowship of the Ring",
        "A Night in the Lonesome October",          "Neuromancer",
        "The Hitchhiker's Guide to the Galaxy"
    ]
}

AlwaysExpandDepth

Forces elements close to the root to always fully expand, regardless of other settings.

AlwaysExpandDepth=-1, MaxInlineComplexity=3

[ [1, 2, 3], [ [4, 5], [6, 7] ] ]

AlwaysExpandDepth=0, MaxInlineComplexity=3

[
    [ 1,      2,      3 ],
    [ [4, 5], [6, 7]    ]
]

AlwaysExpandDepth=1, MaxInlineComplexity=3

[
    [
        1,
        2,
        3
    ],
    [
        [4, 5],
        [6, 7]
    ]
]

Table Layout

These settings control how table-formatted rows look, and whether a container may be split into more than one table. Table formatting itself is still gated by MaxTableRowComplexity (set it to -1 to turn tables off).

NumberListAlignment also applies to compact multiline arrays that contain only numbers and nulls, not just table columns.

AllowTableSegments

When AllowTableSegments is false, FracturedJson tries to write all of the items in a container as a single table. If it can't, it falls back to expanded formatting for the whole thing. When AllowTableSegments is true, groups of items can be written together as table rows even if others in the same container are too long or complex. This also enables SplitTableSegmentsAtBlankLines, SplitTableSegmentsAtComments.

AllowTableSegments=false; MaxTotalLineLength=80; MaxInlineComplexity=3; MaxTableRowComplexity=3

[
    { "Name": "Lenny", "Forms": [ [5, 23, 19] ] },
    { "Name": "Tom", "Forms": [ [106, 2, 34] ] },
    { "Name": "Tanesha", "Forms": [ [55, 1334, 6] ] },
    {
        "Name" : "Taylor",
        "Forms": [
            [  0,   1,   0], [ 88,  10,  19], [ 78,  23, 180], [401,  23,   2],
            [  6,  23,  19], [ 71,  23,  19], [ 23,  23,  19], [  9, 106,   2]
        ]
    },
    { "Name": "Clyde", "Forms": [ [12, 14, 9] ] },
    { "Name": "Syd", "Forms": [ [3, 2, 3] ] }
]

AllowTableSegments=true; MaxTotalLineLength=80; MaxInlineComplexity=3; MaxTableRowComplexity=3

[
    { "Name": "Lenny",   "Forms": [ [  5,   23, 19] ] },
    { "Name": "Tom",     "Forms": [ [106,    2, 34] ] },
    { "Name": "Tanesha", "Forms": [ [ 55, 1334,  6] ] },
    {
        "Name": "Taylor",
        "Forms": [
            [  0,   1,   0], [ 88,  10,  19], [ 78,  23, 180], [401,  23,   2],
            [  6,  23,  19], [ 71,  23,  19], [ 23,  23,  19], [  9, 106,   2]
        ]
    },
    { "Name": "Clyde", "Forms": [ [12, 14, 9] ] },
    { "Name": "Syd",   "Forms": [ [ 3,  2, 3] ] }
]

SplitTableSegmentsAtBlankLines

If AllowTableSegments is true, SplitTableSegmentsAtBlankLines is true and PreserveBlankLines is true, groups of items on opposite sides of blank lines are treated separately for table formatting.

In the example below, there isn't enough horizontal space to align all rows as a single table. ("Text": "Combat actions" would need a column all to itself, for example.) But with SplitTablesAtBlankLines set to true, two tables and one inline item are used.

AllowTableSegments=false; PreserveBlankLines=true; MaxTotalLineLength=100

[
    { "Type": "Text", "Pos": [0, 0], "Text": "Combat actions" },

    { "Type": "Btn", "Pos": [0, 5], "Label": "Kick", "Action": "act_kick" },
    { "Type": "Btn", "Pos": [25, 5], "Label": "Punch", "Action": "act_punch" },
    { "Type": "Btn", "Pos": [50, 5], "Label": "Bite", "Action": "act_bite" },
    { "Type": "Btn", "Pos": [75, 5], "Label": "Headbutt", "Action": "act_headbutt" },

    { "Type": "Img", "Pos": [0, 0], "ImgID": 8323 },
    { "Type": "Img", "Pos": [0, 50], "ImgID": 141 }
]

AllowTableSegments=true; SplitTablesAtBlankLines=true; PreserveBlankLines=true; MaxTotalLineLength=100

[
    { "Type": "Text", "Pos": [0, 0], "Text": "Combat actions" },

    { "Type": "Btn", "Pos": [ 0, 5], "Label": "Kick",     "Action": "act_kick"     },
    { "Type": "Btn", "Pos": [25, 5], "Label": "Punch",    "Action": "act_punch"    },
    { "Type": "Btn", "Pos": [50, 5], "Label": "Bite",     "Action": "act_bite"     },
    { "Type": "Btn", "Pos": [75, 5], "Label": "Headbutt", "Action": "act_headbutt" },

    { "Type": "Img", "Pos": [0,  0], "ImgID": 8323 },
    { "Type": "Img", "Pos": [0, 50], "ImgID":  141 }
]

SplitTableSegmentsAtComments

Like SplitTableSegmentsAtBlankLines, SplitTableSegmentsAtComments causes groups on opposite sides of standalone comments to be treated as separate tables. AllowTableSegments must be true and CommentPolicy must be Preserve to have any effect. Comments that are stuck to an element, before or after on the same line, don't cause this behavior.

AllowTableSegments=false; CommentPolicy=Preserve; MaxTotalLineLength=100

[
    // Text
    { "Type": "Text", "Pos": [0, 0], "Text": "Combat actions" },
    // Buttons
    { "Type": "Btn", "Pos": [0, 5], "Label": "Kick", "Action": "act_kick" },
    { "Type": "Btn", "Pos": [25, 5], "Label": "Punch", "Action": "act_punch" },
    { "Type": "Btn", "Pos": [50, 5], "Label": "Bite", "Action": "act_bite" },
    { "Type": "Btn", "Pos": [75, 5], "Label": "Headbutt", "Action": "act_headbutt" },
    // Graphics
    { "Type": "Img", "Pos": [0, 0], "ImgID": 8323 },
    { "Type": "Img", "Pos": [0, 50], "ImgID": 141 }
]

AllowTableSegments=true; SplitTableSegmentsAtComments=true; CommentPolicy=Preserve; MaxTotalLineLength=100

[
    // Text
    { "Type": "Text", "Pos": [0, 0], "Text": "Combat actions" },
    // Buttons
    { "Type": "Btn", "Pos": [ 0, 5], "Label": "Kick",     "Action": "act_kick"     },
    { "Type": "Btn", "Pos": [25, 5], "Label": "Punch",    "Action": "act_punch"    },
    { "Type": "Btn", "Pos": [50, 5], "Label": "Bite",     "Action": "act_bite"     },
    { "Type": "Btn", "Pos": [75, 5], "Label": "Headbutt", "Action": "act_headbutt" },
    // Graphics
    { "Type": "Img", "Pos": [0,  0], "ImgID": 8323 },
    { "Type": "Img", "Pos": [0, 50], "ImgID":  141 }
]

TableCommaPlacement

Where to place commas in table-formatted elements.

When set to AfterPadding, the commas come after alignment padding. This puts all of the commas for a column in a line. This can be useful for position-based processing like a text editor's rectangular selection mode. It sometimes looks silly when an array or object contains only simple strings.

Example with TableCommaPlacement=AfterPadding and NumberListAlignment=Decimal:

{
    "Inventory"    : [
        {"itm": "gadget"     , "qty":   7, "unit_pr":  1.99 , "mfg": "ACME"  },
        {"itm": "gizmo"      , "qty":  19, "unit_pr": 50    , "mfg": "ACME"  },
        {"itm": "whozit"     , "qty": 107, "unit_pr":  0.233, "mfg": "W-Dyne"},
        {"itm": "whatzit"    , "qty":  82, "unit_pr": 46.25 , "mfg": "W-Dyne"},
        {"itm": "thingamabob", "qty":  20, "unit_pr":  8    , "mfg": "ACME"  }
    ],
    "Beatles Songs": [
        "Taxman"                                                   ,
        "Hey Jude"                                                 ,
        "Everybody's Got Something to Hide Except Me and My Monkey",
        "Act Naturally"                                            ,
        "Ticket To Ride"
    ]
}

Setting it to BeforePadding looks more natural in most cases. The commas are immediately after the values to their left. It might be a little more confusing with certain number cases.

Example with TableCommaPlacement=BeforePadding and NumberListAlignment=Decimal:

{
    "Inventory"    : [
        {"itm": "gadget",      "qty":   7, "unit_pr":  1.99,  "mfg": "ACME"  },
        {"itm": "gizmo",       "qty":  19, "unit_pr": 50,     "mfg": "ACME"  },
        {"itm": "whozit",      "qty": 107, "unit_pr":  0.233, "mfg": "W-Dyne"},
        {"itm": "whatzit",     "qty":  82, "unit_pr": 46.25,  "mfg": "W-Dyne"},
        {"itm": "thingamabob", "qty":  20, "unit_pr":  8,     "mfg": "ACME"  }
    ],
    "Beatles Songs": [
        "Taxman",
        "Hey Jude",
        "Everybody's Got Something to Hide Except Me and My Monkey",
        "Act Naturally",
        "Ticket To Ride"
    ]
}

Use BeforePaddingExceptNumbers if you want the BeforePadding look in all cases except number columns. (This is only meaningful when NumberListAlignment is Left or Decimal. The numbers are right-aligned with no space before the commas in the other cases.)

Example with TableCommaPlacement=BeforePaddingExceptNumbers and NumberListAlignment=Decimal:

{
    "Inventory"    : [
        {"itm": "gadget",      "qty":   7, "unit_pr":  1.99 , "mfg": "ACME"  },
        {"itm": "gizmo",       "qty":  19, "unit_pr": 50    , "mfg": "ACME"  },
        {"itm": "whozit",      "qty": 107, "unit_pr":  0.233, "mfg": "W-Dyne"},
        {"itm": "whatzit",     "qty":  82, "unit_pr": 46.25 , "mfg": "W-Dyne"},
        {"itm": "thingamabob", "qty":  20, "unit_pr":  8    , "mfg": "ACME"  }
    ],
    "Beatles Songs": [
        "Taxman",
        "Hey Jude",
        "Everybody's Got Something to Hide Except Me and My Monkey",
        "Act Naturally",
        "Ticket To Ride"
    ]
}

NumberListAlignment

Controls how lists or table columns that contain only numbers and nulls are aligned. In all cases other than Normalize, numbers in the output are exactly the same as in the input document. In all cases, values too big to fit into a 64-bit float or integer are preserved without issue.

Left and Right work like you'd expect, but can be hard to read if the numbers of digits after the decimal point vary.

Normalize rewrites numbers to all have the same precision (number of digits after the decimal point). In many cases this looks better, but since it changes the actual content of the document - not just whitespace - it can cause problems for some applications. For example, 3 and 3.0are mathematically equivalent, but they might be deserialized as different types. Normalize won't be used of a list contains numbers with lots of digits.

Decimal (the default) aligns the decimal places of numbers, but it doesn't add digits or otherwise rewrite numbers.

This applies to table columns and to compact multiline arrays of numbers.

Example with NumberListAlignment=Left, MaxTotalLineLength=60

[
    {"a": 123.456 , "b": 0      , "c": 0   },
    {"a": 234567.8, "b": 0      , "c": 0   },
    {"a": 3       , "b": 0.00000, "c": 7e2 },
    {"a": null    , "b": 2e-1   , "c": 80e1},
    {"a": 5.6789  , "b": 3.5e-1 , "c": 0   }
]

Example with NumberListAlignment=Right, MaxTotalLineLength=60

[
    {"a":  123.456, "b":       0, "c":    0},
    {"a": 234567.8, "b":       0, "c":    0},
    {"a":        3, "b": 0.00000, "c":  7e2},
    {"a":     null, "b":    2e-1, "c": 80e1},
    {"a":   5.6789, "b":  3.5e-1, "c":    0}
]

Example with NumberListAlignment=Decimal, MaxTotalLineLength=60

[
    {"a":    123.456 , "b": 0      , "c":  0  },
    {"a": 234567.8   , "b": 0      , "c":  0  },
    {"a":      3     , "b": 0.00000, "c":  7e2},
    {"a":   null     , "b": 2e-1   , "c": 80e1},
    {"a":      5.6789, "b": 3.5e-1 , "c":  0  }
]

Example with NumberListAlignment=Normalize, MaxTotalLineLength=60

[
    {"a":    123.4560, "b": 0.00, "c":   0},
    {"a": 234567.8000, "b": 0.00, "c":   0},
    {"a":      3.0000, "b": 0.00, "c": 700},
    {"a":   null     , "b": 0.20, "c": 800},
    {"a":      5.6789, "b": 0.35, "c":   0}
]

See also: TableCommaPlacement (BeforePaddingExceptNumbers only matters for some of these alignments).


Expanded Layout

These settings control what an expanded array or object looks like after FracturedJson has already decided not to inline it or format it as a table. AlwaysExpandDepth (under Length and Complexity) is the related when knob.

CollapseOpeningBrackets

When CollapseOpeningBrackets is true, the first child of an expanded container will begin on the same line as the container's opening bracket if there's room. The child will begin at the same horizontal position as it would have on the next line, so container property names or prefix comments generally make it impossible unless you've got a large value set for IndentSpaces. CollapseOpeningBrackets is ignored if UseTabToIndent is true.

See CollapseClosingBrackets as well.

CollapseOpeningBrackets=false

[
    [
        {
            "Name": "*",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": false,
            "MaximumUnitTypeCount": {}
        },
        {
            "Name": "**",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": true,
            "MaximumUnitTypeCount": {}
        }
    ]
]

CollapseOpeningBrackets=true

[   [   {   "Name": "*",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": false,
            "MaximumUnitTypeCount": {}
        },
        {   "Name": "**",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": true,
            "MaximumUnitTypeCount": {}
        }
    ]
]

CollapseClosingBrackets

When CollapseClosingBrackets is true, an expanded container's closing bracket is placed on the same line as its last child. This won't happen if it would make the line too long, or if the last item in the container is a blank line or comment, or if the last item has an attached postfix comment.

See CollapseOpeningBrackets as well.

CollapseClosingBrackets=false

[
    [
        {
            "Name": "*",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": false,
            "MaximumUnitTypeCount": {}
        },
        {
            "Name": "**",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": true,
            "MaximumUnitTypeCount": {}
        }
    ]
]

CollapseClosingBrackets=true

[
    [
        {
            "Name": "*",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": false,
            "MaximumUnitTypeCount": {}},
        {
            "Name": "**",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": true,
            "MaximumUnitTypeCount": {}} ] ]

CollapseOpeningBrackets=true; CollapseClosingBrackets=true

[   [   {   "Name": "*",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": false,
            "MaximumUnitTypeCount": {}},
        {   "Name": "**",
            "PlayerTeamId": 2,
            "AttackersMustNotReachGoal": true,
            "MaximumUnitTypeCount": {}} ] ]

MaxPropNamePadding

Expanded object property values will be lined up as long as the size difference in labels is this value or less. Generally, lining up the property values looks good as long as the labels are roughly the same size, but not if they vary a lot. This only applies to expanded objects; table properties are lined up no matter what.

Example with MaxPropNamePadding=7, MaxTotalLineLength=80

{
    "ModuleId"   : "armor",
    "Name"       : "",
    "Locations"  : [
        [11,  2], [11,  3], [11,  4], [11,  5], [11,  6], [11,  7], [11,  8],
        [11,  9], [11, 10], [11, 11], [11, 12], [11, 13]
    ],
    "Orientation": "Fore",
    "Seed"       : 272691529
}

Example with MaxPropNamePadding=6, MaxTotalLineLength=80

{
    "ModuleId": "armor",
    "Name": "",
    "Locations": [
        [11,  2], [11,  3], [11,  4], [11,  5], [11,  6], [11,  7], [11,  8],
        [11,  9], [11, 10], [11, 11], [11, 12], [11, 13]
    ],
    "Orientation": "Fore",
    "Seed": 272691529
}

Example with MaxPropNamePadding=16, MaxTotalLineLength=80

{
    "num"              : 14,
    "string"           : "testing property alignment",
    "arrayWithLongName": [null, null, null]
}

Example with MaxPropNamePadding=13, MaxTotalLineLength=80

{
    "num": 14,
    "string": "testing property alignment",
    "arrayWithLongName": [null, null, null]
}

ColonBeforePropNamePadding

Set to true if you want colons to the left of the spaces uses to line up expanded properties. false puts them after the padding, in a row of their own.

Example with ColonBeforePropNamePadding=true, MaxTotalLineLength=80

{
    "num":               14,
    "string":            "testing property alignment",
    "arrayWithLongName": [null, null, null]
}

Example with ColonBeforePropNamePadding=false, MaxTotalLineLength=80

{
    "num"              : 14,
    "string"           : "testing property alignment",
    "arrayWithLongName": [null, null, null]
}

Padding and Indenting

IndentSpaces

Indents by this number of spaces for each level of depth. If UseTabToIndent=true, tab characters will be used instead of spaces, but the IndentSpaces value will still be used to calculate line lengths.

UseTabToIndent

If true, a single tab character is used per indentation level, instead of spaces.

CollapseOpeningBrackets is ignored when this is true.

SimpleBracketPadding

If true, a space is added between an array/object's brackets and its contents, if that array/object has a complexity of 1. That is, if it only contains primitive elements and/or empty arrays/objects.

Example with SimpleBracketPadding=false

{
    "Subthing1"  : {"X": 55, "Y": 19, "Z": -4},
    "Subthing2"  : { "Q": null, "W": [-2, -1, 0, 1] },
    "Distraction": [[], null, null]
}

Example with SimpleBracketPadding=true

{
    "Subthing1"  : { "X": 55, "Y": 19, "Z": -4 },
    "Subthing2"  : { "Q": null, "W": [ -2, -1, 0, 1 ] },
    "Distraction": [ [], null, null ]
}

NestedBracketPadding

If true, a space is added between an array/object's brackets and its contents, if that array/object has a complexity of 2 or more. That is, if it contains non-empty arrays/objects.

Example with NestedBracketPadding=true

{
    "Subthing1"  : {"X": 55, "Y": 19, "Z": -4},
    "Subthing2"  : { "Q": null, "W": [-2, -1, 0, 1] },
    "Distraction": [[], null, null]
}

Example with NestedBracketPadding=false

{
    "Subthing1"  : {"X": 55, "Y": 19, "Z": -4},
    "Subthing2"  : {"Q": null, "W": [-2, -1, 0, 1]},
    "Distraction": [[], null, null]
}

ColonPadding

If true, a space is added after a colon.

CommaPadding

If true, a space is added after a comma.

CommentPadding

If true, a space is added between a prefix/postfix comment and the element to which it is attached.

JsonEolStyle

Determines which sort of line endings to use.


Comments and Preservation

CommentPolicy

Determines how comments should be handled. The JSON standard doesn't allow comments, but as an unofficial extension they are fairly wide-spread and useful.

  • TreatAsError - Comments found in the input will cause exceptions.
  • Remove - Comments in the input won't cause exceptions, but they won't be included in the output.
  • Preserve - Comments in the input will be included in the output. When comments are on the same lines as values in the input, FracturedJson will try to keep the comments together with their associated values.

SplitTableSegmentsAtComments only does anything when this is Preserve.

PreserveBlankLines

If true, blank lines (lines containing only whitespace) from the input will be reproduced in the output.

SplitTableSegmentsAtBlankLines only does anything when this is true.

AllowTrailingCommas

If true, the final element in an array or object in the input may have a comma after it; otherwise an exception is thrown. The JSON standard doesn't allow trailing commas, but some other tools allow them, so the option is provided for interoperability with them.

PrefixString

A string to be included at the start of every line of output. Note that if this string is anything other than whitespace, it will probably make the output invalid as JSON.

Clone this wiki locally