File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ class BookController : public oatpp::web::server::api::ApiController {
3535 ENDPOINT_INFO (getBookById) {
3636 // general
3737 info->summary = " Get one Book by bookId" ;
38- info->addResponse <dto::BookInfoDto>(Status::CODE_200, " application/json" );
38+ info->addResponse <oatpp::Object< dto::BookInfoDto> >(Status::CODE_200, " application/json" );
3939 info->addResponse <String>(Status::CODE_404, " text/plain" );
4040 // params specific
4141 info->pathParams [" bookId" ].description = " Book Identifier" ;
@@ -46,12 +46,12 @@ class BookController : public oatpp::web::server::api::ApiController {
4646 auto response = bookService->getBookById (bookId);
4747 OATPP_ASSERT_HTTP (response->getStatusCode () == 200 , Status::CODE_500, " Unable to get book by id" );
4848
49- auto book = response->readBodyToDto <dto::BookDto>(getDefaultObjectMapper ().get ());
49+ auto book = response->readBodyToDto <oatpp::Object< dto::BookDto> >(getDefaultObjectMapper ().get ());
5050
5151 response = userService->getUserById (book->authorId );
5252 OATPP_ASSERT_HTTP (response->getStatusCode () == 200 , Status::CODE_500, " Unable to get user by id" );
5353
54- auto user = response->readBodyToDto <dto::UserDto>(getDefaultObjectMapper ().get ());
54+ auto user = response->readBodyToDto <oatpp::Object< dto::UserDto> >(getDefaultObjectMapper ().get ());
5555
5656 auto bookInfoDto = dto::BookInfoDto::createShared ();
5757 bookInfoDto->id = book->id ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ class BookInfoDto : public oatpp::DTO {
1717
1818 DTO_FIELD (Int64, id);
1919 DTO_FIELD (String, title, " title" );
20- DTO_FIELD (UserDto, author);
20+ DTO_FIELD (Object< UserDto> , author);
2121
2222};
2323
You can’t perform that action at this time.
0 commit comments