@@ -54,7 +54,7 @@ class UserController : public oatpp::web::server::api::ApiController {
5454
5555 ENDPOINT_INFO (root) {
5656 info->summary = " Index.html page" ;
57- info->addResponse <UserDto::ObjectWrapper >(Status::CODE_200, " text/html" );
57+ info->addResponse <String >(Status::CODE_200, " text/html" );
5858 }
5959 ENDPOINT (" GET" , " /" , root) {
6060 const char * html =
@@ -74,27 +74,27 @@ class UserController : public oatpp::web::server::api::ApiController {
7474
7575 ENDPOINT_INFO (createUser) {
7676 info->summary = " Create new User" ;
77- info->addConsumes <UserDto::ObjectWrapper >(" application/json" );
78- info->addResponse <UserDto::ObjectWrapper >(Status::CODE_200, " application/json" );
77+ info->addConsumes <UserDto>(" application/json" );
78+ info->addResponse <UserDto>(Status::CODE_200, " application/json" );
7979 }
8080 ENDPOINT (" POST" , " demo/api/users" , createUser,
81- BODY_DTO (UserDto::ObjectWrapper , userDto)) {
81+ BODY_DTO (UserDto, userDto)) {
8282 return createDtoResponse (Status::CODE_200, m_database->createUser (userDto));
8383 }
8484
8585
8686 ENDPOINT_INFO (putUser) {
8787 // general
8888 info->summary = " Update User by userId" ;
89- info->addConsumes <UserDto::ObjectWrapper >(" application/json" );
90- info->addResponse <UserDto::ObjectWrapper >(Status::CODE_200, " application/json" );
89+ info->addConsumes <UserDto>(" application/json" );
90+ info->addResponse <UserDto>(Status::CODE_200, " application/json" );
9191 info->addResponse <String>(Status::CODE_404, " text/plain" );
9292 // params specific
9393 info->pathParams [" userId" ].description = " User Identifier" ;
9494 }
9595 ENDPOINT (" PUT" , " demo/api/users/{userId}" , putUser,
9696 PATH (Int32, userId),
97- BODY_DTO(UserDto::ObjectWrapper , userDto)) {
97+ BODY_DTO(UserDto, userDto)) {
9898 userDto->id = userId;
9999 return createDtoResponse (Status::CODE_200, m_database->updateUser (userDto));
100100 }
@@ -103,7 +103,7 @@ class UserController : public oatpp::web::server::api::ApiController {
103103 ENDPOINT_INFO (getUserById) {
104104 // general
105105 info->summary = " Get one User by userId" ;
106- info->addResponse <UserDto::ObjectWrapper >(Status::CODE_200, " application/json" );
106+ info->addResponse <UserDto>(Status::CODE_200, " application/json" );
107107 info->addResponse <String>(Status::CODE_404, " text/plain" );
108108 // params specific
109109 info->pathParams [" userId" ].description = " User Identifier" ;
@@ -118,7 +118,7 @@ class UserController : public oatpp::web::server::api::ApiController {
118118
119119 ENDPOINT_INFO (getUsers) {
120120 info->summary = " get all stored users" ;
121- info->addResponse <List<UserDto::ObjectWrapper>::ObjectWrapper >(Status::CODE_200, " application/json" );
121+ info->addResponse <List<UserDto> >(Status::CODE_200, " application/json" );
122122 }
123123 ENDPOINT (" GET" , " demo/api/users" , getUsers) {
124124 return createDtoResponse (Status::CODE_200, m_database->getUsers ());
0 commit comments