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 / Area | Status | Notes |
|---|---|---|
type | ✅ | string, number, integer, boolean, null, array, object. |
minLength / maxLength | ✅ | Strings; counts characters. |
pattern | ✅ | Most regex features; see unsupported regex list. |
format | ✅ | Strictly enforced at generation time. Supports: email, hostname, ipv4, uri, uri-reference, uuid, date, time, date-time, duration. |
enum | ✅ | Works for any type |
const | ✅ | Works for any type. |
minimum / maximum | ✅ | Numbers & integers. |
exclusiveMinimum / exclusiveMaximum | ✅ | Numbers & integers. |
items | ✅ | Homogeneous arrays. See note* |
prefixItems | ✅ | Tuple validation (heterogeneous arrays). |
minItems / maxItems | ✅ | Array length. |
required | ✅ | Per object (including nested). |
| Optional fields | ✅ | |
$defs + $ref | ✅ | Internal refs only (no external refs). |
| Recursive schemas | ✅ | Unlimited depth supported. |
anyOf | ✅ | Including at the root |
allOf | ✅ | |
additionalProperties | ✅️ | Defaults to false. |
{} or {"type": "object"} | ✅️ | Arbitrary JSON fields |
multipleOf | ✅ | On integers |
oneOf | ✅ | Treated as anyOf. |
propertyNames | ✅ | |
not | ❌ | Not supported. |
if / then / else | ❌ | Not supported |
dependentRequired | ❌ | Not supported |
dependentSchemas | ❌ | Not supported. |
patternProperties | ❌ | Not supported. |
uniqueItems | ❌ | Not supported. |
unevaluatedProperties / unevaluatedItems | ❌ | Not supported. |
Object size: minProperties / maxProperties | ❌ | Not 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:
\bfor word boundaries- Backwards references, e.g.
\1or(?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.