Supported features

dotjson uses JSON Schema to define the structure of the JSON objects to be returned by the model. dotjson supports most features from JSON Schema specification version 2020-12, and follows the specification unless otherwise specified.

For an introduction to JSON Schema, visit the official documentation.

  Note

Compilation will fail if you pass a JSON Schema that contains keywords or combinations of keywords that are not supported. With an error message that specifies the unsupported construct.

Quick Reference

The following table is a quick reference for the keywords suported by dotjson. Keywords can interact in non-trivial ways and we strongly recommend you consult the usage guide.

Keyword / AreaStatusNotes
typestring, number, integer, boolean, null, array, object.
minLength / maxLengthStrings; counts characters.
patternMost regex features; see unsupported regex list.
formatStrictly enforced at generation time. Supports: email, hostname, ipv4, uri, uri-reference, uuid, date, time, date-time, duration.
enumWorks for any type
constWorks for any type.
minimum / maximumNumbers & integers.
exclusiveMinimum / exclusiveMaximumNumbers & integers.
itemsHomogeneous arrays. See note*
prefixItemsTuple validation (heterogeneous arrays).
minItems / maxItemsArray length.
requiredPer object (including nested).
Optional fields
$defs + $refInternal refs only (no external refs).
Recursive schemasUnlimited depth supported.
anyOfIncluding at the root
allOf
additionalProperties✅️Defaults to false.
{} or {"type": "object"}✅️Arbitrary JSON fields
multipleOfOn integers
oneOfTreated as anyOf.
propertyNames
notNot supported.
if / then / elseNot supported
dependentRequiredNot supported
dependentSchemasNot supported.
patternPropertiesNot supported.
uniqueItemsNot supported.
unevaluatedProperties / unevaluatedItemsNot supported.
Object size: minProperties / maxPropertiesNot supported.

Note: items can also be used for tuple validation along with additionalItems per the draft 2019-09 specification. However, we recommend using prefixItems for tuple validation and items for homogenous arrays or extra items beyond the prefixItems tuple.

Unsupported regular expressions

Certain regular expression patterns are not supported:

  • \b for word boundaries
  • Backwards references, e.g. \1 or (?P=open)
  • Conditional matches (?(1)a|b)
  • Lookbacks (?=bar)
  • Lookaheads foo(?=bar)
  • Lookbehinds (?<=foo)bar
  • Atomic groups (?>pattern)
  • Recursion (?R) or (?1)
  • Non-capturing groups (?:pattern)
  • Named captures (?P<name>pattern)
  • Inline modifiers (?i)case-insensitive
  • Subroutines \g<1>
  • Branch resets (?|pattern1|pattern2)
  • Inline comments (?#comment)
  • Code callouts (*MARK:name)
  • Version checks (*VERSION)
  • Whitespace-insensitive patterns, e.g. (?x)pattern # comment

Unsupported combinations

Certain keyword combinations are not supported and will cause compilation to fail.

Multiple string constraints (failing example)

Combining format with other string constraints like minLength/maxLength is not supported.

{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "format": "email",
      "minLength": 5
    }
  },
  "required": ["email"],
  "additionalProperties": false
}

Expected behavior: index compilation fails with an error indicating that combining format with other string constraints is unsupported. Remove the extra string constraints or validate them application‑side.