I got the solution to pass body request(json) using swagger.
Controller:
class abcController extends Controller
{
/*
* @SWG\Post(
* path="/api/user",
* tags={"User"},
* operationId="ApiV1saveUser",
* summary="Add User",
* consumes={"application/json"},
* produces={"application/json"},
* @SWG\Parameter(
* name="body",
* in="body",
* @SWG\Schema(ref="#/definitions/User"), //User Model
* ),
* @SWG\Response(
* response=200,
* description="Success"
* ),
* )
*/
public function store(Request $request)
{
}
}
User Model:
/**
* @SWG\Definition(
* required={"name","email"},
* type="object",
* @SWG\Xml(name="User")
* ),
* @SWG\Property(format="byte", type="string", property="name", description="User Name"),
* @SWG\Property(format="byte", type="string",property="email", description="Email")
*/
class User extends Model
{
}
Thanks,