Een JSON Schema per collectie, als schemas/<collectie>.schema.json. Elk document in data/<collectie>/ moet eraan voldoen. Een collectie zonder schema kan ook; dan controleren we alleen of het geldige JSON is (de check meldt dat als waarschuwing).
title en description van het schema zijn de naam en de uitleg van de collectie op de site en in index.json. Zonder $schema gebruiken we JSON Schema 2020-12.
Een voorbeeld, voor schemas/recepten.schema.json:
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Recepten",
"description": "Recepten om in Mealie te importeren.",
"type": "array",
"items": {
"type": "object",
"required": ["naam", "url"],
"properties": {
"naam": { "type": "string", "minLength": 1 },
"url": { "type": "string", "pattern": "^https://" },
"porties": { "type": "integer", "minimum": 1 }
},
"additionalProperties": false
}
}
Een nieuw schema of een strenger schema gaat in een pull request, net als gegevens. Bestaande documenten die er niet aan voldoen, laten de check falen: pas ze in dezelfde pull request aan.
One JSON Schema per collection, as schemas/<collection>.schema.json; every document in data/<collection>/ must match it. Its title and description name the collection on the site and in index.json. Without $schema, JSON Schema 2020-12 is used. See README.en.md.