i'm tring to make a swagger call in post using DarkaOnLine / L5-Swagger. This is the code in my controller:
/**
* @OA\Post(
* path="/api/send",
* summary="Use to sign",
* description="Use send a contract to sign with eSign",
* operationId="MpProjects.active",
* tags={"Projects"},
* security={{"passport":{}}},
*
* @OA\RequestBody(
* @OA\MediaType(
* mediaType="raw",
* @OA\Schema(
* type="object",
*
* @OA\Property(
* property="Name",
* description="Contract name",
* example="Prova Contratto",
* type="string"
* ),
* @OA\Property(
* property="EmailSubject",
* description="EmailSubject",
* example="Firma contratto di prova",
* type="string"
* ),
* @OA\Property(
* property="RecipientEmail",
* description="RecipientEmail",
* example="email@gmail.com",
* type="string"
* ),
* @OA\Property(
* property="FirstName",
* description="FirstName",
* example="Gabriele",
* type="string"
* ),
* @OA\Property(
* property="LastName",
* description="LastName",
* example="Alessi",
* type="string"
* ),
* @OA\Property(
* property="PhoneMobile",
* description="PhoneMobile",
* example="+393333333333",
* type="string"
* ),
* @OA\Property(
* property="Pdf",
* description="Pdf",
* example="base64PDF",
* type="string"
* )
* )
* )
* ),
* @OA\Response(
* response=200,
* description="Operation successful",
* @OA\MediaType(
* mediaType="application/json"
* )
* ),
*
* @OA\Response(
* response=204,
* description="Empty response",
* @OA\MediaType(
* mediaType="application/json"
* )
* )
* )
*/
public function sendDoc(Request $request){
return $request;
}
this is how the body appears on /documentation:
But it returns an empty array with this response header:
I think the problem is in the Curl, but i can't understand where exactly. is the request body made in right way? I tried the same call with postaman, with the same json as body, and it works...
I just need to see if the body is arriving in the controller and how it is made so i can work on it.