Goal
Add support for boolean schemas and a raw schema escape hatch.
JSON Schema allows a schema itself to be a boolean:
true means every value is valid.
false means no value is valid.
Example:
accepts anything.
rejects everything.
Boolean schemas can also appear inside composition:
{
"anyOf": [
true,
{ "type": "string" }
]
}
Proposed DSL
any_of :value do
any_schema
string
end
none_of :value do
no_schema
end
Raw escape hatch
raw :value, {
"type" => "string",
"const" => "admin"
}
Acceptance criteria
- Boolean schemas work anywhere subschemas are accepted.
- Raw schema fragments are preserved and normalized.
- Generated schemas validate against Draft 2020-12 when fragments are valid.
Goal
Add support for boolean schemas and a raw schema escape hatch.
JSON Schema allows a schema itself to be a boolean:
truemeans every value is valid.falsemeans no value is valid.Example:
trueaccepts anything.
falserejects everything.
Boolean schemas can also appear inside composition:
{ "anyOf": [ true, { "type": "string" } ] }Proposed DSL
Raw escape hatch
Acceptance criteria