[CppRest] Overload toJson for bool in Modelbase (#5448)

* Add operationId in exception message

* add number data type mapping

* fix_issue5434
This commit is contained in:
Ravi 2017-04-21 09:20:46 -05:00 committed by wing328
parent f61e0d4024
commit e9a438b73f
4 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,7 @@ public:
static web::json::value toJson( int32_t value );
static web::json::value toJson( int64_t value );
static web::json::value toJson( double value );
static web::json::value toJson( bool value );
static int64_t int64_tFromJson(web::json::value& val);
static int32_t int32_tFromJson(web::json::value& val);

View File

@ -31,6 +31,9 @@ web::json::value ModelBase::toJson( int64_t value )
web::json::value ModelBase::toJson( double value )
{
return web::json::value::number(value);
}
web::json::value ModelBase::toJson(bool value) {
return web::json::value::boolean(value);
}
web::json::value ModelBase::toJson( std::shared_ptr<HttpContent> content )

View File

@ -43,6 +43,9 @@ web::json::value ModelBase::toJson( int64_t value )
web::json::value ModelBase::toJson( double value )
{
return web::json::value::number(value);
}
web::json::value ModelBase::toJson(bool value) {
return web::json::value::boolean(value);
}
web::json::value ModelBase::toJson( std::shared_ptr<HttpContent> content )

View File

@ -52,6 +52,7 @@ public:
static web::json::value toJson( int32_t value );
static web::json::value toJson( int64_t value );
static web::json::value toJson( double value );
static web::json::value toJson( bool value );
static int64_t int64_tFromJson(web::json::value& val);
static int32_t int32_tFromJson(web::json::value& val);