@@ -67,27 +67,27 @@ class UserController : public oatpp::web::server::api::ApiController {
67
67
68
68
ENDPOINT_INFO (createUser) {
69
69
info->summary = " Create new User" ;
70
- info->addConsumes <UserDto>(" application/json" );
71
- info->addResponse <UserDto>(Status::CODE_200, " application/json" );
70
+ info->addConsumes <Object< UserDto> >(" application/json" );
71
+ info->addResponse <Object< UserDto> >(Status::CODE_200, " application/json" );
72
72
}
73
73
ENDPOINT (" POST" , " demo/api/users" , createUser,
74
- BODY_DTO (UserDto, userDto)) {
74
+ BODY_DTO (Object< UserDto> , userDto)) {
75
75
return createDtoResponse (Status::CODE_200, m_database->createUser (userDto));
76
76
}
77
77
78
78
79
79
ENDPOINT_INFO (putUser) {
80
80
// general
81
81
info->summary = " Update User by userId" ;
82
- info->addConsumes <UserDto>(" application/json" );
83
- info->addResponse <UserDto>(Status::CODE_200, " application/json" );
82
+ info->addConsumes <Object< UserDto> >(" application/json" );
83
+ info->addResponse <Object< UserDto> >(Status::CODE_200, " application/json" );
84
84
info->addResponse <String>(Status::CODE_404, " text/plain" );
85
85
// params specific
86
86
info->pathParams [" userId" ].description = " User Identifier" ;
87
87
}
88
88
ENDPOINT (" PUT" , " demo/api/users/{userId}" , putUser,
89
89
PATH (Int32, userId),
90
- BODY_DTO(UserDto, userDto)) {
90
+ BODY_DTO(Object< UserDto> , userDto)) {
91
91
userDto->id = userId;
92
92
return createDtoResponse (Status::CODE_200, m_database->updateUser (userDto));
93
93
}
@@ -96,7 +96,7 @@ class UserController : public oatpp::web::server::api::ApiController {
96
96
ENDPOINT_INFO (getUserById) {
97
97
// general
98
98
info->summary = " Get one User by userId" ;
99
- info->addResponse <UserDto>(Status::CODE_200, " application/json" );
99
+ info->addResponse <Object< UserDto> >(Status::CODE_200, " application/json" );
100
100
info->addResponse <String>(Status::CODE_404, " text/plain" );
101
101
// params specific
102
102
info->pathParams [" userId" ].description = " User Identifier" ;
@@ -111,7 +111,7 @@ class UserController : public oatpp::web::server::api::ApiController {
111
111
112
112
ENDPOINT_INFO (getUsers) {
113
113
info->summary = " get all stored users" ;
114
- info->addResponse <List<UserDto>>(Status::CODE_200, " application/json" );
114
+ info->addResponse <List<Object< UserDto> >>(Status::CODE_200, " application/json" );
115
115
}
116
116
ENDPOINT (" GET" , " demo/api/users" , getUsers) {
117
117
return createDtoResponse (Status::CODE_200, m_database->getUsers ());
0 commit comments