Project

argo

0.0
No commit activity in last 3 years
No release in over 3 years
Expand JSON Schema(s) into introspectable Ruby objects
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 0.9
~> 3.0
~> 0.32
 Project Readme

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.