到目前为止,我已经使用application/x-www-form-urlencoded
来传递正文中的键值对,如果我必须传递一个对象applicaton/json
post:
tags:
- "users"
summary: "Create User"
operationId: "createUser"
consumes:
- "application/x-www-form-urlencoded"
parameters:
- name: "username"
in: "formData"
description: "Name of User"
required: true
type: "string"
- name: "email"
in: "formData"
description: "Email"
required: true
type: "string"
现在我想添加一个对象:
{
"member":{
"name":string,
"email":string
}
}
我在定义中描述:
definitions:
member:
type:"object"
properties:
name:
type: string
email:
type: string
如何在招摇中做到这一点?
以下是文档:https://swagger.io/docs/specification/describing-request-body/ 但我不明白我如何能够保留身体中正常的键值对。