Skip to content

Support waypoints per route#1503

Merged
dzinad merged 2 commits intomainfrom
NAVAND-774-dd
Oct 31, 2022
Merged

Support waypoints per route#1503
dzinad merged 2 commits intomainfrom
NAVAND-774-dd

Conversation

@dzinad
Copy link
Copy Markdown
Contributor

@dzinad dzinad commented Oct 26, 2022

No description provided.

@dzinad dzinad requested a review from a team as a code owner October 26, 2022 21:41
@dzinad
Copy link
Copy Markdown
Contributor Author

dzinad commented Oct 26, 2022

Added the DO NOT MERGE label as it seems like it's not ready on the backend yet (I"m clarifying).

@dzinad dzinad requested a review from LukasPaczos October 26, 2022 21:43
@sonatype-lift
Copy link
Copy Markdown

sonatype-lift Bot commented Oct 26, 2022

⚠️ 5 God Classes were detected by Lift in this project. Visit the Lift web console for more details.

@dzinad dzinad force-pushed the NAVAND-774-dd branch 2 times, most recently from aec25b4 to 2068495 Compare October 27, 2022 08:11
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 27, 2022

Codecov Report

Merging #1503 (5a8a80f) into main (8afd9fa) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1503      +/-   ##
============================================
+ Coverage     76.89%   76.90%   +0.01%     
  Complexity      937      937              
============================================
  Files           129      129              
  Lines          4016     4019       +3     
  Branches        582      582              
============================================
+ Hits           3088     3091       +3     
  Misses          678      678              
  Partials        250      250              
Impacted Files Coverage Δ
...x/api/directions/v5/models/DirectionsResponse.java 97.61% <ø> (ø)
...pbox/api/directions/v5/models/DirectionsRoute.java 100.00% <ø> (ø)
.../mapbox/api/directions/v5/models/RouteOptions.java 95.05% <100.00%> (+0.02%) ⬆️
...com/mapbox/api/directions/v5/MapboxDirections.java 89.60% <100.00%> (+0.16%) ⬆️

@dzinad dzinad requested a review from RingerJK October 27, 2022 12:23
@dzinad
Copy link
Copy Markdown
Contributor Author

dzinad commented Oct 27, 2022

Removing the DO NOT MERGE label as it's already supported and working in my example.

* @return list of {@link DirectionsWaypoint} objects ordered from start of route till the end
*/
@Nullable
public abstract List<DirectionsWaypoint> waypoints();
Copy link
Copy Markdown
Contributor

@RingerJK RingerJK Oct 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the following invokes have a very similar signatures, which might lead to mistakes

val waypoints = directionResponse.waypoints()
val waypoints = directionsRoute.waypoints()

let's maybe rename it to

Suggested change
public abstract List<DirectionsWaypoint> waypoints();
public abstract List<DirectionsWaypoint> routeWaypoints();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the parameter name is "waypoints". And you invoke it either on the route object or on the response.
What's more, we've discussed that native waypoints will be the source of truth in the SDK.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the parameter name is "waypoints"

we can use annotation @SerializedName 😃

And you invoke it either on the route object or on the response.
What's more, we've discussed that native waypoints will be the source of truth in the SDK.

the SDK is not the only customer of the mapbox-java, it might be used without the SDK.

I'm just worrying that signatures are really similar and even if you know where your data is, you might make a mistake

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use annotation @SerializedName 😃

I know but I'm just not sure we should use it in this situation and duplicate the knowledge that it's a route waypoint.

I'm just worrying that signatures are really similar and even if you know where your data is, you might make a mistake

But we also have distance and duration for DirectionsRoute, RouteLeg and LegStep.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, it's not a blocker, just a concern. I would hear other opinions, but if there are no any I'm good to keep it as is 👍

*
* @return list of {@link DirectionsWaypoint} objects ordered from start of route till the end
*/
@Nullable
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Nullable
@NonNull

I'm dropping this suggestion but let's double-check with the Nav API team.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed that it's actually Nullable.

@dzinad dzinad merged commit 796f12d into main Oct 31, 2022
@dzinad dzinad deleted the NAVAND-774-dd branch October 31, 2022 12:50
korshaknn added a commit that referenced this pull request Nov 9, 2022
korshaknn added a commit that referenced this pull request Nov 9, 2022
* Revert "Support waypoints per route (#1503)"

This reverts commit 796f12d.

* changelog v6.9.0
korshaknn pushed a commit that referenced this pull request Nov 9, 2022
korshaknn added a commit that referenced this pull request Nov 9, 2022
* Support waypoints per route (#1503)

* changelog v6.10.0-beta.1

Co-authored-by: Dzina Dybouskaya <32109537+dzinad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants