Commit 08a6b6c1 authored by Jonne Haß's avatar Jonne Haß

add very basic validator

parent e88bd8a6
source "https://rubygems.org"
gem "json-schema"
GEM
remote: https://rubygems.org/
specs:
addressable (2.3.8)
json-schema (2.5.1)
addressable (~> 2.3.7)
PLATFORMS
ruby
DEPENDENCIES
json-schema
BUNDLED WITH
1.10.6
#!/usr/bin/env ruby
require "bundler/setup"
require "json"
require "json-schema"
schema = File.read File.expand_path "#{__dir__}/../schemas/1.0/schema.json"
json = JSON.parse(ARGF.read)
messages = JSON::Validator.fully_validate(schema, json)
if messages.empty?
puts "Everything valid!"
else
puts messages
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment