{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/crevio-co/json-schema/crevio-co-chapter-schema.json",
  "title": "Chapter",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/crevio-co-chapters-api-openapi.yml#/components/schemas/Chapter",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "object": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "position": {
      "type": "integer"
    },
    "lessons": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Lesson"
      }
    }
  },
  "required": [
    "id",
    "object",
    "title",
    "position",
    "lessons"
  ],
  "$defs": {
    "Lesson": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "object": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "position": {
          "type": "integer"
        },
        "lesson_type": {
          "type": "string"
        },
        "published": {
          "type": "boolean"
        },
        "published_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "html_content": {
          "type": [
            "string",
            "null"
          ]
        },
        "chapter": {
          "type": "string"
        },
        "video_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "files": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "filename": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "content_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "byte_size": {
                "type": "integer"
              },
              "url": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "filename",
              "byte_size",
              "url"
            ]
          }
        }
      },
      "required": [
        "id",
        "object",
        "title",
        "position",
        "lesson_type",
        "published",
        "published_at",
        "html_content",
        "chapter",
        "video_url",
        "files"
      ]
    }
  }
}