【发布时间】:2018-08-30 17:32:44
【问题描述】:
我想在帖子中发送一个对象,但使用 api 密钥。
如何在OpenAPI-Specification 2.0 中描述这一点?
我试过这个(yaml 中的一个子集):
paths:
/eau:
post:
tags:
- Pets
summary: Send a pet
description: 'Send a pet'
operationId: sendapet
consumes:
- application/json
produces:
- application/json
parameters:
- in: body
name: pet
description: Send a pet
required: true
schema:
$ref: '#/definitions/pet'
- in: header
name: api_key
但是在
- in: header
name: api_key
我收到以下错误:
Schema error at paths['/pet'].post.parameters[1].in
should be equal to one of the allowed values
allowedValues: body
Jump to line 36
Schema error at paths['/pet'].post.parameters[1]
should match exactly one schema in oneOf
Jump to line 36
Schema error at paths['/pet'].post.parameters[1]
should NOT have additional properties
additionalProperty: in, name
Jump to line 36
【问题讨论】:
标签: yaml swagger restful-architecture swagger-2.0