Skip to content

Instantly share code, notes, and snippets.

@gilesbowkett
Created January 15, 2015 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilesbowkett/0917ddad637b85965acb to your computer and use it in GitHub Desktop.
Save gilesbowkett/0917ddad637b85965acb to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'json-schema'
schema = {
"type" => "object",
"required" => ["a"],
"properties" => {
"a" => {"type" => "integer"}
}
}
data = {
"a" => 5
}
JSON::Validator.validate(schema, data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment