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
- Enter itemsJson. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| itemsJson | Items Json | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| label | Formatted label for the supplied components under the convention above. | Required. Text; maximum UTF-16 length 8192. |
| count | Count under the stated selection and duplicate convention. | Required. Safe integer. |
{
"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
Similar or alternative tools
- JSON Array Hole Vs Null Label
Parse arrayJson as a JSON array and validate a nonnegative index.
- Singleton Empty Set Brace Formatter
Return braces around JSON.stringify(element) when singleton is true, otherwise empty braces.