openapi - Open API 3.0 如何添加 API 正文元素?
问题描述
我正在尝试为会后电话会议创建一个招摇的文档。我不确定如何在参数下添加正文字段(如 meeting.name、meeting.time、meeting.duration 等)。我在参数“allowedValues:路径、查询、标题、cookie”中得到错误。我不确定从这里选择哪一个?我之前通过编写“-in:body”来完成此操作,但 body 在这里似乎不是一个选项。
openapi: '3.0.0'
info:
title: WebcastCreateMeeting
version: "1.1"
servers:
- url: https://api.webcasts.com/api
paths:
'/event/create/{event_title}/{folder_id}/{type}/{scheduled_start_time}/{scheduled_duration}/{timezone}/{region}/{acquisition_type}/{audience_capacity}/{event_expiration_months}/{token}':
post:
tags:
- CreateMeetingCallbody
summary: EventGM
parameters:
- in: path
name: token
description: the auth token
required: true
schema:
type: string
example: 123j1lkj3lk1j3i1j23l1kj3k1j2l3j12l3j1l2
- in: path
name: event_title
description: Name of the event from Cvent
required: true
schema:
type: string
- in: body
name: user
description: this is a test user
schema:
type: object
required:
- username
properties:
username:
type: string
- in: path
name: folder_id
description: ID of the folder under whihc the Meeting is to be added
required: true
schema:
type: string
- in: path
name: type
description: Type of the Meeting
required: true
schema:
type: string
- in: path
name: scheduled_start_time
description: Start time of
required: true
schema:
type: string
format: date-time
- in: path
name: scheduled_duration
description: Duration
required: true
schema:
type: integer
example: 60
- in: path
name: timezone
description: TimeZone of the event LU table
required: true
schema:
type: string
- in: path
name: region
description: Region from Zoom
required: true
schema:
type: integer
example: 1
- in: path
name: acquisition_type
description: To be added from GM
required: true
schema:
type: integer
example: 0
- in: path
name: audience_capacity
description: To be added for capacity
required: true
schema:
type: integer
- in: path
name: event_expiration_months
description: the month it expires on.
required: true
schema:
type: integer
example: 3
responses:
200:
description: This would be the response.
content:
application/json;charset=utf-8:
schema:
type: array
items:
properties:
scheduled_duration:
type: integer
example: 30
event_id:
type: integer
example: 0000000
audience_capacity:
type: integer
example: 30
folder_name:
type: string
example: Folder_Name
viewer_link:
type: string
example: https://viewer_link
scheduled_start_time:
type: string
format: date-time
example: 1541674800000
scheduled_player_close_time:
type: integer
example: 10
event_title:
type: string
[![enter image description here][1]][1]
请就如何描述我应该在代码中传递的正文字段提出建议。
谢谢
解决方案
知道了,它在“requestbody”中单独通过,检查here
谢谢。
推荐阅读
- sql-server - 在 SQL Server 中同步(一种方式)表的最佳方法
- machine-learning - 有没有关键词提取的基准?
- c# - 使用 C# 逐个替换字符串中的单词
- c# - 如何创建 html 注释来包装自定义 taghelper c#
- apache-spark - 如何在使用 Apache Spark 连接到 Presto 时解决 SQL Exception-Unsupported type JAVA_OBJECT?
- c# - 命令 xcopy 以代码 9009 Visual Studio 2017 退出
- c - 是否有任何 C API 来检查源 IP 地址是否来自同一网络?
- python - Django 模型查询设置为列表,然后将该列表用于另一个模型的排除查询
- laravel - DataTables更改laravel背包的分页上一个/下一个按钮
- c++ - C++线程使用函数对象,如何调用多个析构函数而不是构造函数?