src/Controller/UserRESTController.php
/**
     * Controller method used for creating resource via HTTP POST method
     *
     * @param Request $request
     *
     * @return JsonResponse
     *
     * @throws \App\Exceptions\ValidationException
     * @Route(path="api/v1/user", methods={"POST"})
     */
Controller method used for creating resource via HTTP POST method
@param Request $request




Controller method used for creating resource via HTTP POST method @param Request $request
public function post(Request $request): JsonResponse
    {
        $user = $this->userService->createUser($request->getContent());
        return new JsonResponse(
            ApiHelper::prepareResponse(
                true,
                [
                    'id' => $user->getId()
                ]
            ),
            Response::HTTP_CREATED
        );
    }
public function post ( Request $ request ) : JsonResponse { $ user = $ this -> userService -> createUser ( $ request -> getContent ( ) ) ; return new JsonResponse ( ApiHelper :: prepareResponse ( true , [ 'id' => $ user -> getId ( ) ] ) , Response :: HTTP_CREATED ) ; }
Controller method used for creating resource via HTTP POST method
 @param Request $request
Controller method used for creating resource via HTTP POST method @param Request $request