diff --git a/include/server/api/route_parameters_grammar.hpp b/include/server/api/route_parameters_grammar.hpp index 28e7e9605..b38080267 100644 --- a/include/server/api/route_parameters_grammar.hpp +++ b/include/server/api/route_parameters_grammar.hpp @@ -42,11 +42,13 @@ struct RouteParametersGrammar : public BaseParametersGrammar &root_rule_) : BaseGrammar(root_rule_) { + using AnnotationsType = engine::api::RouteParameters::AnnotationsType; + const auto add_annotation = [](engine::api::RouteParameters &route_parameters, - engine::api::RouteParameters::AnnotationsType &route_param) { + AnnotationsType route_param) { route_parameters.annotations_type = route_parameters.annotations_type | route_param; - route_parameters.annotations = route_parameters.annotations_type != - engine::api::RouteParameters::AnnotationsType::None; + route_parameters.annotations = + route_parameters.annotations_type != AnnotationsType::None; }; geometries_type.add("geojson", engine::api::RouteParameters::GeometriesType::GeoJSON)( @@ -57,13 +59,9 @@ struct RouteParametersGrammar : public BaseParametersGrammar(std::string{"1,2;3,"} + '\0'), 6); BOOST_CHECK_EQUAL(testInvalidOptions("1,2;3,4?annotations=distances"), 28UL); BOOST_CHECK_EQUAL(testInvalidOptions("1,2;3,4?annotations="), 20UL); + BOOST_CHECK_EQUAL(testInvalidOptions("1,2;3,4?annotations=true,false"), 24UL); BOOST_CHECK_EQUAL( testInvalidOptions("1,2;3,4?annotations=&overview=simplified"), 20UL);