{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1
    },
    "summary": {
      "type": "string"
    },
    "sections": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "heading": {
            "type": "string"
          },
          "paragraphs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "bullets": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_.:-]{1,64}$"
          },
          "meta": {
            "type": "object",
            "properties": {
              "created_at": {
                "type": ["string", "null"]
              },
              "updated_at": {
                "type": ["string", "null"]
              },
              "deleted_at": {
                "type": ["string", "null"]
              },
              "legacy_ref": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "table": {
                        "type": "string"
                      },
                      "key": {
                        "type": ["string", "number"]
                      },
                      "row": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": ["table", "key", "row"],
                    "additionalProperties": false
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "dataset": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        },
        "required": ["heading", "bullets", "id"],
        "additionalProperties": false
      }
    },
    "key_points": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "links": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "entities": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "guessed_kind": {
      "type": ["string", "null"]
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "meta": {
      "type": "object",
      "properties": {
        "created_at": {
          "type": ["string", "null"]
        },
        "updated_at": {
          "type": ["string", "null"]
        },
        "deleted_at": {
          "type": ["string", "null"]
        },
        "legacy_ref": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "table": {
                  "type": "string"
                },
                "key": {
                  "type": ["string", "number"]
                },
                "row": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": ["table", "key", "row"],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "dataset": {
          "type": "string"
        }
      },
      "additionalProperties": false
    }
  },
  "required": ["title", "summary", "sections", "links", "entities", "guessed_kind", "tags"],
  "additionalProperties": false,
  "$id": "https://sendtopigeon.com/schemas/note@1.schema.json",
  "title": "Pigeon Open Data: note@1",
  "$comment": "Apache-2.0. Structural schema; use Zod/parseRecord for semantic invariants. This published schema URL is immutable.",
  "examples": [
    {
      "title": "demo",
      "summary": "demo",
      "sections": [],
      "links": [],
      "entities": [],
      "guessed_kind": null,
      "tags": []
    }
  ]
}
