Ema*_* Ey 22 swagger swagger-2.0 swagger-editor
我正在使用http://editor.swagger.io来设计API,我收到一个错误,我不知道如何解决:
Schema error at paths['/employees/{employeeId}/roles'].get.parameters[0]
should NOT have additional properties
additionalProperty: type, format, name, in, description
Jump to line 24
Run Code Online (Sandbox Code Playgroud)
我有其他端点以类似的方式定义,并没有得到此错误.我想知道我是否有一些缩进或未公开引号的问题,但似乎并非如此.谷歌似乎也没有提供任何有用的结果.
swagger: "2.0"
info:
description: Initial draft of the API specification
version: '1.0'
title: App 4.0 API
host: api.com
basePath: /v1
tags:
- name: employees
description: Employee management
schemes:
- https
paths:
/employees/{employeeId}/roles:
get:
tags:
- employees
summary: "Get a specific employee's roles"
description: ''
operationId: findEmployeeRoles
produces:
- application/json
parameters:
- name: employeeId <====== Line 24
in: path
description: Id of employee whose roles we are fetching
type: integer
format: int64
responses:
'200':
description: successful operation
schema:
type: array
items:
$ref: '#/definitions/Role'
'403':
description: No permission to see employee roles
'404':
description: EmployeeId not found
Run Code Online (Sandbox Code Playgroud)
任何提示?
Hel*_*len 28
错误消息具有误导性.实际错误是您的路径参数丢失required: true.路径参数始终是必需的,因此请记住添加required: true它们.
| 归档时间: |
|
| 查看次数: |
24625 次 |
| 最近记录: |