cul-it/cular-metadata

Generate JSON schema for new manifest format

Closed this issue · 2 comments

We should explore creation of a JSON schema for the new manifest format

First stab at: https://github.com/cul-it/cular-metadata/blob/master/new_manifest_proposal_schema.json . Not very strict but does accept the example:

> jsonschema -i new_manifest_proposal.json new_manifest_proposal_schema.json 
>

Have split for ingest and storage since the requirements are now different:

new_manifest_proposal_ingest.json
new_manifest_proposal_schema_ingest.json

new_manifest_proposal_storage.json
new_manifest_proposal_schema_storage.json

and

> jsonschema -i new_manifest_proposal_ingest.json new_manifest_proposal_schema_ingest.json 
> jsonschema -i new_manifest_proposal_storage.json new_manifest_proposal_schema_storage.json 

but if one tries to validate the storage manifest with the ingest schema:

> jsonschema -i new_manifest_proposal_storage.json new_manifest_proposal_schema_ingest.json 
{u'files': [{u'size': 12, u'sha1': u'058bbd836dfc8e22d57d5dc8c048f15d8aed7dc4', u'md5': u'61a6104561744087fe62e7878948d9b7', u'filepath': u'a_file'}, {u'size': 68, u'sha1': u'2c789aee68c6803b0a45f1627a368a0af9785223', u'md5': u'5f859ade8cffd1a94543f4f660ab1b99', u'filepath': u'foo/bar.xml'}], u'package_id': u'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', u'number_files': 2, u'bibid': u'123456', u'rmcmediano': u'6789'}: u'source_path' is a required property