Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (43 sloc) 1.5 KB

json-zetta Build Status

Provides a JSON parser implemented using the zetta-parser library.

The only benefit that this parser provides in comparision to is the possibility of starting to parse a string without having all the input available (thanks to zetta-parser).


[org.van-clj/zetta-river "0.0.3"]


(ns example
  (:use [zetta.core :only (parse-once)]
        [zetta.json :only (json)]))

(parse-once json "{ \"name\": \"John Doe\",
                    \"professional\": false,
                    \"background\": null,
                    \"age\": 43,
                    \"phones\": [\"555-5555\",
                    \"address\": {
                      \"suite\": \"3241\",
                        \"90210 \\\"Beverly\\\" Hills\",
                      \"city\": \"Los Angeles\",
                      \"state\": \"California\",
                      \"country\": \"USA\"}}")

; Returns
; { :name "John Doe"
;    :age 43
;    :professional false
;    :background nil
;    :phones ["555-5555" "666-6666"]
;    :address {
;      :suite "3241"
;      :street "90210 \"Beverly\" Hills"
;      :city "Los Angeles"
;      :state "California"
;      :country "USA" }}


Copyright (C) 2012 Roman Gonzalez.

Distributed under the Eclipse Public License, the same as Clojure.