From d81ba0f470417737a8c24412936d334dbd116fab Mon Sep 17 00:00:00 2001 From: tarepan Date: Sat, 23 Mar 2024 03:20:24 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3:=20API=20=E9=96=A2=E6=95=B0?= =?UTF-8?q?=20docstring=20=E3=82=92=20FastAPI=20=E5=9E=8B=E3=81=AB?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=20(#1123)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: API関数docstringをFastAPI型に変更 * fix: schema スナップショット * refactor: 引数 docstring の FastAPI型化 * refactor: API 返り値 docstring の path op 引数化 * refactor: lint * fix: FastAPI Query-Path 取り違え * fix: OpenAPI schema 更新 --- run.py | 220 ++++++++---------- ...\343\202\222\347\242\272\350\252\215.json" | 103 ++++++-- 2 files changed, 171 insertions(+), 152 deletions(-) diff --git a/run.py b/run.py index 9f652af34..b719b774f 100644 --- a/run.py +++ b/run.py @@ -17,7 +17,9 @@ import soundfile import uvicorn -from fastapi import Depends, FastAPI, Form, HTTPException, Query, Request, Response +from fastapi import Body, Depends, FastAPI, Form, HTTPException +from fastapi import Path as FAPath +from fastapi import Query, Request, Response from fastapi.middleware.cors import CORSMiddleware from fastapi.openapi.utils import get_openapi from fastapi.responses import JSONResponse @@ -749,15 +751,15 @@ def connect_waves(waves: list[str]) -> FileResponse: background=BackgroundTask(delete_file, f.name), ) - @app.get("/presets", response_model=list[Preset], tags=["その他"]) + @app.get( + "/presets", + response_model=list[Preset], + response_description="プリセットのリスト", + tags=["その他"], + ) def get_presets() -> list[Preset]: """ エンジンが保持しているプリセットの設定を返します - - Returns - ------- - presets: list[Preset] - プリセットのリスト """ try: presets = preset_manager.load_presets() @@ -768,23 +770,20 @@ def get_presets() -> list[Preset]: @app.post( "/add_preset", response_model=int, + response_description="追加したプリセットのプリセットID", tags=["その他"], dependencies=[Depends(check_disabled_mutable_api)], ) - def add_preset(preset: Preset) -> int: + def add_preset( + preset: Annotated[ + Preset, + Body( + description="新しいプリセット。プリセットIDが既存のものと重複している場合は、新規のプリセットIDが採番されます。" + ), + ] + ) -> int: """ 新しいプリセットを追加します - - Parameters - ------- - preset: Preset - 新しいプリセット。 - プリセットIDが既存のものと重複している場合は、新規のプリセットIDが採番されます。 - - Returns - ------- - id: int - 追加したプリセットのプリセットID """ try: id = preset_manager.add_preset(preset) @@ -795,23 +794,20 @@ def add_preset(preset: Preset) -> int: @app.post( "/update_preset", response_model=int, + response_description="更新したプリセットのプリセットID", tags=["その他"], dependencies=[Depends(check_disabled_mutable_api)], ) - def update_preset(preset: Preset) -> int: + def update_preset( + preset: Annotated[ + Preset, + Body( + description="更新するプリセット。プリセットIDが更新対象と一致している必要があります。" + ), + ] + ) -> int: """ 既存のプリセットを更新します - - Parameters - ------- - preset: Preset - 更新するプリセット。 - プリセットIDが更新対象と一致している必要があります。 - - Returns - ------- - id: int - 更新したプリセットのプリセットID """ try: id = preset_manager.update_preset(preset) @@ -825,15 +821,11 @@ def update_preset(preset: Preset) -> int: tags=["その他"], dependencies=[Depends(check_disabled_mutable_api)], ) - def delete_preset(id: int) -> Response: + def delete_preset( + id: Annotated[int, Query(description="削除するプリセットのプリセットID")] + ) -> Response: """ 既存のプリセットを削除します - - Parameters - ------- - id: int - 削除するプリセットのプリセットID - """ try: preset_manager.delete_preset(id) @@ -996,15 +988,12 @@ def singer_info( @app.get( "/downloadable_libraries", response_model=list[DownloadableLibraryInfo], + response_description="ダウンロード可能な音声ライブラリの情報リスト", tags=["音声ライブラリ管理"], ) def downloadable_libraries() -> list[DownloadableLibraryInfo]: """ ダウンロード可能な音声ライブラリの情報を返します。 - - Returns - ------- - ret_data: list[DownloadableLibrary] """ if not engine_manifest_data.supported_features.manage_library: raise HTTPException( @@ -1015,15 +1004,12 @@ def downloadable_libraries() -> list[DownloadableLibraryInfo]: @app.get( "/installed_libraries", response_model=dict[str, InstalledLibraryInfo], + response_description="インストールした音声ライブラリの情報", tags=["音声ライブラリ管理"], ) def installed_libraries() -> dict[str, InstalledLibraryInfo]: """ インストールした音声ライブラリの情報を返します。 - - Returns - ------- - ret_data: dict[str, InstalledLibrary] """ if not engine_manifest_data.supported_features.manage_library: raise HTTPException( @@ -1038,17 +1024,12 @@ def installed_libraries() -> dict[str, InstalledLibraryInfo]: dependencies=[Depends(check_disabled_mutable_api)], ) async def install_library( - library_uuid: str, + library_uuid: Annotated[str, FAPath(description="音声ライブラリのID")], request: Request, ) -> Response: """ 音声ライブラリをインストールします。 音声ライブラリのZIPファイルをリクエストボディとして送信してください。 - - Parameters - ---------- - library_uuid: str - 音声ライブラリのID """ if not engine_manifest_data.supported_features.manage_library: raise HTTPException( @@ -1067,14 +1048,11 @@ async def install_library( tags=["音声ライブラリ管理"], dependencies=[Depends(check_disabled_mutable_api)], ) - def uninstall_library(library_uuid: str) -> Response: + def uninstall_library( + library_uuid: Annotated[str, FAPath(description="音声ライブラリのID")] + ) -> Response: """ 音声ライブラリをアンインストールします。 - - Parameters - ---------- - library_uuid: str - 音声ライブラリのID """ if not engine_manifest_data.supported_features.manage_library: raise HTTPException( @@ -1112,17 +1090,15 @@ def is_initialized_speaker( return core.is_initialized_style_id_synthesis(style_id) @app.get( - "/user_dict", response_model=dict[str, UserDictWord], tags=["ユーザー辞書"] + "/user_dict", + response_model=dict[str, UserDictWord], + response_description="単語のUUIDとその詳細", + tags=["ユーザー辞書"], ) def get_user_dict_words() -> dict[str, UserDictWord]: """ ユーザー辞書に登録されている単語の一覧を返します。 単語の表層形(surface)は正規化済みの物を返します。 - - Returns - ------- - dict[str, UserDictWord] - 単語のUUIDとその詳細 """ try: return read_dict() @@ -1139,29 +1115,28 @@ def get_user_dict_words() -> dict[str, UserDictWord]: dependencies=[Depends(check_disabled_mutable_api)], ) def add_user_dict_word( - surface: str, - pronunciation: str, - accent_type: int, - word_type: WordTypes | None = None, - priority: Annotated[int | None, Query(ge=MIN_PRIORITY, le=MAX_PRIORITY)] = None, + surface: Annotated[str, Query(description="言葉の表層形")], + pronunciation: Annotated[str, Query(description="言葉の発音(カタカナ)")], + accent_type: Annotated[ + int, Query(description="アクセント型(音が下がる場所を指す)") + ], + word_type: Annotated[ + WordTypes | None, + Query( + description="PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか" + ), + ] = None, + priority: Annotated[ + int | None, + Query( + ge=MIN_PRIORITY, + le=MAX_PRIORITY, + description="単語の優先度(0から10までの整数)。数字が大きいほど優先度が高くなる。1から9までの値を指定することを推奨", + ), + ] = None, ) -> Response: """ ユーザー辞書に言葉を追加します。 - - Parameters - ---------- - surface : str - 言葉の表層形 - pronunciation: str - 言葉の発音(カタカナ) - accent_type: int - アクセント型(音が下がる場所を指す) - word_type: WordTypes, optional - PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか - priority: int, optional - 単語の優先度(0から10までの整数) - 数字が大きいほど優先度が高くなる - 1から9までの値を指定することを推奨 """ try: word_uuid = apply_word( @@ -1189,32 +1164,29 @@ def add_user_dict_word( dependencies=[Depends(check_disabled_mutable_api)], ) def rewrite_user_dict_word( - surface: str, - pronunciation: str, - accent_type: int, - word_uuid: str, - word_type: WordTypes | None = None, - priority: Annotated[int | None, Query(ge=MIN_PRIORITY, le=MAX_PRIORITY)] = None, + surface: Annotated[str, Query(description="言葉の表層形")], + pronunciation: Annotated[str, Query(description="言葉の発音(カタカナ)")], + accent_type: Annotated[ + int, Query(description="アクセント型(音が下がる場所を指す)") + ], + word_uuid: Annotated[str, FAPath(description="更新する言葉のUUID")], + word_type: Annotated[ + WordTypes | None, + Query( + description="PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか" + ), + ] = None, + priority: Annotated[ + int | None, + Query( + ge=MIN_PRIORITY, + le=MAX_PRIORITY, + description="単語の優先度(0から10までの整数)。数字が大きいほど優先度が高くなる。1から9までの値を指定することを推奨。", + ), + ] = None, ) -> Response: """ ユーザー辞書に登録されている言葉を更新します。 - - Parameters - ---------- - surface : str - 言葉の表層形 - pronunciation: str - 言葉の発音(カタカナ) - accent_type: int - アクセント型(音が下がる場所を指す) - word_uuid: str - 更新する言葉のUUID - word_type: WordTypes, optional - PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか - priority: int, optional - 単語の優先度(0から10までの整数) - 数字が大きいほど優先度が高くなる - 1から9までの値を指定することを推奨 """ try: rewrite_word( @@ -1244,14 +1216,11 @@ def rewrite_user_dict_word( tags=["ユーザー辞書"], dependencies=[Depends(check_disabled_mutable_api)], ) - def delete_user_dict_word(word_uuid: str) -> Response: + def delete_user_dict_word( + word_uuid: Annotated[str, FAPath(description="削除する言葉のUUID")] + ) -> Response: """ ユーザー辞書に登録されている言葉を削除します。 - - Parameters - ---------- - word_uuid: str - 削除する言葉のUUID """ try: delete_word(word_uuid=word_uuid) @@ -1271,18 +1240,16 @@ def delete_user_dict_word(word_uuid: str) -> Response: dependencies=[Depends(check_disabled_mutable_api)], ) def import_user_dict_words( - import_dict_data: dict[str, UserDictWord], - override: bool, + import_dict_data: Annotated[ + dict[str, UserDictWord], + Body(description="インポートするユーザー辞書のデータ"), + ], + override: Annotated[ + bool, Query(description="重複したエントリがあった場合、上書きするかどうか") + ], ) -> Response: """ 他のユーザー辞書をインポートします。 - - Parameters - ---------- - import_dict_data: dict[str, UserDictWord] - インポートするユーザー辞書のデータ - override: bool - 重複したエントリがあった場合、上書きするかどうか """ try: import_user_dict(dict_data=import_dict_data, override=override) @@ -1321,15 +1288,12 @@ def engine_manifest() -> EngineManifest: } }, ) - def validate_kana(text: str) -> bool: + def validate_kana( + text: Annotated[str, Query(description="判定する対象の文字列")] + ) -> bool: """ テキストがAquesTalk 風記法に従っているかどうかを判定します。 従っていない場合はエラーが返ります。 - - Parameters - ---------- - text: str - 判定する対象の文字列 """ try: parse_kana(text) diff --git "a/test/e2e/__snapshots__/test_openapi/test_OpenAPI\343\201\256\345\275\242\343\201\214\345\244\211\343\202\217\343\201\243\343\201\246\343\201\204\343\201\252\343\201\204\343\201\223\343\201\250\343\202\222\347\242\272\350\252\215.json" "b/test/e2e/__snapshots__/test_openapi/test_OpenAPI\343\201\256\345\275\242\343\201\214\345\244\211\343\202\217\343\201\243\343\201\246\343\201\204\343\201\252\343\201\204\343\201\223\343\201\250\343\202\222\347\242\272\350\252\215.json" index 65611cf56..c7eea4c58 100644 --- "a/test/e2e/__snapshots__/test_openapi/test_OpenAPI\343\201\256\345\275\242\343\201\214\345\244\211\343\202\217\343\201\243\343\201\246\343\201\204\343\201\252\343\201\204\343\201\223\343\201\250\343\202\222\347\242\272\350\252\215.json" +++ "b/test/e2e/__snapshots__/test_openapi/test_OpenAPI\343\201\256\345\275\242\343\201\214\345\244\211\343\202\217\343\201\243\343\201\246\343\201\204\343\201\252\343\201\204\343\201\223\343\201\250\343\202\222\347\242\272\350\252\215.json" @@ -1180,13 +1180,19 @@ }, "/add_preset": { "post": { - "description": "新しいプリセットを追加します\n\nParameters\n-------\npreset: Preset\n 新しいプリセット。\n プリセットIDが既存のものと重複している場合は、新規のプリセットIDが採番されます。\n\nReturns\n-------\nid: int\n 追加したプリセットのプリセットID", + "description": "新しいプリセットを追加します", "operationId": "add_preset_add_preset_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Preset" + "allOf": [ + { + "$ref": "#/components/schemas/Preset" + } + ], + "description": "新しいプリセット。プリセットIDが既存のものと重複している場合は、新規のプリセットIDが採番されます。", + "title": "Preset" } } }, @@ -1202,7 +1208,7 @@ } } }, - "description": "Successful Response" + "description": "追加したプリセットのプリセットID" }, "422": { "content": { @@ -1479,14 +1485,16 @@ }, "/delete_preset": { "post": { - "description": "既存のプリセットを削除します\n\nParameters\n-------\nid: int\n 削除するプリセットのプリセットID", + "description": "既存のプリセットを削除します", "operationId": "delete_preset_delete_preset_post", "parameters": [ { + "description": "削除するプリセットのプリセットID", "in": "query", "name": "id", "required": true, "schema": { + "description": "削除するプリセットのプリセットID", "title": "Id", "type": "integer" } @@ -1515,7 +1523,7 @@ }, "/downloadable_libraries": { "get": { - "description": "ダウンロード可能な音声ライブラリの情報を返します。\n\nReturns\n-------\nret_data: list[DownloadableLibrary]", + "description": "ダウンロード可能な音声ライブラリの情報を返します。", "operationId": "downloadable_libraries_downloadable_libraries_get", "responses": { "200": { @@ -1530,7 +1538,7 @@ } } }, - "description": "Successful Response" + "description": "ダウンロード可能な音声ライブラリの情報リスト" } }, "summary": "Downloadable Libraries", @@ -1625,14 +1633,16 @@ }, "/import_user_dict": { "post": { - "description": "他のユーザー辞書をインポートします。\n\nParameters\n----------\nimport_dict_data: dict[str, UserDictWord]\n インポートするユーザー辞書のデータ\noverride: bool\n 重複したエントリがあった場合、上書きするかどうか", + "description": "他のユーザー辞書をインポートします。", "operationId": "import_user_dict_words_import_user_dict_post", "parameters": [ { + "description": "重複したエントリがあった場合、上書きするかどうか", "in": "query", "name": "override", "required": true, "schema": { + "description": "重複したエントリがあった場合、上書きするかどうか", "title": "Override", "type": "boolean" } @@ -1645,6 +1655,7 @@ "additionalProperties": { "$ref": "#/components/schemas/UserDictWord" }, + "description": "インポートするユーザー辞書のデータ", "title": "Import Dict Data", "type": "object" } @@ -1732,14 +1743,16 @@ }, "/install_library/{library_uuid}": { "post": { - "description": "音声ライブラリをインストールします。\n音声ライブラリのZIPファイルをリクエストボディとして送信してください。\n\nParameters\n----------\nlibrary_uuid: str\n 音声ライブラリのID", + "description": "音声ライブラリをインストールします。\n音声ライブラリのZIPファイルをリクエストボディとして送信してください。", "operationId": "install_library_install_library__library_uuid__post", "parameters": [ { + "description": "音声ライブラリのID", "in": "path", "name": "library_uuid", "required": true, "schema": { + "description": "音声ライブラリのID", "title": "Library Uuid", "type": "string" } @@ -1768,7 +1781,7 @@ }, "/installed_libraries": { "get": { - "description": "インストールした音声ライブラリの情報を返します。\n\nReturns\n-------\nret_data: dict[str, InstalledLibrary]", + "description": "インストールした音声ライブラリの情報を返します。", "operationId": "installed_libraries_installed_libraries_get", "responses": { "200": { @@ -1783,7 +1796,7 @@ } } }, - "description": "Successful Response" + "description": "インストールした音声ライブラリの情報" } }, "summary": "Installed Libraries", @@ -2184,7 +2197,7 @@ }, "/presets": { "get": { - "description": "エンジンが保持しているプリセットの設定を返します\n\nReturns\n-------\npresets: list[Preset]\n プリセットのリスト", + "description": "エンジンが保持しているプリセットの設定を返します", "operationId": "get_presets_presets_get", "responses": { "200": { @@ -2199,7 +2212,7 @@ } } }, - "description": "Successful Response" + "description": "プリセットのリスト" } }, "summary": "Get Presets", @@ -2715,14 +2728,16 @@ }, "/uninstall_library/{library_uuid}": { "post": { - "description": "音声ライブラリをアンインストールします。\n\nParameters\n----------\nlibrary_uuid: str\n 音声ライブラリのID", + "description": "音声ライブラリをアンインストールします。", "operationId": "uninstall_library_uninstall_library__library_uuid__post", "parameters": [ { + "description": "音声ライブラリのID", "in": "path", "name": "library_uuid", "required": true, "schema": { + "description": "音声ライブラリのID", "title": "Library Uuid", "type": "string" } @@ -2751,13 +2766,19 @@ }, "/update_preset": { "post": { - "description": "既存のプリセットを更新します\n\nParameters\n-------\npreset: Preset\n 更新するプリセット。\n プリセットIDが更新対象と一致している必要があります。\n\nReturns\n-------\nid: int\n 更新したプリセットのプリセットID", + "description": "既存のプリセットを更新します", "operationId": "update_preset_update_preset_post", "requestBody": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Preset" + "allOf": [ + { + "$ref": "#/components/schemas/Preset" + } + ], + "description": "更新するプリセット。プリセットIDが更新対象と一致している必要があります。", + "title": "Preset" } } }, @@ -2773,7 +2794,7 @@ } } }, - "description": "Successful Response" + "description": "更新したプリセットのプリセットID" }, "422": { "content": { @@ -2794,7 +2815,7 @@ }, "/user_dict": { "get": { - "description": "ユーザー辞書に登録されている単語の一覧を返します。\n単語の表層形(surface)は正規化済みの物を返します。\n\nReturns\n-------\ndict[str, UserDictWord]\n 単語のUUIDとその詳細", + "description": "ユーザー辞書に登録されている単語の一覧を返します。\n単語の表層形(surface)は正規化済みの物を返します。", "operationId": "get_user_dict_words_user_dict_get", "responses": { "200": { @@ -2809,7 +2830,7 @@ } } }, - "description": "Successful Response" + "description": "単語のUUIDとその詳細" } }, "summary": "Get User Dict Words", @@ -2820,49 +2841,63 @@ }, "/user_dict_word": { "post": { - "description": "ユーザー辞書に言葉を追加します。\n\nParameters\n----------\nsurface : str\n 言葉の表層形\npronunciation: str\n 言葉の発音(カタカナ)\naccent_type: int\n アクセント型(音が下がる場所を指す)\nword_type: WordTypes, optional\n PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか\npriority: int, optional\n 単語の優先度(0から10までの整数)\n 数字が大きいほど優先度が高くなる\n 1から9までの値を指定することを推奨", + "description": "ユーザー辞書に言葉を追加します。", "operationId": "add_user_dict_word_user_dict_word_post", "parameters": [ { + "description": "言葉の表層形", "in": "query", "name": "surface", "required": true, "schema": { + "description": "言葉の表層形", "title": "Surface", "type": "string" } }, { + "description": "言葉の発音(カタカナ)", "in": "query", "name": "pronunciation", "required": true, "schema": { + "description": "言葉の発音(カタカナ)", "title": "Pronunciation", "type": "string" } }, { + "description": "アクセント型(音が下がる場所を指す)", "in": "query", "name": "accent_type", "required": true, "schema": { + "description": "アクセント型(音が下がる場所を指す)", "title": "Accent Type", "type": "integer" } }, { + "description": "PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか", "in": "query", "name": "word_type", "required": false, "schema": { - "$ref": "#/components/schemas/WordTypes" + "allOf": [ + { + "$ref": "#/components/schemas/WordTypes" + } + ], + "description": "PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか" } }, { + "description": "単語の優先度(0から10までの整数)。数字が大きいほど優先度が高くなる。1から9までの値を指定することを推奨", "in": "query", "name": "priority", "required": false, "schema": { + "description": "単語の優先度(0から10までの整数)。数字が大きいほど優先度が高くなる。1から9までの値を指定することを推奨", "maximum": 10.0, "minimum": 0.0, "title": "Priority", @@ -2901,14 +2936,16 @@ }, "/user_dict_word/{word_uuid}": { "delete": { - "description": "ユーザー辞書に登録されている言葉を削除します。\n\nParameters\n----------\nword_uuid: str\n 削除する言葉のUUID", + "description": "ユーザー辞書に登録されている言葉を削除します。", "operationId": "delete_user_dict_word_user_dict_word__word_uuid__delete", "parameters": [ { + "description": "削除する言葉のUUID", "in": "path", "name": "word_uuid", "required": true, "schema": { + "description": "削除する言葉のUUID", "title": "Word Uuid", "type": "string" } @@ -2935,58 +2972,74 @@ ] }, "put": { - "description": "ユーザー辞書に登録されている言葉を更新します。\n\nParameters\n----------\nsurface : str\n 言葉の表層形\npronunciation: str\n 言葉の発音(カタカナ)\naccent_type: int\n アクセント型(音が下がる場所を指す)\nword_uuid: str\n 更新する言葉のUUID\nword_type: WordTypes, optional\n PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか\npriority: int, optional\n 単語の優先度(0から10までの整数)\n 数字が大きいほど優先度が高くなる\n 1から9までの値を指定することを推奨", + "description": "ユーザー辞書に登録されている言葉を更新します。", "operationId": "rewrite_user_dict_word_user_dict_word__word_uuid__put", "parameters": [ { + "description": "更新する言葉のUUID", "in": "path", "name": "word_uuid", "required": true, "schema": { + "description": "更新する言葉のUUID", "title": "Word Uuid", "type": "string" } }, { + "description": "言葉の表層形", "in": "query", "name": "surface", "required": true, "schema": { + "description": "言葉の表層形", "title": "Surface", "type": "string" } }, { + "description": "言葉の発音(カタカナ)", "in": "query", "name": "pronunciation", "required": true, "schema": { + "description": "言葉の発音(カタカナ)", "title": "Pronunciation", "type": "string" } }, { + "description": "アクセント型(音が下がる場所を指す)", "in": "query", "name": "accent_type", "required": true, "schema": { + "description": "アクセント型(音が下がる場所を指す)", "title": "Accent Type", "type": "integer" } }, { + "description": "PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか", "in": "query", "name": "word_type", "required": false, "schema": { - "$ref": "#/components/schemas/WordTypes" + "allOf": [ + { + "$ref": "#/components/schemas/WordTypes" + } + ], + "description": "PROPER_NOUN(固有名詞)、COMMON_NOUN(普通名詞)、VERB(動詞)、ADJECTIVE(形容詞)、SUFFIX(語尾)のいずれか" } }, { + "description": "単語の優先度(0から10までの整数)。数字が大きいほど優先度が高くなる。1から9までの値を指定することを推奨。", "in": "query", "name": "priority", "required": false, "schema": { + "description": "単語の優先度(0から10までの整数)。数字が大きいほど優先度が高くなる。1から9までの値を指定することを推奨。", "maximum": 10.0, "minimum": 0.0, "title": "Priority", @@ -3017,14 +3070,16 @@ }, "/validate_kana": { "post": { - "description": "テキストがAquesTalk 風記法に従っているかどうかを判定します。\n従っていない場合はエラーが返ります。\n\nParameters\n----------\ntext: str\n 判定する対象の文字列", + "description": "テキストがAquesTalk 風記法に従っているかどうかを判定します。\n従っていない場合はエラーが返ります。", "operationId": "validate_kana_validate_kana_post", "parameters": [ { + "description": "判定する対象の文字列", "in": "query", "name": "text", "required": true, "schema": { + "description": "判定する対象の文字列", "title": "Text", "type": "string" }