API サービスは通常、.proto ファイルを使用して API サーフェスを定義し、.yaml ファイルを使用して API サービスを構成します。各 API サービスで、API ディレクトリが API リポジトリ内にあることが必須となります。API ディレクトリには、API 定義ファイルとビルド スクリプトがすべて含まれる必要があります。
各 API ディレクトリは、次の標準レイアウトにすることが推奨されます。
API ディレクトリ
リポジトリの前提条件
BUILD - ビルドファイル。
METADATA - ビルド メタデータ ファイル。
OWNERS - API ディレクトリのオーナー。
README.md - API サービスに関する一般的な情報。
構成ファイル
{service}.yaml - ベースライン サービス構成ファイル。これは google.api.Service proto メッセージの YAML 表現です。
prod.yaml - 本番デルタ サービス構成ファイル。
staging.yaml - ステージング デルタ サービス構成ファイル。
test.yaml - テスト デルタ サービス構成ファイル。
local.yaml - ローカル デルタ サービス構成ファイル。
ドキュメント ファイル
doc/* - 技術ドキュメント ファイル。Markdown 形式にします。
インターフェース定義
v[0-9]*/* - 各ディレクトリには、API のメジャー バージョン(主に proto ファイルとビルド スクリプト)が含まれています。
{subapi}/v[0-9]*/* - 各 {subapi} ディレクトリにはサブ API のインターフェース定義が含まれています。各サブ API には独自のメジャー バージョンを持つことができます。
type/* - 異なる API 間、同じ API の異なるバージョン間、または API とサービスの実装間で共有される型を含む proto ファイル。type/* の下にある型定義には、リリース後に互換性を損なう変更を加えるべきではありません。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-11 UTC。"],[[["API services utilize `.proto` files for API definition and `.yaml` files for service configuration."],["Each API service must reside in an API directory within an API repository, containing all definition files and build scripts."],["An API directory should follow a standard layout including repository prerequisites, configuration files, documentation files, and interface definitions, like versioned sub-API directories, and type files for shared proto files."],["Public Google API definitions are available on the [Google APIs](https://github.com/googleapis/googleapis) GitHub repository, as seen with the [Service Infrastructure Example API](https://github.com/googleapis/googleapis/tree/master/google/example/endpointsapis)."]]],[]]