タグによる操作のグループ化
各 API オペレーションに tags
のリストを割り当てることができます。タグ付けされたオペレーションは、ツールやライブラリによって異なる方法で処理される場合があります。たとえば、Swagger UI は表示されるオペレーションをグループ化するために tags
を使用します。
1paths:2 /pet/findByStatus:3 get:4 summary: Finds pets by Status5 tags:6 - pets7 ...8 /pet:9 post:10 summary: Adds a new pet to the store11 tags:12 - pets13 ...14 /store/inventory:15 get:16 summary: Returns pet inventories17 tags:18 - store19 ...
オプションで、ルートレベルのグローバル
tags
セクションを使用して、各タグの description
と externalDocs
を指定できます。ここでのタグ名は、オペレーションで使用されるタグ名と一致する必要があります。
1tags:2 - name: pets3 description: Everything about your Pets4 externalDocs:5 url: http://docs.my-api.com/pet-operations.htm6 - name: store7 description: Access to Petstore orders8 externalDocs:9 url: http://docs.my-api.com/store-orders.htm
グローバルタグセクションでのタグの順序は、Swagger UI でのデフォルトのソートも制御します。ルートレベルで定義されていないタグもオペレーションで使用できることに注意してください。
お探しのものが見つかりませんでしたか? コミュニティに質問する
間違いを見つけましたか? お知らせください