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

110JSON schema

Expand Messages
  • Rob Lanphier
    Nov 2 7:11 PM
      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:

      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

      Here's the schema for my election configuration markup:

      ...which I used to generate this documentation:

      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