Skip to main content

Manifest schema

The FlipCard manifest is a JSON Schema (draft‑07) document published at:

https://microsoft.github.io/flipcard/schema/v0.1.json

Reference it from any manifest via $schema to get editor completion and validation:

{ "$schema": "https://microsoft.github.io/flipcard/schema/v0.1.json", ... }

Schema (draft‑07)

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://microsoft.github.io/flipcard/schema/v0.1.json",
"title": "FlipCardManifest",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": { "type": "string", "format": "uri" },
"version": { "type": "string" },
"id": { "type": "string" },
"title": { "type": "string" },
"design": {},
"schema": {},
"workflow": {
"type": "object",
"properties": {
"onFlip": { "type": "string" },
"actions": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "type"],
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"data": {}
}
}
}
}
},
"metadata": { "type": "object", "additionalProperties": true }
}
}

You can also fetch the same object at runtime:

import { flipCardManifestSchema, FLIPCARD_SCHEMA_URL } from '@microsoft/flipcard-core';

Field semantics

FieldTypeNotes
$schemastring (uri)Should always point at the published schema URL.
versionstringManifest semver. Bump when the shape changes meaningfully.
idstringStable identifier. Recommend kebab‑case.
titlestringHuman‑readable label, typically used on the back face.
designunknownOpaque to the core; the renderer interprets it. The conventional shape is { category, front: { title, summary, ... } }.
schemaunknownStructured payload exposed on the back face. The conventional shape is { back: { title, fields: [] } }.
workflowobjectOptional. onFlip is an event name; actions[] are declarative descriptors.
workflow.actions[]objectEach requires id and type; data is free‑form.
metadataRecord<string, unknown>Free‑form. Use it for ownership, build IDs, telemetry IDs, etc.

Runtime validator

validateManifest from @microsoft/flipcard-core provides a quick, dependency‑free shape check:

import { validateManifest } from '@microsoft/flipcard-core';

validateManifest({ id: 'x', title: 'Hello' });
// → { valid: true, errors: [] }

validateManifest({ id: 5 });
// → { valid: false, errors: ['id must be a string'] }

Use Ajv against flipCardManifestSchema for full draft‑07 validation in build pipelines.