Skip to content

Instantly share code, notes, and snippets.

@jpmckinney
Created February 7, 2014 18:14
Show Gist options
  • Save jpmckinney/8868460 to your computer and use it in GitHub Desktop.
Save jpmckinney/8868460 to your computer and use it in GitHub Desktop.
Public example of how to validate Popolo documents.
require 'json'
require 'open-uri'
require 'json-schema'
schema = JSON.load(open("http://popoloproject.com/schemas/person.json#"))
JSON::Validator.cache_schemas = true
JSON.load(open("https://raw.github.com/tmtmtmtm/eduskunta-popolo/master/people.json")).each do |person|
JSON::Validator.validate!(schema, person)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment