Skip to content

Commit 4aff328

Browse files
committed
Update to the latest oatpp API
1 parent 80b4e5a commit 4aff328

File tree

8 files changed

+4
-63
lines changed

8 files changed

+4
-63
lines changed

src/App.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// main.cpp
3-
// web-starter-project
4-
//
5-
// Created by Leonid on 2/12/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#include "./controller/UserController.hpp"
103
#include "./AppComponent.hpp"

src/AppComponent.hpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// AppComponent.hpp
3-
// oatpp-web-starter
4-
//
5-
// Created by Leonid on 3/2/18.
6-
// Copyright © 2018 lganzzzo. All rights reserved.
7-
//
81

92
#ifndef AppComponent_hpp
103
#define AppComponent_hpp
@@ -60,10 +53,8 @@ class AppComponent {
6053
* Create ObjectMapper component to serialize/deserialize DTOs in Contoller's API
6154
*/
6255
OATPP_CREATE_COMPONENT(std::shared_ptr<oatpp::data::mapping::ObjectMapper>, apiObjectMapper)([] {
63-
auto serializerConfig = oatpp::parser::json::mapping::Serializer::Config::createShared();
64-
auto deserializerConfig = oatpp::parser::json::mapping::Deserializer::Config::createShared();
65-
deserializerConfig->allowUnknownFields = false;
66-
auto objectMapper = oatpp::parser::json::mapping::ObjectMapper::createShared(serializerConfig, deserializerConfig);
56+
auto objectMapper = oatpp::parser::json::mapping::ObjectMapper::createShared();
57+
objectMapper->getDeserializer()->getConfig()->allowUnknownFields = false;
6758
return objectMapper;
6859
}());
6960

src/SwaggerComponent.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// SwaggerComponent.hpp
3-
// crud
4-
//
5-
// Created by Leonid on 7/31/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#ifndef SwaggerComponent_hpp
103
#define SwaggerComponent_hpp

src/controller/UserController.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// UserController.hpp
3-
// web-starter-project
4-
//
5-
// Created by Leonid on 2/12/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#ifndef UserController_hpp
103
#define UserController_hpp

src/db/Database.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// Database.cpp
3-
// crud
4-
//
5-
// Created by Leonid on 3/13/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#include "Database.hpp"
103

src/db/Database.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// Database.hpp
3-
// crud
4-
//
5-
// Created by Leonid on 3/13/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#ifndef Database_hpp
103
#define Database_hpp

src/db/model/User.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
//
2-
// User.hpp
3-
// crud
4-
//
5-
// Created by Leonid on 3/13/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
81

92
#ifndef db_User_hpp
103
#define db_User_hpp

src/dto/UserDto.hpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
1-
//
2-
// UserDto.hpp
3-
// crud
4-
//
5-
// Created by Leonid on 3/13/18.
6-
// Copyright © 2018 oatpp. All rights reserved.
7-
//
8-
91
#ifndef UserDto_hpp
102
#define UserDto_hpp
113

12-
#include "oatpp/core/data/mapping/type/Object.hpp"
134
#include "oatpp/core/macro/codegen.hpp"
5+
#include "oatpp/core/Types.hpp"
146

157
#include OATPP_CODEGEN_BEGIN(DTO)
168

179
/**
1810
* Data Transfer Object. Object containing fields only.
1911
* Used in API for serialization/deserialization and validation
2012
*/
21-
class UserDto : public oatpp::data::mapping::type::Object {
13+
class UserDto : public oatpp::Object {
2214

2315
DTO_INIT(UserDto, Object)
2416

0 commit comments

Comments
 (0)