Deserializer.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/parser/json/mapping/Deserializer.hpp"

Deserializer

Json deserializer. Deserializes json to oatpp DTO object. See Data Transfer Object(DTO) component.

namespace oatpp { namespace parser { namespace json { namespace mapping { 
  class Deserializer {}
}}}}

Fields

Type Name Summary
v_int32 ERROR_CODE_OBJECT_SCOPE_OPEN "'{' - expected"
v_int32 ERROR_CODE_OBJECT_SCOPE_CLOSE "'}' - expected"
v_int32 ERROR_CODE_OBJECT_SCOPE_UNKNOWN_FIELD "Unknown field"
v_int32 ERROR_CODE_OBJECT_SCOPE_COLON_MISSING "':' - expected"
v_int32 ERROR_CODE_ARRAY_SCOPE_OPEN "'[' - expected"
v_int32 ERROR_CODE_ARRAY_SCOPE_CLOSE "']' - expected"
v_int32 ERROR_CODE_VALUE_BOOLEAN "'true' or 'false' - expected"

Methods

Return Type Name Summary
AbstractObjectWrapper deserialize Deserialize json to oatpp DTO object.

Deserializer::ERROR_CODE_OBJECT_SCOPE_OPEN

"'{' - expected"

static constexpr v_int32 ERROR_CODE_OBJECT_SCOPE_OPEN = 1

Deserializer::ERROR_CODE_OBJECT_SCOPE_CLOSE

"'}' - expected"

static constexpr v_int32 ERROR_CODE_OBJECT_SCOPE_CLOSE = 2

Deserializer::ERROR_CODE_OBJECT_SCOPE_UNKNOWN_FIELD

"Unknown field"

static constexpr v_int32 ERROR_CODE_OBJECT_SCOPE_UNKNOWN_FIELD = 3

Deserializer::ERROR_CODE_OBJECT_SCOPE_COLON_MISSING

"':' - expected"

static constexpr v_int32 ERROR_CODE_OBJECT_SCOPE_COLON_MISSING = 4

Deserializer::ERROR_CODE_ARRAY_SCOPE_OPEN

"'[' - expected"

static constexpr v_int32 ERROR_CODE_ARRAY_SCOPE_OPEN = 5

Deserializer::ERROR_CODE_ARRAY_SCOPE_CLOSE

"']' - expected"

static constexpr v_int32 ERROR_CODE_ARRAY_SCOPE_CLOSE = 6

Deserializer::ERROR_CODE_VALUE_BOOLEAN

"'true' or 'false' - expected"

static constexpr v_int32 ERROR_CODE_VALUE_BOOLEAN = 7

Deserializer::deserialize

Deserialize json to oatpp DTO object.

static AbstractObjectWrapper deserialize(oatpp::parser::Caret& caret,
                                         const std::shared_ptr<Config>& config,
                                         const Type* const type)

Deserializer::Config

Deserializer config.

namespace oatpp { namespace parser { namespace json { namespace mapping { 
  class Deserializer {
    class Config : public oatpp::base::Countable {}
  };
}}}}

Fields

Type Name Summary
bool allowUnknownFields Do not fail if unknown field is found in json. "unknown field" is the one which is not present in DTO object class.

Methods

Return Type Name Summary
[none] Config Constructor.
std::shared_ptr<Config> createShared Create shared Config.

Deserializer::Config::allowUnknownFields

Do not fail if unknown field is found in json. "unknown field" is the one which is not present in DTO object class.

bool allowUnknownFields = true

Deserializer::Config::Config

Constructor.

Config()

Deserializer::Config::createShared

Create shared Config.

  • @return - std::shared_ptr to Config.

static std::shared_ptr<Config> createShared()