Level 1
Did you find the solution to this?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I want to make this type of array in swagger php version 3 can you help about this i have 5 parameters in whcih one is base64 parameter in json body
{
"products": [
{
"first_name": "string",
"last_name": "string",
"email": "string",
"phone": "string",
"resume": "string" ==> here i will send base64 format of resume file
}
]
}
This code using but giving error products must be an array where as resume passing in base64 format
/**
* @OA\Schema(
* schema="ProductRequest",
* required={"products"},
* @OA\Property(
* property="products",
* type="array",
* @OA\Items(
* @OA\Property(property="first_name", type="string"),
* @OA\Property(property="last_name", type="string"),
* @OA\Property(property="email", type="string"),
* @OA\Property(property="phone", type="string"),
* @OA\Property(property="resume", type="string", format="byte"),
* ),
* )
* )
*/
/**
* @OA\RequestBody(
* request="Product",
* required=true,
* description="Bulk products Body",
* @OA\MediaType(
* mediaType="multipart/form-data",
* @OA\Schema(ref="#/components/schemas/ProductRequest")
* )
* )
*/
/**
* @OA\Post(
* path="/prodcuts/save",
* tags={"Prodcuts"},
* summary="Post bulk products",
* description="Return bulk products",
* @OA\Parameter(
* name="id",
* required=true,
* in="query",
* @OA\Schema(
* type="string",
* )
* ),
* @OA\RequestBody(ref="#/components/requestBodies/Product"),
* @OA\Response(
* response=200,
* description="Successful operation",
* ),
* )
*/
Please or to participate in this conversation.