This repo contains the JSON schemas for the IPFS Pinning Consortium metadata
npm install ipfsconsortiumdata
const ipfsconsortiumdata = require('ipfsconsortiumdata');
const s = JSON.parse(<your JSON string>);
ipfsconsortiumdata.validate(s)
.then(() => {
// file is valid
})
.catch((e) => {
// file is invalid - e contains the validation errors
});
When installing this module you will get a command line utility ipfsconsortiumvalidate
to validate a JSON file.
ipfsconsortiumvalidate examples/metadata-consortium.json
This will exit with 0 if the file is valid - 1 if the file is invalid and will print the validation errors on stdout.
The schema's are located in spec
Examples can be found in examples