Skip to content

Main content

JSON Schema Boolean Const Literal Tool

Compute json schema boolean const literal from explicit bounded inputs.

Loading tool…

Description

Serialize an object containing type boolean and const equal to the supplied Boolean value as schemaJson.

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.

Serialize an object containing type boolean and const equal to the supplied Boolean value as schemaJson.

When to use this tool

Use JSON Schema Boolean Const Literal when you need one explicit schema-keyword or membership component.

How to use the tool and how it works

  1. Enter value. 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 schemaJson. Use the output convention below.

Serialize an object containing type boolean and const equal to the supplied Boolean value as schemaJson.1

Input fieldMeaning and unitsAccepted input
valueValueRequired. Boolean.
Output fieldInterpretationReturned shape
schemaJsonSchema JsonRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "value": true
  },
  "output": {
    "schemaJson": "{\"type\":\"boolean\",\"const\":true}"
  }
}

Limitations and assumptions

  • This builds one small schema fragment; no instance validation or schema dialect declaration is added.
  • 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-boolean-const-literal — tool.io

Similar or alternative tools