问题描述
我学习了 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",* 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",
如何在里面添加数组?
谢谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)