after applying this patch the error messages look quite a bit more plausible.
--- a/seqspec/seqspec_check.py
+++ b/seqspec/seqspec_check.py
@@ -39,9 +39,8 @@ def validate_check_args(parser, args):
def run_check(schema, spec):
-
v = Draft4Validator(schema)
- for idx, error in enumerate(v.iter_errors(spec), 1):
+ for idx, error in enumerate(v.iter_errors(spec.to_dict()), 1):
print(
f"[error {idx}] {error.message} in spec[{']['.join(repr(index) for index in error.path)}]"
)
Now lists many more errors.
Though also maybe some of the attributes could be optional?
As a guess order might be a good candidate for either being optional, having validation code added, or having the order of elements in the list shuffled to match the order. (I bet the Stanford DACC might be able to help with the jsonschema)
[error 1] 'order' is a required property in spec['assay_spec'][0]['regions'][0]
[error 2] 'order' is a required property in spec['assay_spec'][0]['regions'][1]
[error 3] None is not of type 'string' in spec['assay_spec'][0]['regions'][2]['onlist']['md5']
[error 4] 'order' is a required property in spec['assay_spec'][0]['regions'][2]
[error 5] None is not of type 'string' in spec['assay_spec'][0]['regions'][3]['onlist']['md5']
[error 6] 'order' is a required property in spec['assay_spec'][0]['regions'][3]
[error 7] 'order' is a required property in spec['assay_spec'][0]['regions'][4]
[error 8] None is not of type 'string' in spec['assay_spec'][0]['regions'][5]['onlist']['md5']
[error 9] 'order' is a required property in spec['assay_spec'][0]['regions'][5]
[error 10] 'order' is a required property in spec['assay_spec'][0]['regions'][6]
[error 11] None is not of type 'string' in spec['assay_spec'][0]['regions'][7]['onlist']['md5']
[error 12] 'order' is a required property in spec['assay_spec'][0]['regions'][7]
[error 13] 'order' is a required property in spec['assay_spec'][0]['regions'][8]
[error 14] 'order' is a required property in spec['assay_spec'][0]['regions'][9]
[error 15] 'order' is a required property in spec['assay_spec'][0]['regions'][10]
[error 16] 'order' is a required property in spec['assay_spec'][0]['regions'][11]
[error 17] None is not of type 'string' in spec['assay_spec'][0]['regions'][12]['onlist']['md5']
[error 18] 'order' is a required property in spec['assay_spec'][0]['regions'][12]
[error 19] 'order' is a required property in spec['assay_spec'][0]['regions'][13]
[error 20] 'order' is a required property in spec['assay_spec'][0]
When running seqspec check
The result is:
after applying this patch the error messages look quite a bit more plausible.
Now lists many more errors.
Though also maybe some of the attributes could be optional?
As a guess order might be a good candidate for either being optional, having validation code added, or having the order of elements in the list shuffled to match the order. (I bet the Stanford DACC might be able to help with the jsonschema)