> 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/api-references/guides/openapi-layouts.md).

# OpenAPI レイアウト

OpenAPI Reference を挿入するとき **OpenAPI リファレンス**、GitBook はオペレーションを 2 つの方法で整理できます。

API をどのように閲覧してほしいかに合ったレイアウトを選択します。

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

レイアウトを選択するには：

1. セクションで、 **新規追加...** → **OpenAPI リファレンス**。既存の OpenAPI リファレンスも編集できます。
2. OpenAPI スペックを選択します。
3. 〜の **ページ構成**、 **タグごとに 1 ページ** または **オペレーションごとに 1 ページ**.

設定手順の全体については、 [ドキュメントに API リファレンスを挿入する](/docs/documentation/ja-gitbook-documentation/api-references/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 は〜用に 1 ページを作成します `GET /users` および〜用に 1 ページを `POST /users`。両方のページは、〜の下に表示されます `users` タググループ。

### 簡単なおすすめ

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

選択してください **オペレーションごとに 1 ページ** 大規模な API の場合や、各エンドポイントに専用ページが必要な場合は

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

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

順序、階層、ページタイトル、アイコン、説明を制御するには、 [API リファレンスの構成](/docs/documentation/ja-gitbook-documentation/api-references/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/api-references/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.
