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-additions #7

Closed pnrobinson closed 3 years ago

pnrobinson commented 3 years ago

@julesjacobsen I have fleshed out the JSON Schema a bit. The JSON Schema validation library does not seem to be working as desired. For instance, I have added this

phenotypicFeaturesMALFORMED

to src/test/resources/json/bethlehamMyopathyInvalidExample.json but the validator does not recognize this as wrong and this this test method fails (testRareDiseaseBethlemahmInvalidValidPhenopacket).

pnrobinson commented 3 years ago

@julesjacobsen I figured it out. You need to add

 "additionalProperties": false,

This now leads to --

$.phenotypicFeaturesMALFORMED: is not defined in the schema and the schema does not allow additional properties

So in general, I think this approach might work :-0

pnrobinson commented 3 years ago

@julesjacobsen @ielis The app is working now with a generic JSON schema as well as one for Rare Disease. I would like tot merge everything through to naster since the current master does not actually do anything. There is a Sping CLI in the CLI module that can be used to try things out. I am going to use phepagen to create lots of phenopacket files for testing and will introduce various errors. I do not know of any better way of realistic testing, but if you do, please shout. If I do not hear anything, I will merge tomorrow!