JSON

The tale of JSONModel and the type-hinted arrays

Lately, I've been working a lot with JSON (see Intro-to-jq), and this led me to the excellent Objective-C library, JSONModel.

One thing I couldn't find documented was how I could type-hint array properties so that I didn't need to manually cast them to the type I knew JSONModel was producing.

Read more…

Intro to jq

General usage

$ jq --help
jq - commandline JSON processor [version 1.4]
Usage: jq [options] <jq filter> [file...]
For a description of the command line options and
how to write jq filters (and why you might want to)
see the jq manpage, or the online documentation at
http://stedolan.github.com/jq

Try looking at raw json

cat data.json
{"took":23,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":614,"max_score":1,"hits":[…]}}

Pretty ugly, right? Let's see if we can't make it more readable.

Read more…