Skip to content

Commit 1a974fb

Browse files
committed
Update to the latest oatpp API
1 parent 94c22e2 commit 1a974fb

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
55
## use these variables to configure module installation
66

77
set(OATPP_THIS_MODULE_NAME oatpp-mbedtls) ## name of the module (also name of folders in installation dirs)
8-
set(OATPP_THIS_MODULE_VERSION "1.0.0") ## version of the module (also sufix of folders in installation dirs)
8+
set(OATPP_THIS_MODULE_VERSION "1.1.0") ## version of the module (also sufix of folders in installation dirs)
99
set(OATPP_THIS_MODULE_LIBRARIES oatpp-mbedtls) ## list of libraries to find when find_package is called
1010
set(OATPP_THIS_MODULE_TARGETS oatpp-mbedtls) ## list of targets to install
1111
set(OATPP_THIS_MODULE_DIRECTORIES oatpp-mbedtls) ## list of directories to install

test/oatpp-mbedtls/FullTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ void FullTest::onRun() {
172172
auto dto = response->readBodyToDto<app::TestDto>(objectMapper.get());
173173
OATPP_ASSERT(dto);
174174
OATPP_ASSERT(dto->testMap);
175-
OATPP_ASSERT(dto->testMap->count() == 3);
176-
OATPP_ASSERT(dto->testMap->get("key1", "") == "value1");
177-
OATPP_ASSERT(dto->testMap->get("key2", "") == "32");
178-
OATPP_ASSERT(dto->testMap->get("key3", "") == oatpp::utils::conversion::float32ToStr(0.32));
175+
OATPP_ASSERT(dto->testMap->size() == 3);
176+
OATPP_ASSERT(dto->testMap["key1"] == "value1");
177+
OATPP_ASSERT(dto->testMap["key2"] == "32");
178+
OATPP_ASSERT(dto->testMap["key3"] == oatpp::utils::conversion::float32ToStr(0.32));
179179
}
180180

181181
{ // test GET with header parameter

test/oatpp-mbedtls/app/Controller.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ class Controller : public oatpp::web::server::api::ApiController {
6767
ENDPOINT("GET", "queries", getWithQueries,
6868
QUERY(String, name), QUERY(Int32, age)) {
6969
auto dto = TestDto::createShared();
70-
dto->testValue = "name=" + name + "&age=" + oatpp::utils::conversion::int32ToStr(age->getValue());
70+
dto->testValue = "name=" + name + "&age=" + oatpp::utils::conversion::int32ToStr(age);
7171
return createDtoResponse(Status::CODE_200, dto);
7272
}
7373

7474
ENDPOINT("GET", "queries/map", getWithQueriesMap,
75-
QUERIES(const QueryParams&, queries)) {
75+
QUERIES(QueryParams, queries)) {
7676
auto dto = TestDto::createShared();
77-
dto->testMap = dto->testMap->createShared();
77+
dto->testMap = Fields<String>::createShared();
7878
for(auto& it : queries.getAll_Unsafe()) {
79-
dto->testMap->put(it.first.toString(), it.second.toString());
79+
dto->testMap->push_back({it.first.toString(), it.second.toString()});
8080
}
8181
return createDtoResponse(Status::CODE_200, dto);
8282
}

test/oatpp-mbedtls/app/DTOs.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@
2525
#ifndef oatpp_test_web_app_DTOs_hpp
2626
#define oatpp_test_web_app_DTOs_hpp
2727

28-
#include "oatpp/core/data/mapping/type/Object.hpp"
2928
#include "oatpp/core/macro/codegen.hpp"
29+
#include "oatpp/core/Types.hpp"
3030

3131
namespace oatpp { namespace test { namespace mbedtls { namespace app {
3232

3333
#include OATPP_CODEGEN_BEGIN(DTO)
3434

35-
class TestDto : public oatpp::data::mapping::type::Object {
35+
class TestDto : public oatpp::Object {
3636

3737
DTO_INIT(TestDto, Object)
3838

3939
DTO_FIELD(String, testValue);
40-
DTO_FIELD(Fields<String>::ObjectWrapper, testMap);
40+
DTO_FIELD(Fields<String>, testMap);
4141

4242
};
4343

0 commit comments

Comments
 (0)