Sunday, October 11, 2009

Fresh new hope for JSON Schema: "Orderly" improvements afoot!

Here's something interesting related to on-going (if slowly moving) JSON Schema effort: Orderly micro-language. Orderly just might be that something that makes JSON Schema usable. There are other things that could do that, too, like good tool support; but more convenient syntax seems like the shortest route to improved usability: a custom-built DSL that does NOT (have to) use the target syntax as its own syntax. What a great idea! (not a novel one; RelaxNG compact syntax has been around for a while, and that wasn't new -- no matter, good ideas are good ideas)

As the web site says: "Orderly... is an ergonomic micro-language that can round-trip to JSONSchema ... ... optional. syntactic sugar, fluff. Tools should speak JSONSchema, but for areas where humans have to read or write the schema there should be an option to expose orderly in addition to JSON". Sounds good, I like that.

We shall see if and how this works out. My personal interest is more in the area of type definition language -- for me validation is actually not all that interesting; mostly because I believe it can be done quite well at (Java) object level (see Bean Validation API). So much so that even XML Schema is used much more as type definition language for data binding (as THE Object/XML type system for things like Soap, JAXB) than for actual XML validation, although original focus has squarely on handling validation aspects. Futher indirect proof is that its main competitor, RelaxNG, which is superior alternative for validation, isn't nearly as popular overall -- it would totally squash Schema if validation was the dominant use case for XML schema languages; but RelaxNG is not very useful for data binding, alas (because it allows ambiguity in grammar, acceptable for validation, but problematic when trying to do type inference and matching).

But I digress. I think that a prettified DSL that translates to/from JSON Schema could handle type system aspects just as well JSON Schema would; which is to say, "possibly well enough to be useful". Although JSON Schema as is has some nasty flaws in this area (only single type per schema? you kidding me, right? All references via static URLs? Really?), maybe it can all work out in the end with some spit and polish. Jury is still out.

blog comments powered by Disqus

Sponsored By


Related Blogs

(by Author (topics))

Powered By

About me

  • I am known as Cowtowncoder
  • Contact me at@yahoo.com
Check my profile to learn more.