Skip to content

Commit cf6b28a

Browse files
committed
Merge branch 'master' of github.com:oatpp/example-crud
2 parents 8d7716f + 2aa8930 commit cf6b28a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ $ docker run -p 8000:8000 -t example-crud
6363
```c++
6464
ENDPOINT_INFO(createUser) {
6565
info->summary = "Create new User";
66-
info->addConsumes<UserDto>("application/json");
67-
info->addResponse<UserDto>(Status::CODE_200, "application/json");
66+
info->addConsumes<Object<UserDto>>("application/json");
67+
info->addResponse<Object<UserDto>>(Status::CODE_200, "application/json");
6868
}
6969
ENDPOINT("POST", "demo/api/users", createUser,
70-
BODY_DTO(UserDto, userDto)) {
70+
BODY_DTO(Object<UserDto>, userDto)) {
7171
return createDtoResponse(Status::CODE_200, m_database->createUser(userDto));
7272
}
7373
```
@@ -77,13 +77,13 @@ ENDPOINT("POST", "demo/api/users", createUser,
7777
```c++
7878
ENDPOINT_INFO(putUser) {
7979
info->summary = "Update User by userId";
80-
info->addConsumes<UserDto>("application/json");
81-
info->addResponse<UserDto>(Status::CODE_200, "application/json");
80+
info->addConsumes<Object<UserDto>>("application/json");
81+
info->addResponse<Object<UserDto>>(Status::CODE_200, "application/json");
8282
info->addResponse<String>(Status::CODE_404, "text/plain");
8383
}
8484
ENDPOINT("PUT", "demo/api/users/{userId}", putUser,
8585
PATH(Int32, userId),
86-
BODY_DTO(UserDto, userDto)) {
86+
BODY_DTO(Object<UserDto>, userDto)) {
8787
userDto->id = userId;
8888
return createDtoResponse(Status::CODE_200, m_database->updateUser(userDto));
8989
}
@@ -94,7 +94,7 @@ ENDPOINT("PUT", "demo/api/users/{userId}", putUser,
9494
```c++
9595
ENDPOINT_INFO(getUserById) {
9696
info->summary = "Get one User by userId";
97-
info->addResponse<UserDto>(Status::CODE_200, "application/json");
97+
info->addResponse<Object<UserDto>>(Status::CODE_200, "application/json");
9898
info->addResponse<String>(Status::CODE_404, "text/plain");
9999
}
100100
ENDPOINT("GET", "demo/api/users/{userId}", getUserById,
@@ -110,7 +110,7 @@ ENDPOINT("GET", "demo/api/users/{userId}", getUserById,
110110
```c++
111111
ENDPOINT_INFO(getUsers) {
112112
info->summary = "get all stored users";
113-
info->addResponse<List<UserDto>>(Status::CODE_200, "application/json");
113+
info->addResponse<List<Object<UserDto>>>(Status::CODE_200, "application/json");
114114
}
115115
ENDPOINT("GET", "demo/api/users", getUsers) {
116116
return createDtoResponse(Status::CODE_200, m_database->getUsers());

0 commit comments

Comments
 (0)