Sha256: 6491a24a07355da7e4b1431748a6341fa685d48bc1efa4ac180d61ae6ea0edfd

Contents?: true

Size: 781 Bytes

Versions: 23

Compression:

Stored size: 781 Bytes

Contents

# json_schema

A JSON Schema V4 and Hyperschema V4 parser and validator.

Validate some data based on a JSON Schema:

```
gem install json_schema
validate-schema schema.json data.json
```

## Programmatic

``` ruby
require "json"
require "json_schema"

# parse the schema
schema_data = JSON.parse(File.read("schema.json"))
schema = JsonSchema.parse!(schema_data)

# validate some data
data = JSON.parse(File.read("data.json"))
schema.validate!(data)

# iterate through hyperschema links
schema.links.each do |link|
  puts "#{link.method} #{link.href}"
end
```

## Development

Run the test suite with:

```
rake
```

Or run specific suites or tests with:

```
ruby -Ilib -Itest test/json_schema/validator_test.rb
ruby -Ilib -Itest test/json_schema/validator_test.rb -n /anyOf/
```

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
json_schema-0.2.0 README.md
json_schema-0.1.9 README.md
json_schema-0.1.8 README.md
json_schema-0.1.7 README.md
json_schema-0.1.6 README.md
json_schema-0.1.5 README.md
json_schema-0.1.4 README.md
json_schema-0.1.3 README.md
json_schema-0.1.2 README.md
json_schema-0.1.1 README.md
json_schema-0.1.0 README.md
json_schema-0.0.20 README.md
json_schema-0.0.19 README.md
json_schema-0.0.18 README.md
json_schema-0.0.17 README.md
json_schema-0.0.16 README.md
json_schema-0.0.15 README.md
json_schema-0.0.14 README.md
json_schema-0.0.13 README.md
json_schema-0.0.12 README.md