Validating JSON the Easy Way

Short Form


Learn how to use a simple Ruby DSL to validate patterns in JSON.


The JSON Patterns Ruby Gem is a domain-specific language (DSL) library for validating the structure of JSON documents, using patterns that resemble JSON. Just as regexps look a lot like a string, with special symbols to match patterns, a JSON pattern looks like a JSON value, with special keywords to allow for abstract pattern matching.

It supports the use of alternate object patterns, which can be distinguished by a tag. This allows for a JSON structure to mimic subtyping.

Speaking experience

I have spoken seven times at the Portland Functional Programming Study Group, once at the Portland Ruby Brigade (on this same topic), and once at the Zissou Society for Programming Language Exploration. Videos for some of my talks are at


  • Biography

    Lyle started out with BASIC in the 1980s and has alternated between programming professionally and academia for the past 19 years. He has become known in the past year for giving talks at the Portland Functional Programming Study Group. His goal is to make programming expressive for everyone: as simple as possible, but no simpler. He loves learning and designing new programming languages.