Browse Source

and check schema

pull/76/head
magicmilo 3 years ago
parent
commit
ceb8ea03cb
  1. 12
      app/helpers/json_schema_validation.rb

12
app/helpers/json_schema_validation.rb

@ -55,12 +55,24 @@ begin
"label": {
"description": "",
"type": "string"
},
"subsections": {
"type": "object"
}
}
}
}
}
metaschema = JSON::Validator.validator_for_name("draft4").metaschema
# => true
if JSON::Validator.validate(metaschema, schema)
puts "schema valid"
else
puts "schema not valid"
return
end
path = "spec/fixtures/forms/test_validator.json"
# path = "config/forms/2021_2022.json"

Loading…
Cancel
Save