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- //
81
92#include " ./controller/UserController.hpp"
103#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- //
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
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- //
81
92#ifndef SwaggerComponent_hpp
103#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- //
81
92#ifndef UserController_hpp
103#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- //
81
92#include " Database.hpp"
103
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- //
81
92#ifndef Database_hpp
103#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- //
81
92#ifndef db_User_hpp
103#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-
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
You can’t perform that action at this time.
0 commit comments