Goal
Add support for JSON Schema const.
const means the value must equal one exact JSON value. It is similar to a one-value enum, but JSON Schema has a dedicated keyword for it.
Example JSON Schema:
Proposed DSL
string :role, const: "admin"
integer :version, const: 1
boolean :enabled, const: true
null :deleted_at, const: nil
Acceptance criteria
- Works across primitive types.
- Output uses
const.
- Behavior tests cover matching and non-matching values.
- Generated schemas validate against Draft 2020-12.
Related work
Generic enum support already has related work:
Goal
Add support for JSON Schema
const.constmeans the value must equal one exact JSON value. It is similar to a one-valueenum, but JSON Schema has a dedicated keyword for it.Example JSON Schema:
{ "const": "admin" }Proposed DSL
Acceptance criteria
const.Related work
Generic
enumsupport already has related work: