Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

json schema to objective c - model classes generation

Hi stack overflow people

i am writing an iphone app thats connects to a web service, through REST with JSON. I would like to generate my model classes in objective c from a json schema provided by my web service, a bit like i d do with wsdl2objc with asoap, xml and wsdl combination.

It looks like there s not much out there on this subject

i tried something called jsonschema2objc.rb from http://code.google.com/p/bkjsonschema/ but it s giving me errors even on the simplest json schema, the one found here: http://en.wikipedia.org/wiki/JSON#Schema

i get this error:
Using temporary file /var/folders/rN/rNw33pkyHVeNG+-IesdU+k+++TI/-Tmp-/jsonschema2objc.8WRkBSQo !!! Object definition at index Product has unknown type

so here are my 2 questions:

  • do you guys know any good tool to acheive jsonchema => objective c classes ?
  • do you know what this error means in my ./jsonschema2objc.rb

Thx!

like image 924
goane Avatar asked Mar 13 '11 05:03

goane


1 Answers

There was a very nice tool in the Mac Appstore called JSONModeler (now it's discontinued) but the same guys make the JSON Accelerator which is an evolution of the same program. It's really good (and cheap) and it generates Objective-C, Java and Python code (the JSONModeler also supported Coredata classes and schema, I don't know if they still support it in the new one though).

like image 146
Alladinian Avatar answered Nov 07 '22 14:11

Alladinian