Skip to content

Main content

JSON: JSON Schema Nullable Enum Flag Tool

Inspect explicit null membership of one nonempty JSON Schema enum value array, not overall schema nullability under other keywords.

Loading tool…

Description

Parse enumJson as a nonempty array, then return its length and whether any value is literal null.

A JSON Schema keyword expresses one constraint on an instance. Required-list membership, property naming, numeric bounds, and enum contents are distinct checks within a larger schema.

Parse enumJson as a nonempty array, then return its length and whether any value is literal null.

When to use this tool

Use JSON: JSON Schema Nullable Enum Flag when you need one explicit schema-keyword or membership component.

How to use the tool and how it works

  1. Enter enumJson. 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 enumJson as a nonempty array, then return its length and whether any value is literal null.1

Input fieldMeaning and unitsAccepted input
enumJsonEnum JsonRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultResultRequired. Object.
result.containsNullContains NullCalculated result member: boolean.
result.enumSizeEnum SizeCalculated result member: number.
json
{
  "input": {
    "enumJson": "[\"x\",null]"
  },
  "output": {
    "result": {
      "containsNull": true,
      "enumSize": 2
    }
  }
}

Limitations and assumptions

  • Duplicates are counted and not rejected; this inspects one enum representation rather than a complete JSON Schema.
  • 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

Validate the complete schema and instance using the intended dialect before treating a local check as conformance.

References

  1. Calculation and input contract: json/json-schema-nullable-enum-flag — tool.io

Similar or alternative tools