Skip to content

JSON Schemas

These are the canonical, resolvable JSON Schema documents for the SDI wire contract, version 1.0. They are served as static files under https://sdi.admissio.app/schemas/, and each schema’s $id is its own URL, so a validator can dereference them directly (the envelope’s $ref resolves to the document descriptor here). They are JSON Schema Draft 2020-12 and match Appendix B of the Standard.

Compile them with any Draft 2020-12 validator. With Ajv, register the descriptor so the envelope’s $ref resolves:

import Ajv2020 from "ajv/dist/2020"
import addFormats from "ajv-formats"
const envelope = await fetch("https://sdi.admissio.app/schemas/1.0/envelope.json").then((r) => r.json())
const descriptor = await fetch("https://sdi.admissio.app/schemas/1.0/document-descriptor.json").then((r) => r.json())
const ajv = addFormats(new Ajv2020())
ajv.addSchema(descriptor) // satisfies the envelope's $ref by its $id
const validateEnvelope = ajv.compile(envelope)