|
3 | 3 | _( )/ ___) / \ ( ( \( _ \( _ \ / __)( ) ( ) |
4 | 4 | / \) \\___ \( O )/ / ) / ) __/( (__(_ _)(_ _) |
5 | 5 | \____/(____/ \__/ \_)__)(__\_)(__) \___)(_) (_) |
6 | | - version 1.3.1 |
| 6 | + version 1.3.2 |
7 | 7 | https://github.com/badaix/jsonrpcpp |
8 | 8 |
|
9 | 9 | This file is part of jsonrpc++ |
10 | | - Copyright (C) 2017-2019 Johannes Pohl |
| 10 | + Copyright (C) 2017-2020 Johannes Pohl |
11 | 11 |
|
12 | 12 | This software may be modified and distributed under the terms |
13 | 13 | of the MIT license. See the LICENSE file for details. |
@@ -630,7 +630,7 @@ inline Id::Id(const std::string& id) : Id(id.c_str()) |
630 | 630 | { |
631 | 631 | } |
632 | 632 |
|
633 | | -inline Id::Id(const Json& json_id) : Entity(entity_t::id), type_(value_t::null) |
| 633 | +inline Id::Id(const Json& json_id) : Id() |
634 | 634 | { |
635 | 635 | Id::parse_json(json_id); |
636 | 636 | } |
@@ -802,10 +802,7 @@ inline void Error::parse_json(const Json& json) |
802 | 802 |
|
803 | 803 | inline Json Error::to_json() const |
804 | 804 | { |
805 | | - Json j = { |
806 | | - {"code", code_}, |
807 | | - {"message", message_}, |
808 | | - }; |
| 805 | + Json j = {{"code", code_}, {"message", message_}}; |
809 | 806 |
|
810 | 807 | if (!data_.is_null()) |
811 | 808 | j["data"] = data_; |
@@ -1065,10 +1062,7 @@ inline void Response::parse_json(const Json& json) |
1065 | 1062 |
|
1066 | 1063 | inline Json Response::to_json() const |
1067 | 1064 | { |
1068 | | - Json j = { |
1069 | | - {"jsonrpc", "2.0"}, |
1070 | | - {"id", id_.to_json()}, |
1071 | | - }; |
| 1065 | + Json j = {{"jsonrpc", "2.0"}, {"id", id_.to_json()}}; |
1072 | 1066 |
|
1073 | 1067 | if (error_) |
1074 | 1068 | j["error"] = error_.to_json(); |
@@ -1130,10 +1124,7 @@ inline void Notification::parse_json(const Json& json) |
1130 | 1124 |
|
1131 | 1125 | inline Json Notification::to_json() const |
1132 | 1126 | { |
1133 | | - Json json = { |
1134 | | - {"jsonrpc", "2.0"}, |
1135 | | - {"method", method_}, |
1136 | | - }; |
| 1127 | + Json json = {{"jsonrpc", "2.0"}, {"method", method_}}; |
1137 | 1128 |
|
1138 | 1129 | if (params_) |
1139 | 1130 | json["params"] = params_.to_json(); |
|
0 commit comments