Skip to content

Main content

List Empty Sentinel Label Tool

Identify a bounded JSON list's empty/nonempty state without confusing an explicit null item with the empty list.

Loading tool…

Description

Parse itemsJson as a JSON array, count its entries, and label empty-list or nonempty-list.

JSON distinguishes null, strings, numbers, Booleans, arrays, and objects. Parsing a token produces a value whose type can differ from its apparent textual spelling.

Parse itemsJson as a JSON array, count its entries, and label empty-list or nonempty-list.

When to use this tool

Use List Empty Sentinel Label when you need one bounded JSON value classification or wrapper operation.

How to use the tool and how it works

  1. Enter itemsJson. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read label, count. Use the output convention below.

Parse itemsJson as a JSON array, count its entries, and label empty-list or nonempty-list.1

Input fieldMeaning and unitsAccepted input
itemsJsonItems JsonRequired. Text; maximum UTF-16 length 8192.
Output fieldInterpretationReturned shape
labelFormatted label for the supplied components under the convention above.Required. Text; maximum UTF-16 length 8192.
countCount under the stated selection and duplicate convention.Required. Safe integer.
json
{
  "input": {
    "itemsJson": "[null]"
  },
  "output": {
    "label": "nonempty-list",
    "count": 1
  }
}

Limitations and assumptions

  • This distinguishes array emptiness from values such as null or an empty string; nonarrays and malformed JSON are rejected and no entries are filtered.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use a full document parser and the consuming schema when complete validation or exact numeric preservation is required.

References

  1. Calculation and input contract: list/list-empty-sentinel-label — tool.io

Similar or alternative tools