toJsonSummaryString

fun toJsonSummaryString(limit: Int = DEFAULT_SUMMARY_LIMIT): String

Where it is and roughly what it holds: $['items'][0] {"sku":"a",…3 more}.

The location in VariantPath.toNormalizedPath's form — the spelling another reader can parse — followed by a space and Variant.toJsonSummaryString's outline of the value.

The cost contract is that file's, with the one honest addition: the result's length and the bytes read are bounded by a function of limit, SUMMARY_VALUE_LIMIT and the length of location. A path is not bounded by anything, so claiming otherwise would be claiming a bound this cannot hold. What it does hold is the half that matters: the value costs the same whether it is a boolean or four megabytes.

Parameters

limit

top-level children of value to show.

Throws

if limit is negative, or if location holds a field name with an unpaired surrogate — see VariantPath.toNormalizedPath.

if the value's bytes do not decode. A summary reports unreadable data rather than eliding it; toString is the form that cannot throw.