Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Regarding schemas - there is JSON Schema:

http://json-schema.org/

http://tools.ietf.org/html/draft-zyp-json-schema-02

We've been using this pretty extensively at work. The Java guys wrote something to generate their model from it and on the JavaScript side we've used it to do all kinds of nice things like automagically generating forms that validate according to the schema and verifying that the data we receive from the backend conforms to it in our tests.

From what I can gather very few people are using it. It's not exactly fun to write but a co-worker of mine wrote a dsl to make that less painful.

Of course when you write JavaScript, it's a joy to work with.

On the transformation side there are a few ideas floating, notably JSON-T

http://goessner.net/articles/jsont/

Neither of these things are as mature as XSD and XSLT, but if you love JSON and JavaScript, they're definitely worth investigating.



Using a schema to frontend/backend form validation sounds totally awesome from a "don't repeat yourself" perspective.

If that code becomes worthy of public release, I'd bet it could dramatically raise the profile of JSON Schema.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: