我想定义通用参数,但路径不同,因此我描述了与文档中所示代码相似的代码,但出现以下错误,但是当我将相同的代码分别包含在这些路径中时,它可以工作
我编写了类似于2.0 swagger文档的代码。
这是我的代码
/departments/{department_id}:
get:
summary: get one department
description: return one department from it's id
parameters:
- $ref: "#/parameters/departmentID"
/departments/{department_id}/employees:
get:
summary: get department's employees
description: return all the employees under single department
parameters:
- $ref: '#/parameters/departmentID'
/departments/{department_id}/employees:
get:
summary: get department's employees
description: return all the employees under single department
parameters:
- $ref: '#/parameters/departmentID'
错误
隐藏
路径/部门/ {department_id}上的语义错误 需要在路径或操作级别将声明的路径参数“ department_id”定义为路径参数 跳到第61行 路径/部门/ {department_id} /员工的语义错误 需要在路径或操作级别将声明的路径参数“ department_id”定义为路径参数 跳到第75行 parameter.departmentID处的结构错误 应该是对象 跳到第102行