0
在我的Swagger spec文件中,我想返回示例響應,因爲我可以在響應中添加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