{
 "openapi": "3.1.0",
 "info": {
  "title": "トゥーンエル API",
  "version": "1.0.0",
  "description": "トゥーンエル（toonERU）の縦読み漫画の作品・話・本文を読むだけの API。認証なし。仕事と暮らしの現場を描く縦読み漫画。読んで、得る。"
 },
 "externalDocs": {
  "description": "AI・開発者の方へ（つなぎ方と使ってよいこと）",
  "url": "https://tooneru.com/developers/"
 },
 "servers": [
  {
   "url": "https://tooneru.com"
  }
 ],
 "paths": {
  "/api/search": {
   "get": {
    "operationId": "searchWorks",
    "summary": "作品と話を言葉で探す",
    "description": "題名・あらすじ・登場人物・用語から作品と話を探す。query が空なら全作品。",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "探す言葉（例：検索順位、タイムゾーン）"
     },
     {
      "name": "genre",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "ジャンルの id か名前（isekai＝異世界転生・fantasy＝現代ファンタジー・drama＝ヒューマンドラマ・mystery＝ミステリー・comedy＝コメディ・seishun＝青春・money＝お金と手続き・it＝AI と IT）"
     }
    ],
    "responses": {
     "200": {
      "description": "見つかった作品と話",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     }
    }
   }
  },
  "/api/series/{id}": {
   "get": {
    "operationId": "getSeries",
    "summary": "作品の説明と公開中の話の一覧",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "作品の id（例：kengai）"
     }
    ],
    "responses": {
     "200": {
      "description": "作品",
      "content": {
       "application/json": {
        "schema": {
         "type": "object"
        }
       }
      }
     },
     "404": {
      "description": "無い作品"
     }
    }
   }
  },
  "/api/episodes/{series}/{n}": {
   "get": {
    "operationId": "getEpisode",
    "summary": "話の本文（Markdown）とコンテキストセット",
    "parameters": [
     {
      "name": "series",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "作品の id"
     },
     {
      "name": "n",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "話の番号（1から）"
     }
    ],
    "responses": {
     "200": {
      "description": "話",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "series_id": {
           "type": "string"
          },
          "number": {
           "type": "integer"
          },
          "title": {
           "type": "string"
          },
          "url": {
           "type": "string"
          },
          "datePublished": {
           "type": "string"
          },
          "dateModified": {
           "type": "string",
           "description": "話の最終更新の日（YYYY-MM-DD。中身を直した日。直していなければ公開日）"
          },
          "description": {
           "type": "string"
          },
          "summary": {
           "type": "string"
          },
          "markdown": {
           "type": "string",
           "description": "本文の Markdown（話者付きの台詞・ナレーション・作中の画面・絵の説明）"
          },
          "context": {
           "type": "string",
           "description": "コンテキストセット（AI に貼って続きを相談する短いまとめ）"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "無い話（公開前を含む）"
     }
    }
   }
  }
 }
}