Generate class definitions as file from JSON schema
trietsch opened this issue · 3 comments
What are you trying to do?
We're looking for a way to store the class definition of a JSON schema that is generated using python-jsonschema-objects
.
Do you have an idea about how this should work?
Provide a schema file path to the build_classes()
method, let it generate the classes, after which you could provide a file path to store it.
Note: there are other libraries that do support this, but they're not as actively maintained by this library. I'm not sure that this library would have this as a goal, however.
Thanks for the quick response! Regarding the issues that you address:
(a) that is correct indeed. In my case, I only care about usability of the classes, the looks are of less importance
(b) validating generated Python classes might be something that Pydantic seems to be able to do. On the other hand, there's an implementation in Python that generates (pydantic based) classes using JSON schema. Can be found here. So that's also why I pointed out in my OP that I'm not really sure whether this functionality would fit in this library.
I'm happy to look at a PR implementing this proposed change, but I won't be looking at it directly so I'm going to close this.