如果不希望客户端直接在请求正文中发布数组,但需要使用密钥,则需要指定
in=body
参数为
type="object"
并将数组定义为该架构的属性。
像这样:
/**
* @SWG\POST(
* path="/visa-entry/calculate",
* operationId="visaEntryCalculate",
* tags={"Visa Entry"},
* summary="Calculate the price for an array of visa entries",
* description="Calculate the price for an array of visa entries",
*
* @SWG\Parameter(
* in="body",
* name="json",
* description="Visa Entry IDs to calculate to total price",
* required=true,
* @SWG\Schema(
* type="object",
* @SWG\Property(
* property="entries",
* type="array",
* @SWG\Items(type="number")
* )
* ),
* collectionFormat="multi"
* ),
*
* @SWG\Response(
* response=200,
* description="OK"
* ),
*
* @SWG\Response(
* response=400,
* description="Bad request"
* ),
* )
*
* Calculates a visa entry
*/