Goal
Add support for the remaining JSON Schema composition keywords:
The gem already supports anyOf and oneOf.
Proposed DSL for allOf
all_of :payload do
object { string :name }
object { integer :age }
end
This means the value must satisfy all provided schemas.
Proposed DSL for not
not is a Ruby keyword, so avoid using it directly.
none_of :status do
string enum: ["forbidden"]
end
This means status must not match the provided schema.
If multiple schemas are given, none_of can emit:
{
"not": {
"anyOf": [...]
}
}
Acceptance criteria
- API is consistent with existing
any_of and one_of.
- Behavior tests cover pass and fail cases.
- Generated schemas validate against Draft 2020-12.
Goal
Add support for the remaining JSON Schema composition keywords:
allOfnotThe gem already supports
anyOfandoneOf.Proposed DSL for
allOfThis means the value must satisfy all provided schemas.
Proposed DSL for
notnotis a Ruby keyword, so avoid using it directly.This means
statusmust not match the provided schema.If multiple schemas are given,
none_ofcan emit:{ "not": { "anyOf": [...] } }Acceptance criteria
any_ofandone_of.