File tree Expand file tree Collapse file tree 8 files changed +4
-63
lines changed Expand file tree Collapse file tree 8 files changed +4
-63
lines changed Original file line number Diff line number Diff line change 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
- //
8
1
9
2
#include " ./controller/UserController.hpp"
10
3
#include " ./AppComponent.hpp"
Original file line number Diff line number Diff line change 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
- //
8
1
9
2
#ifndef AppComponent_hpp
10
3
#define AppComponent_hpp
@@ -60,10 +53,8 @@ class AppComponent {
60
53
* Create ObjectMapper component to serialize/deserialize DTOs in Contoller's API
61
54
*/
62
55
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 ;
67
58
return objectMapper;
68
59
}());
69
60
Original file line number Diff line number Diff line change 1
- //
2
- // SwaggerComponent.hpp
3
- // crud
4
- //
5
- // Created by Leonid on 7/31/18.
6
- // Copyright © 2018 oatpp. All rights reserved.
7
- //
8
1
9
2
#ifndef SwaggerComponent_hpp
10
3
#define SwaggerComponent_hpp
Original file line number Diff line number Diff line change 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
- //
8
1
9
2
#ifndef UserController_hpp
10
3
#define UserController_hpp
Original file line number Diff line number Diff line change 1
- //
2
- // Database.cpp
3
- // crud
4
- //
5
- // Created by Leonid on 3/13/18.
6
- // Copyright © 2018 oatpp. All rights reserved.
7
- //
8
1
9
2
#include " Database.hpp"
10
3
Original file line number Diff line number Diff line change 1
- //
2
- // Database.hpp
3
- // crud
4
- //
5
- // Created by Leonid on 3/13/18.
6
- // Copyright © 2018 oatpp. All rights reserved.
7
- //
8
1
9
2
#ifndef Database_hpp
10
3
#define Database_hpp
Original file line number Diff line number Diff line change 1
- //
2
- // User.hpp
3
- // crud
4
- //
5
- // Created by Leonid on 3/13/18.
6
- // Copyright © 2018 oatpp. All rights reserved.
7
- //
8
1
9
2
#ifndef db_User_hpp
10
3
#define db_User_hpp
Original file line number Diff line number Diff line change 1
- //
2
- // UserDto.hpp
3
- // crud
4
- //
5
- // Created by Leonid on 3/13/18.
6
- // Copyright © 2018 oatpp. All rights reserved.
7
- //
8
-
9
1
#ifndef UserDto_hpp
10
2
#define UserDto_hpp
11
3
12
- #include " oatpp/core/data/mapping/type/Object.hpp"
13
4
#include " oatpp/core/macro/codegen.hpp"
5
+ #include " oatpp/core/Types.hpp"
14
6
15
7
#include OATPP_CODEGEN_BEGIN(DTO)
16
8
17
9
/* *
18
10
* Data Transfer Object. Object containing fields only.
19
11
* Used in API for serialization/deserialization and validation
20
12
*/
21
- class UserDto : public oatpp ::data::mapping::type:: Object {
13
+ class UserDto : public oatpp ::Object {
22
14
23
15
DTO_INIT (UserDto, Object)
24
16
You can’t perform that action at this time.
0 commit comments