0
私のSwagger仕様ファイルでは、回答の例を返信したいのですが、そのためにはexamples
を追加することができます。しかし、それは私の仕様ファイルをかなり大きくエラーを起こしやすいものにしています。サンプルオブジェクトのJSONを含むファイルを参照する方法はありますか?Swaggerで応答例を含む外部JSONファイルを参照する方法は?
私は以下のように試しましたが、うまくいかないようです。
get:
tags:
- businesses
summary: Get Taxable Entities details
description: ''
operationId: getTaxableEntities
produces:
- application/json
parameters:
- name: business_id
in: path
required: true
type: integer
format: int32
- name: gstIn
in: query
required: false
type: integer
format: int32
responses:
'200':
description: Taxable Entities
schema:
type: file
default:
$ref: taxable_entity_example.json
'401':
description: You are not authorised to view this Taxable Entity