voxpupuli / json-schema

Ruby JSON Schema Validator
MIT License
1.52k stars 242 forks source link

possible to enforce schema ? #410

Closed c0ze closed 6 years ago

c0ze commented 6 years ago

I have a JSON field, and I want to make sure some keys are present.

Is it possible to have this schema enforced ? (when I serialize the field with this schema, if key doesnt exist, create with blank value)

iainbeeston commented 6 years ago

I think the insert defaults option is what you want. Please look in the readme