Skip to content

Commit

Permalink
Update to the latest oatpp API.
Browse files Browse the repository at this point in the history
  • Loading branch information
lganzzzo committed May 23, 2020
1 parent 29e7e4d commit 27ea271
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/DemoApiClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DemoApiClient : public oatpp::web::client::ApiClient {
API_CALL("PATCH", "patch", doPatch, BODY_STRING(String, body))
API_CALL("DELETE", "delete", doDelete)

API_CALL("POST", "post", doPostWithDto, BODY_DTO(MyRequestDto::ObjectWrapper, body))
API_CALL("POST", "post", doPostWithDto, BODY_DTO(Object<MyRequestDto>, body))

API_CALL("GET", "anything/{parameter}", doGetAnything, PATH(String, parameter))
API_CALL("POST", "anything/{parameter}", doPostAnything, PATH(String, parameter), BODY_STRING(String, body))
Expand All @@ -39,7 +39,7 @@ class DemoApiClient : public oatpp::web::client::ApiClient {
API_CALL_ASYNC("PATCH", "patch", doPatchAsync, BODY_STRING(String, body))
API_CALL_ASYNC("DELETE", "delete", doDeleteAsync)

API_CALL_ASYNC("POST", "post", doPostWithDtoAsync, BODY_DTO(MyRequestDto::ObjectWrapper, body))
API_CALL_ASYNC("POST", "post", doPostWithDtoAsync, BODY_DTO(Object<MyRequestDto>, body))

API_CALL_ASYNC("GET", "anything/{parameter}", doGetAnythingAsync, PATH(String, parameter))
API_CALL_ASYNC("POST", "anything/{parameter}", doPostAnythingAsync, PATH(String, parameter), BODY_STRING(String, body))
Expand Down
10 changes: 5 additions & 5 deletions src/DemoApiModels.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
#ifndef DemoApiModels_hpp
#define DemoApiModels_hpp

#include "oatpp/core/data/mapping/type/Object.hpp"
#include "oatpp/core/Types.hpp"
#include "oatpp/core/macro/codegen.hpp"

#include OATPP_CODEGEN_BEGIN(DTO)

class MyRequestDto : public oatpp::data::mapping::type::Object {
class MyRequestDto : public oatpp::DTO {

DTO_INIT(MyRequestDto, Object)
DTO_INIT(MyRequestDto, DTO)

DTO_FIELD(String, message);
DTO_FIELD(Int32, code);

};

class HttpBinResponseDto : public oatpp::data::mapping::type::Object {
class HttpBinResponseDto : public oatpp::DTO {

DTO_INIT(HttpBinResponseDto, Object)
DTO_INIT(HttpBinResponseDto, DTO)

DTO_FIELD(String, data);
DTO_FIELD(Fields<String>::ObjectWrapper, headers);
Expand Down

0 comments on commit 27ea271

Please sign in to comment.