我正在使用第四交响曲和条令,现在我正在实现/添加招摇过市,所以我将有适当的文档来测试我的API。
这是我的邮递员,有正确的输入表单数据和OK响应。
这是我“有问题”的招摇过市的标志
* @Route(
* "/request",
* name="create",
* methods={"POST"}
* )
*
* @SWG\Parameter(
* name="domain",
* in="formData",
* required=true,
* type="array",
* @SWG\Items(
* type="string"
* )
* ),
*
* @SWG\Parameter(
* name="name",
* in="formData",
* required=true,
* type="string",
* ),
*
* @SWG\Response(
* response=200,
* description="OK",
* @SWG\Schema(
* type="array",
* @Model(type=App\Entity\Request::class)
* )
* ),
*
* @SWG\Response(
* response=201,
* description="Request created",
* @SWG\Schema(
* type="array",
* @Model(type=App\Entity\Request::class)
* )
* ),
所以现在我通过myurl.com/api/doc打开一个招摇过市器,并尝试执行相同的操作…
所以我的大摇大摆按照curl的要求执行
curl -X POST "http://certify.test/request" -H "accept: application/json" -H "Content-Type: application/json" -d "domain=antrax.com,www.antrax.com&name=antrax.com%2Cwww.antrax.com"
答案是
{
"status": "error",
"code": 0,
"message": "Invalid json message received"
}
伙计们,能不能请你们帮我正确地注释一下我的自大参数,这样我的api文档就可以做出正确的请求了。如果您需要任何其他信息,请告诉我,我会提供。谢谢您!