コンテンツにスキップ

API の一般情報

APIに関する一般情報(バージョン番号、ライセンス情報、連絡先データ、ドキュメントへのリンクなど)を仕様に含めることは良い習慣とされています。これは特に公開APIで強く推奨されます。これにより、ユーザーは貴社が提供するサービスに対する信頼度を高めることができます。APIメタデータを指定するには、トップレベルのinfoオブジェクトのプロパティを使用します。

1
openapi: 3.0.4
2
info:
3
# You application title. Required.
4
title: Sample Pet Store App
5
6
# API version. You can use semantic versioning like 1.0.0,
7
# or an arbitrary string like 0.99-beta. Required.
8
version: 1.0.0
9
10
# API description. Arbitrary text in CommonMark or HTML.
11
description: This is a sample server for a pet store.
12
13
# Link to the page that describes the terms of service.
14
# Must be in the URL format.
15
termsOfService: http://example.com/terms/
16
17
# Contact information: name, email, URL.
18
contact:
19
name: API Support
20
email: support@example.com
21
url: http://example.com/support
22
23
# Name of the license and a URL to the license description.
24
license:
25
name: Apache 2.0
26
url: https://apache.dokyumento.jp/licenses/LICENSE-2.0.html
27
28
# Link to the external documentation (if any).
29
# Code or documentation generation tools can use description as the text of the link.
30
externalDocs:
31
description: Find out more
32
url: http://example.com

titleversionプロパティは必須であり、その他はオプションです。

参照

情報オブジェクト

お探しのものが見つかりませんでしたか? コミュニティに質問する
間違いを見つけましたか? お知らせください