Up until this week, I thought I knew enough about tying shoelaces and JSON. Turns out that for both, I fell short.
First to the tying of shoelaces. You would have thought that I should have been a pro by now since I have done it from childhood and you may be laughing at me but before you do that, check out this very informative video from a talk from TED 2005 Terry Moore: How to tie your shoes.
So to the techy stuff.
I got introduced to JSON at the beginning of last summer as I worked on creating a JSON RPC adapter for NexJ Express.
At the moment I am also involved in building a JSON Integration Adapter, and as part of the design phase we had to figure out what vaild JSON was.
To my astonishment, I found out that Javascript “primitives”, that is String, Number and Boolean are not valid JSON. My misunderstanding of this was from missing reading the railway diagrams on json.org, I just thought that every thing that was a valid value, was also valid JSON.
So how did I know I was wrong, my colleague Brian, showed me the RFC for JSON, and right there it says
A JSON text is a serialized object or array.
JSON-text = object / array
I also asked another colleague, Dave, who works a lot with Javascript and he started off by saying basically the same thing, JSON is “Object Notation”.
So what does this mean for me? Well, I have authored some web services which serve what I thought was “JSON”, so I may have to go back and fix them.
The lesson learned, read RFCs’