| « Javascript Interpreter | Twitter Page Code » |
Python Onsen
This weekend I went to the Python Onsen (Japanese) organized by voluntas. Python Onsen is an event where people who like or are interested in python get together at a Japanese Ryokan/Onsen and program/mingle/study together. The event started Friday but I had to work so I joined everyone yesterday. If you aren't famaliar with the Ryokan experience check out the Ryokan link. Essentially you have a traditional style room and traditional meals are served twice a day (with generous proportions).
In between meals there was a lot of programming and talk about programming. I was recieved pretty well considering that I was the only non-Japanese in the group of 28 or so people. I spent the time here working on a form maker project for google app engine which will be using JSON quite a bit for server communication and API interfaces. It is programmed on the client side using the google web toolkit and it during the course of development it became clear that there would be a need for a way to validate incoming JSON on the client and server (for error checking and security) as well as making the interface easier to deal with. Currently the typing of the JSON data makes dealing with it in Java a real pain.
We realized this could be done with a schema, kind of like XML Schema. Something that could be used as a way to define the structure of the JSON and thus allow programs to validate it. So after searching a bit we found the JSON Schema proposal. JSON schema is maintained in JSON and can be maintained inline so if it is, it doesn't solve any security issues, but it looks like a good way to validate and do error checking on JSON data that might be coming from an external (or internal) source. So one programmer whipped up a simple validator in python which I will hopefully be working on and using on the server side of my application while I'll be going ahead and creating a clent side schema and JSON parsing library over top of, or separate from, the existing JSON library for the google web toolkit.
Pretty good for a two day hackathon.
2 comments
Would it be possible to have a quick look at the JSON Schema validation implementation?
Thanks,
Well, it's far from complete and was done in only about an hour. It was also implemented as a Google appengine test application. But you can look at the code at http://hg.monologista.jp/json-schema
I have my own repo of the code (I don't have commit access at monologista.jp yet) which I have worked on a little bit more and which I plan on making into a python library. It is located at http://www.ianlewis.org/hg/json-schema
My code is also far from complete but I'll likely be working on it a good amount in the coming weeks.
I haven't started on any Java Google Web Toolkit implementation yet.
