{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "lineRange": {
      "description": "An inclusive range of 1-based line numbers.",
      "properties": {
        "end": {
          "minimum": 1,
          "type": "integer"
        },
        "start": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "type": "object"
    },
    "main": {
      "description": "A single block of code with its metadata. Commentary lives in the Bluesky post that embeds the record.",
      "key": "tid",
      "record": {
        "properties": {
          "code": {
            "description": "The code, verbatim.",
            "maxLength": 50000,
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "filename": {
            "maxLength": 256,
            "type": "string"
          },
          "highlight": {
            "description": "Line ranges to emphasize.",
            "items": {
              "ref": "#lineRange",
              "type": "ref"
            },
            "maxLength": 64,
            "type": "array"
          },
          "lang": {
            "description": "Language identifier used for highlighting, for example rust or diff.",
            "maxLength": 64,
            "minLength": 1,
            "type": "string"
          },
          "title": {
            "maxGraphemes": 100,
            "maxLength": 1000,
            "type": "string"
          }
        },
        "required": [
          "code",
          "lang",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "app.hemel.snippet",
  "lexicon": 1
}
