openapi: "3.0.0"
info:
title: project
servers:
- url: http://example1.net/v3
- url: http://example/v3
paths:
/Pn/{PnId}/service1:
post:
summary: Pn data
description: |
can Pn the data
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/dataInfo"
application/x-www-form-urlencoded:
schema:
$ref: "#/components/schemas/dataInfo"
parameters:
- name: PnId
in: path
description: PnId
required: true
schema:
$ref: "#/components/schemas/Pn"
responses:
'200':
description: status
content:
application/json:
schema:
$ref: "#/components/schemas/dataInfoStatus"
example: infoable
default:
description: error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
components:
schemas:
Error:
type: object
properties:
code:
type: integer
message:
type: string
required:
- message
Pn:
type: integer
format: int64
dataInfo:
type: string
dataInfoStatus:
type: string
enum: [infoable, non_infoable,ignorable]
我在请求中发送单个 dataInfo 并获得单个 dataInfoStatus 作为响应,但我想发送 dataInfo 数组并获取 dataInfo 状态数组。
我试过以下:
schema:
type:array
items:
$ref: "#/components/schemas/dataInfo"
但我明白了
解析器错误映射条目的缩进错误
对于项目。我正在关注这个。
如何实现将请求中的 dataInfo 作为 dataInfo 数组发送并获得 dataInfoStatus 数组作为响应?