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