Validation and compat levels
The ladder
Section titled “The ladder”| Level | The site does | The site gets |
|---|---|---|
| 0 | nothing | whatever a recipe or a heuristic could read |
| 1 | marks up its existing listing with data-wall-* attributes | an exact wall that survives redesigns, with no recipe |
| 2 | serves a JSON feed, and optionally a manifest | cursor paging, search, filters, image variants, actions, brand |
| 3 | embeds the wall itself | its own route, its own analytics, and no injection by extensions |
A site can offer several levels. A program uses the highest one it finds.
How a program detects the level
Section titled “How a program detects the level”A program checks in this order and stops at the first match:
window.__diazomais present: Level 3. A checker that does not run scripts looks for a<script>with adata-manifestattribute or asrcending inwall.iife.js.<link rel="wall-manifest">in the page, or a manifest at/.well-known/wall.json: Level 2. The well-known path is checked even when there is no<link>.<link rel="wall-feed">without a manifest: Level 2 without a manifest.[data-wall-item]in the page: Level 1.- A recipe for the origin: Level 0.
- Heuristics: Level 0.
The validator
Section titled “The validator”diazoma-spec validate https://example.comdiazoma-spec validate https://example.com --jsonThe validator (the @diazoma/spec package) does this:
- detects the level in the order above;
- validates the manifest and one page of each non-search feed against the schemas;
- requests one image from each
media.hostshost with anOriginheader, and requiresAccess-Control-Allow-Originto be*or that origin; - checks that
brand.accenthas a contrast of at least 4.5:1 against white; - prints
policy; - prints the ladder with pass or fail per level and per check.
The exit code is 0 when the highest detected level passes, 1 when it fails or nothing is detected, and 2 on bad usage.
Validate a file yourself
Section titled “Validate a file yourself”The schemas are served at their $id URLs, so any JSON Schema 2020-12 validator can use them:
For recipes there is also diazoma-recipe run. See Recipes.