> For the complete documentation index, see [llms.txt](https://gitbook.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.com/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/openapi/guides/openapi-layouts.md).

# OpenAPIレイアウト

OpenAPI Reference を挿入すると **OpenAPI Reference**、GitBook は操作を 2 つの方法で整理できます。

人々が API をどのように閲覧するかに合ったレイアウトを選択してください。

### この設定にアクセスする

レイアウトを選ぶには:

1. セクションで、 **新規追加...** → **OpenAPI Reference**をクリックします。既存の OpenAPI Reference を編集することもできます。
2. OpenAPI の仕様を選択してください。
3. で **ページ構成**、 **タグごとに1ページ** または **操作ごとに1ページ**.

完全な設定フローについては、次を参照してください。 [ドキュメントに API リファレンスを挿入する](/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/openapi/insert-api-reference-in-your-docs.md).

### 利用可能なレイアウト

GitBook は 2 つのレイアウトをサポートしています:

* **タグごとに1ページ** 各タグごとに1ページを作成します。各ページには、そのタグを持つすべての操作が一覧表示されます。
* **操作ごとに1ページ** 各操作ごとに1ページを作成します。GitBook は、目次内でそれらのページをタグごとにグループ化します。

### 入力例

どちらのレイアウトも、同じ OpenAPI データから始まります:

{% code title="openapi.yaml" %}

```yaml
paths:
  /users:
    get:
      tags:
        - users
      summary: ユーザーを一覧表示
    post:
      tags:
        - users
      summary: ユーザーを作成
```

{% endcode %}

### タグごとに1ページ

各タグが API の明確なセクションを表す場合は、このレイアウトを使用してください。

概要ページを用意したい場合、ナビゲーション内の項目を少なくしたい場合、関連するエンドポイントを同じページにまとめたい場合に適しています。

このレイアウトでは、両方の操作が `users` タグの同じ生成ページに表示されます。

### 操作ごとに1ページ

個々のエンドポイントへの直接リンクが欲しい場合は、このレイアウトを使用してください。

大規模な API に適しており、または各エンドポイントにナビゲーション内の専用ページが必要な場合に適しています。

このレイアウトでは、GitBook は `GET /users` のページを1つ作成し、さらに `POST /users`のページを1つ作成します。どちらのページも `users` タググループ

### 簡単な推奨

選択してください **タグごとに1ページ** 小規模な API の場合、または各タグが明確なセクションである場合。

選択してください **操作ごとに1ページ** 大規模な API の場合、または各エンドポイントごとに専用ページを作りたい場合。

### 生成されたナビゲーションを制御する

どちらのレイアウトでも、GitBook は OpenAPI のタグを使用してリファレンスを整理します。

順序、階層、ページタイトル、アイコン、説明を制御するには、次を参照してください。 [API リファレンスの構造化](/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/openapi/guides/structuring-your-api-reference.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gitbook.com/docs/documentation/ja-gitbook-documentation/kontentsuwosuru/openapi/guides/openapi-layouts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
