lumen - 如何在 swagger-php 流明中添加多维数组?
问题描述
我学习了 swagger-php,我需要通过 swagger 在文档中添加多维数组。我的代码
/**
*Send Email method
* @OA\Post (
* path="/v1/sendEmail",
* operationId="sendEmail",
* summary="Send email",
* description="",
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* type="array",
* @OA\Items(
* @OA\Property(
* property="action",
* type="string",
* ),
* ),
* ),
* ),
* ),
* @OA\Response(
* response=200,
* description="OK",
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* @OA\Property(
* property="result",
* type="string"
* ),
* @OA\Property(
* property="message",
* type="string"
* ),
* example={"result": "Ok", "message": "Success"}
* )
* )
* )
* )
*
*
*
* @param Request $request
* @return JsonResponse
*/
public function sendEmail(Request $request): JsonResponse
{
return response()->json('ok');
}
但我需要在“操作”之后添加类型为数组的属性“字母”。但我不能使用这样的东西
* @OA\Property(
* property="letter",
* type="array",
* ),
因为我在属性中通过类型数组得到错误。
我怎样才能在里面添加数组?
谢谢
解决方案
推荐阅读
- php - 对 directory_map() 的数字结果进行排序
- php - 函数 App\Http\Controllers\MainController::sendEmailDoneR() 的参数太少,通过了 2 个,预期正好有 3 个
- r - 矩阵的列标准化形式
- reactjs - 如何更改 ReactToolTip 的位置
- aws-amplify - Amplify No pubsub 模块申请订阅 ReactJs
- android - 如何在运行时设置主题颜色?
- python - Python 错误:预期的 str、字节或 os.PathLike 对象,而不是 _io.TextIOWrapper
- ios - Rocketchat 嵌入式布局未在 iphone (ios) 中显示麦克风按钮
- ruby - 如何从 JIRA webhook 获取 JSON 数据
- shopify - 如何在 Shopify 中更改整个网站的默认缩放设置?