Skip to content

Main content

JSON: JSON Scalar Type Tag Tool

Tag one parsed JSON scalar, explicitly distinguishing null and rejecting arrays/objects rather than pretending they are scalars.

Loading tool…

Description

Parse valueJson, reject arrays and objects, and return null, boolean, number, or string as the scalar type.

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 valueJson, reject arrays and objects, and return null, boolean, number, or string as the scalar type.

When to use this tool

Use JSON: JSON Scalar Type Tag when you need one bounded JSON value classification or wrapper operation.

How to use the tool and how it works

  1. Enter valueJson. 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 result. Expand result to inspect the returned fields.

Parse valueJson, reject arrays and objects, and return null, boolean, number, or string as the scalar type.1

Input fieldMeaning and unitsAccepted input
valueJsonValue JsonRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.typeTypeCalculated result member: string.
json
{
  "input": {
    "valueJson": "false"
  },
  "output": {
    "result": {
      "type": "boolean"
    }
  }
}

Limitations and assumptions

  • Numeric token spelling is not preserved; this classifies the parsed JavaScript value.
  • Outputs are nested inside result. 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: json/json-scalar-type-tag — tool.io

Similar or alternative tools