Skip to content

Commit

Permalink
compact api: destination needs to be object (#328)
Browse files Browse the repository at this point in the history
destination is available in IntermodalRoutingRequest
which prevents detection of compact API format
  • Loading branch information
felixguendling authored May 16, 2023
1 parent 1ce7645 commit 180efa2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/module/src/fix_json.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct json_converter {
// or uses the compact format (content only, target taken from URL).
auto add_msg_wrapper = false;
if (is_root && v.IsObject()) {
if (!v.HasMember("destination") && !v.HasMember("content")) {
if (!(v.HasMember("destination") && v.HasMember("content"))) {
add_msg_wrapper = true;
content_only_detected_ = true;
writer_.StartObject();
Expand Down Expand Up @@ -172,7 +172,8 @@ fix_json_result fix_json(std::string const& json,

auto converter = json_converter{writer, target};
converter.fix(d);
return {buffer.GetString(), converter.detected_format()};
return {{buffer.GetString(), buffer.GetLength()},
converter.detected_format()};
}

} // namespace motis::module

0 comments on commit 180efa2

Please # to comment.