Loading ...
Sorry, an error occurred while loading the content.

JSON schema

Expand Messages
  • Rob Lanphier
    Hi all, Below is a note that I originally sent to the json-php list, but realize probably has broader applicability. In the past week, I released my JSON-based
    Message 1 of 1 , Nov 2, 2005
    • 0 Attachment
      Hi all,

      Below is a note that I originally sent to the json-php list, but realize
      probably has broader applicability.

      In the past week, I released my JSON-based project:
      http://electorama.com/electowidget

      It's a PHP library for adding rated balloting to CMS systems, starting
      with MediaWiki, with a BSD license.

      JSON is used as pretty much the sole storage format. In some places,
      I'm using it a bit like wiki markup for structured data.

      One thing I'm starting to explore now is the role that a well-defined
      schema could play. I haven't seen any work on this so far, but I saw
      that someone was working on a YAML schema, and I borrowed liberally from
      that:
      http://www.kuwata-lab.com/kwalify/

      Here's the schema for my election configuration markup:
      http://wiki.electorama.com/wiki/Election_Config_Schema

      ...which I used to generate this documentation:
      http://wiki.electorama.com/wiki/Electowidget_Configuration_Reference

      The nice part is that I didn't write the schema from scratch. Rather, I
      quickly hacked up a tool that took one of my election configuration
      samples, and wrote a tool to derive a schema from that. It wasn't
      perfect, but it beat writing the schema from scratch.

      Now that I have a schema, here's the areas I'd like to explore:

      * An optional validation step in the JSON parser.
      * A JavaScript JSON file edit interface which is automatically
      generated from the schema file.
      * Cleaning up and releasing the code I've already got:
      ** Generating a schema from a sample file
      ** Generating documentation from a schema

      Is there interest on this list in exploring these ideas? Which ones
      first?

      Rob
    Your message has been successfully submitted and would be delivered to recipients shortly.