phenopackets / phenopacket-validator

Library and tools to help validate phenopackets
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

JSON Schema validation #6

Closed pnrobinson closed 3 years ago

pnrobinson commented 3 years ago

@julesjacobsen -- please have a look at the new develop branch, and especially JsonSchemaValidatorTest. I think it is truly this easy. I had some difficulty finding good libraries for this, jackson itself does not seem to offer this functionality. I used this as a reference https://www.mscharhag.com/java/json-schema-validation

If we like this then the todo's are

  1. general setup to take any phenopacket object (protobuf, yaml) and turn it into a JSONObject
  2. improve API, for instance, maybe we want to have multiple additional schemas
  3. Finish up the schema for the general (base case) phenopacket based on the cardinalities in the schema
  4. create a handful of examples
pnrobinson commented 3 years ago

implemented with https://github.com/phenopackets/phenopacket-validator/pull/7