jazzband / jsonmodels

jsonmodels is library to make it easier for you to deal with structures that are converted to, or read from JSON.
http://jsonmodels.readthedocs.org/en/latest/
BSD 3-Clause "New" or "Revised" License
334 stars 51 forks source link

Add the ability to import json schema #41

Closed hgenru closed 5 years ago

hgenru commented 9 years ago

It would be great to be able to import the existing models in the format json scheme

beregond commented 9 years ago

@hgenru - well, you can, just use method to_json_schema - http://jsonmodels.readthedocs.org/en/latest/usage.html#creating-json-schema-for-your-model

hgenru commented 9 years ago

@beregond oh, sorry, i'm talking about import json schema. Like this script https://github.com/cwacek/python-jsonschema-objects

beregond commented 9 years ago

@hgenru - well, it was main purpose to create jsonmodels - to NOT deal with json schema itself :) the thing is that even if json schema is great tool (I think so), models in form of python objects are much more readable than json schema. Goal of this project is to generate json schema from models, not otherwise.

Anyway I understand your point. If all you need is to generate models at runtime, then you should use project you've mentioned, but if you want to generate python source from json schema - well, I was thinking about something like this, yet it is hard task, so don't expect such feature too quick (lack of time for that). Anyway thanks for feedback :)