-
Notifications
You must be signed in to change notification settings - Fork 3
Explore code generation options #1
Comments
http://jsonmodels.readthedocs.org/en/latest/readme.html allows you to go from an OM to JSONSchema - but not vice versa. from 2012: warlock or this: https://github.com/cwacek/python-jsonschema-objects |
I have two experimental branches towards this effort:
Jsonschema validates the omim and variant example, accurately fails on the journal example since we're using "human" instead of "patient." However, the patient example fails due to: KeyError: 'urn:jsonschema:org:monarchinitiative:ppk:model:condition:TemporalRegion' I assume this has to do with the lines Similarly, python-jsonschema-objects fails when loading the schema: I'm not familiar with JSONschema enough to know if the use of $ref and referring to an object within the schema is legal and this is a bug in these packages, or if we're using this incorrectly. Update: this is fixed by changing $ref to id, or we could alternatively follow this pattern of internal referencing. |
I've changed $ref to id in the schema for the sake of testing (on my branch). python-jsonschema-objects works reasonably well for both validation and mapping json to python objects and serializing back to json. See latest commit |
Bindings can be made automatically based on schema def, depends on this ticket:
phenopackets/phenopacket-format#31
The text was updated successfully, but these errors were encountered: