{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sweetvaluelab-com/json-schema/sweetvaluelab-com-post-document-schema.json",
  "title": "PostDocument",
  "description": "A post as one Markdown document. The frontmatter keys are `title`, `description`, `date` (required) and `updated`, `tags`, `stocks`, `hero`, `heroAlt`, `share` (optional); any other key is an error, and `author` is ignored because the byline is the credential. See https://sweetvaluelab.com/write-for-us.md for every limit.",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sweetvaluelab-com-openapi.json#/components/schemas/PostDocument",
  "type": "object",
  "required": [
    "markdown"
  ],
  "properties": {
    "markdown": {
      "type": "string",
      "description": "The whole post: a `---` frontmatter block, then the body. At most 100 kB."
    },
    "lang": {
      "type": "string",
      "enum": [
        "en",
        "zh"
      ],
      "description": "Optional, and normally left out: the edition is detected from the text on every save (Chinese when Han characters outnumber 1.5 × the Latin words, otherwise English), and an editor corrects a wrong guess in review. Send it only to override the detection."
    },
    "slug": {
      "type": "string",
      "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$",
      "description": "The URL's last segment. Derived from the title when omitted."
    }
  }
}