Skip to content

threedaymonk/argo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Argo

Turn a JSON Schema into Ruby objects that describe properties and validations.

Work in progress.

Usage

require 'argo/parser'
require 'json'

json_schema = File.read('spec/fixtures/entry-schema.json')
schema = Argo::Parser.new(JSON.parse(json_schema)).root

schema.description # => "schema for an fstab entry"
schema.properties.keys # => ["storage", "fstype", "options", "readonly"]
schema.properties['fstype'].constraints # => {:enum=>["ext3", "ext4", "btrfs"]}

See spec/integration for more examples.

About

Turn a JSON Schema into Ruby objects that describe properties and validations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages