File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -139,8 +139,7 @@ Issue 側で取り組み始めたことを伝えるか、最初に Draft プル
139139
140140### Rust 以外の言語の API に関する方針
141141
142- VOICEVOX CORE の主要機能は Rust で実装されることを前提としており、他の言語のラッパーでのみの機能追加はしない方針としています。これは機能の一貫性を保つための方針です。
143- 各言語の特性に応じた追加実装(例えば、Python での ` style_id ` の [ ` NewType ` ] ( https://docs.python.org/ja/3/library/typing.html#newtype ) 化など)は許容されます。
142+ [ APIデザイン ガイドライン] ( ./docs/guide/dev/api-design.md ) をご覧ください。
144143
145144## コアライブラリのビルド
146145
Original file line number Diff line number Diff line change 1+ # APIデザイン ガイドライン
2+
3+ ## Rust 以外の言語の API
4+
5+ VOICEVOX CORE の主要機能は Rust で実装されることを前提としており、他の言語のラッパーでのみの機能追加はしない方針としています。これは機能の一貫性を保つための方針です。
6+
7+ ただし機能追加ではない範囲で、各言語の習慣に適合するような変更は積極的に行っていきます。例えば:
8+
9+ * [ ` AudioQuery ` ] ( https://voicevox.github.io/voicevox_core/apis/rust_api/voicevox_core/struct.AudioQuery.html ) といったJSONで表現可能なデータ型は、Pythonなら[ Pydantic] ( https://docs.pydantic.dev ) 、JavaScriptなら[ Zod] ( https://zod.dev/ ) といったライブラリを使って表現すべきです。
10+ * Rust APIとやりとりする際はJSONを介して変換します。
11+ * [ ` StyleId ` ] ( https://voicevox.github.io/voicevox_core/apis/rust_api/voicevox_core/struct.StyleId.html ) といった[ newtype] ( https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html ) は、そのままnewtypeとして表現するべきです。
12+ * 例えばPythonなら[ ` typing.NewType ` ] ( https://docs.python.org/ja/3/library/typing.html#newtype ) で表現します。
13+ * オプショナルな引数は、キーワード引数がある言語であればキーワード引数で、ビルダースタイルが一般的な言語であればビルダースタイルで表現すべきです。
14+
15+ <!-- TODO: `render`の引数について: https://github.com/VOICEVOX/voicevox_core/pull/870#discussion_r1835601477 -->
You can’t perform that action at this time.
0 commit comments