> 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/managing-api-operations.md).

# API オペレーションの管理

OpenAPI の API オペレーションを実験的、非推奨としてマークしたり、ドキュメントから非表示にする方法を学びましょう

まだ完全に安定していない、または段階的に廃止する必要があるオペレーションはよくあります。GitBook は、これらのシナリオを管理するのに役立ついくつかの OpenAPI 拡張をサポートしています。

### オペレーションを experimental、alpha、または beta としてマークする

使用 `x-stability` エンドポイントが不安定である、または作業中であることを示すために使用します。これにより、ユーザーは本番利用に未対応のエンドポイントを避けやすくなります。サポートされる値: `experimental`, `alpha`, `beta`.

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      x-stability: experimental
</strong></code></pre>

### オペレーションを非推奨にする

オペレーションを非推奨としてマークするには、次を追加します: `deprecated: true` 属性。

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      deprecated: true
</strong></code></pre>

必要に応じて、サポート終了時期を含めて指定できます。 `x-deprecated-sunset`

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      deprecated: true
</strong><strong>      x-deprecated-sunset: 2030-12-05
</strong></code></pre>

### API リファレンスからオペレーションを非表示にする

API リファレンスからオペレーションを非表示にするには、次を追加します: `x-internal: true` または `x-gitbook-ignore: true` 属性。

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      x-internal: true
</strong></code></pre>

### レスポンスサンプルを非表示にする

次を追加します: `x-hideSample: true` レスポンスオブジェクトにこの属性を追加して、レスポンスサンプルセクションから除外します。

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">paths:
  /pet:
    put:
      operationId: updatePet
<strong>      responses:
</strong><strong>        200:
</strong><strong>          x-hideSample: true
</strong></code></pre>

### 認証プレフィックスとトークンプレースホルダーのカスタマイズ

認証プレフィックス（たとえば、 `Bearer`, `Token`、またはカスタム文字列）と、GitBook でセキュリティスキームを使用する際に表示されるトークンプレースホルダーをカスタマイズできます。

OpenAPI 仕様の `components.securitySchemes`の下に、次のようにスキームを定義します:

<pre class="language-yaml" data-title="openapi.yaml"><code class="lang-yaml">components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
<strong>      x-gitbook-prefix: Token
</strong><strong>      x-gitbook-token-placeholder: YOUR_CUSTOM_TOKEN
</strong></code></pre>

これらの拡張:

* `x-gitbook-prefix` トークンの前に追加されるプレフィックスを定義します。
  * 例: `Authorization: <x-gitbook-prefix> YOUR_API_TOKEN`
* `x-gitbook-token-placeholder` デフォルトのトークン値を設定します。
  * 例: `Authorization: Bearer <x-gitbook-token-placeholder>`

{% hint style="warning" %}
`x-gitbook-prefix` は次のセキュリティスキームではサポートされていません: `http` これらのスキームは標準の IANA 認証定義に従う必要があるためです。 [詳細を見る](https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml)
{% endhint %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
