Models and Collections based on JSON Schema / HAL+JSON ?

219 views
Skip to first unread message

Joshua Randall

unread,
May 1, 2013, 1:42:26 PM5/1/13
to chapl...@googlegroups.com
I've started to build a web app using chaplin.js to interface with our internal RESTful APIs, and I'm wondering if anyone out there has experience and/or could point me to any existing code in which whole hierarchies of chaplin models and collections can be configured to be populated from a remote REST API that uses either an HAL+JSON or JSON Hyper-Schema media type (thereby supporting HATEOAS semantics via links) and with a schema defined in JSON Schema? 

I know there is some experimental HAL+JSON support in backbone.js (https://github.com/mikekelly/backbone.hal) but I'm not sure how well that will play with chaplin's extensions to model and collection (I haven't tried it yet).  I haven't found anything in javascript that works with JSON Hyper-Schema yet. I have seen abaaso (http://abaaso.com/) but using that would mean giving up on backbone and chaplin and moving to a completely different (and monolithic) framework, which I don't like as I really like both backbone and chaplin's organisation/use of it. 

However, in my current prototype code I find myself manually transcoding model definitions from the API schema into chaplin, which feels wrong (in a not-very-DRY way), and at present I've been ignoring the validation and forms capabilities entirely.

I'm just wondering, before I start diving into this, whether this is something that anyone has experience with, either with chaplin or with other frameworks who could give some advice or point me in the right direction. 

Thanks!

Josh.

Reply all
Reply to author
Forward
0 new messages