-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add serialized warnings array to JSON output (#3588)
* [src/worker.cc] add warnings for deprecated auto-shorter * [tyr/serializers.cc] function to serialize warnings * [serializers.h] declare function for serializeWarnings * [serializers.cc] refactor function for serializeWarnings * [route_serializer_valhalla.cc] add warnings serializing function to route endpoint json response * [serializer.cc] add warning type * [warning] add warning for deprecated auto shorter * [warning] add warning for deprecated hov costing * [warning] add waring for deprecated auto_data_fix * [warning] add warning for deprecated best_paths * [tyr/serializers.cc] refactor serializeWarnings function * [src/worker.cc] refactor warnings object into a function * [tyr/serializer] convert warnings array object to flat array * make warning_text const * overload serializeWarnings function for baldr/json.h * make warning_text a reference * add function overload for serializeWarnings for other endpoints * [isochrone_serializer.cc] add warnings to json output * [locate_serializer.cc] add warning to locate endpoint json output * [matrix_serializer.cc] add warnings to json response * [height_serializer.cc] add warnings to json response * [transit_available_serializer.cc] add warnings to json output * [src/tyr/serializers.cc] refactor serializeWarnings function to remove double array * [trace_serializer.cc] add warnings to json output * refactor function to serialize warnings * [src/worker.cc] make best_paths warning only valid for request with best_paths option * prevent json response from containing an empty warnings array * [test] add test for route endpoint warnings * add array of deprecated costing options for test cases * add test case for locate endpoint * loop through deprecated costing options for route test case * add test case for isochrone endpoint * add test case for transit_available endpoint * add test case for heights endpoint * add test case for map_matching endpoints * add test case for matrix endpoint * change add warnings function to lambda function * [routes] update documentation to include info about warnings * [transit_available] update documentation with information about warnings * [matrix] update documentation with info about warnings * [map-matching] update documentation add information about warnings * [locate] update documentation with information about warnings * [isochrone] update documentation with information about warnings * [elevation] update documentation with information about warnings * code clean up - remove superflfous proto includes * move lambda add_warnings function to worker.h * update CHANGELOG.md with added enhancements * remove loop indexes from route warnings array * convert warnings function to a normal function * add unordered map for warning pairs * modify add_warnings function to utilizie unordered_map for warning pairs * modify warnings messages to use unorderd_map for warning pairs * add codes to serialized warnings * add more context to the warnings array output. * add more context to warnings array output. * update to add more context to warnings array output * add more context to warnings array output * add more context to warnings array * add more context to warnings json * move function definition and warning codes to worker.cc * rewrite tests to all use one map * change variable name from i to costing for looping costing methods * refactor test_warnings.cc to parametized gtest * revert test cases * remove warnings from transit endpoint * remove warnings test for transit endpoint * finish off PR * lint & format; change some docs stuff * untidy * changelog update * Update src/tyr/serializers.cc Co-authored-by: Kevin Kreiser <kevinkreiser@gmail.com> * Apply suggestions from code review Co-authored-by: Kevin Kreiser <kevinkreiser@gmail.com> * github UI conflict resolve failed format.sh * raw strings instead of escaping quotes * changelog * typo * revert gurka changes * changelog * wtf * still.. * remove redundant include Co-authored-by: nilsnolde <nilsnolde@proton.me> Co-authored-by: Kevin Kreiser <kevinkreiser@gmail.com> Co-authored-by: nilsnolde <nils.nolde@gmail.com>
- Loading branch information
1 parent
8017634
commit ae09f91
Showing
23 changed files
with
133 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "gurka.h" | ||
#include <gtest/gtest.h> | ||
#include <vector> | ||
|
||
using namespace valhalla; | ||
|
||
TEST(Warning, DeprecatedParams) { | ||
for (std::string costing : {"auto_shorter", "hov", "auto_data_fix"}) { | ||
Api request; | ||
std::string request_str = | ||
R"({"best_paths": 2, "locations": [{"lat": 0.0, "lon": 0.0},{"lat": 1.0, "lon": 1.0}], "costing": ")" + | ||
costing + R"("})"; | ||
ParseApi(request_str, Options::route, request); | ||
EXPECT_EQ(request.info().warnings_size(), 2); | ||
} | ||
} |
Submodule rapidjson
updated
from 73063f to b16cec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters