-
Notifications
You must be signed in to change notification settings - Fork 120
add RouteLeg#notifications #1542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1542 +/- ##
============================================
+ Coverage 78.06% 78.14% +0.08%
- Complexity 1062 1070 +8
============================================
Files 159 161 +2
Lines 4486 4503 +17
Branches 626 626
============================================
+ Hits 3502 3519 +17
Misses 715 715
Partials 269 269
🚀 New features to boost your workflow:
|
|
Flagging that backend API design is still in review so we shouldn't merge until that's finalized. |
1b31190 to
cd98272
Compare
|
Backend API is finilazied https://docs.mapbox.com/api/navigation/directions/#notification-object |
services-directions-models/src/main/java/com/mapbox/api/directions/v5/DirectionsCriteria.java
Outdated
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/DirectionsCriteria.java
Show resolved
Hide resolved
services-directions/src/test/java/com/mapbox/api/directions/v5/MapboxDirectionsTest.java
Show resolved
Hide resolved
|
Also, this will be a breaking change for those who used notifications through unrecognized properties. |
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds notification support to the Mapbox Directions API by introducing a new notifications field to RouteLeg and supporting route options. The change enables clients to receive notifications about route violations (like height/weight restrictions) and alerts (like EV charging station availability) within route responses.
Key changes:
- Added comprehensive notification models (
NotificationandNotificationDetails) with various notification types and subtypes - Added
notificationsparameter toRouteOptionsto control which notifications are included in responses - Integrated notifications support across the API service layer and test coverage
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java | New model class representing route notifications with type, subtype, geometry indices, and details |
| services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/NotificationDetails.java | New model class for notification-specific details like violation values and units |
| services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/RouteLeg.java | Added notifications field to route legs |
| services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/RouteOptions.java | Added notifications parameter to control notification flow |
| services-directions-models/src/main/java/com/mapbox/api/directions/v5/DirectionsCriteria.java | Added extensive constants and annotations for notification types, subtypes, and flow criteria |
| services-directions/src/main/java/com/mapbox/api/directions/v5/DirectionsService.java | Updated API service interface to include notifications parameter |
| services-directions/src/main/java/com/mapbox/api/directions/v5/MapboxDirections.java | Updated API client to pass notifications parameter to service calls |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
...directions-models/src/main/java/com/mapbox/api/directions/v5/models/NotificationDetails.java
Show resolved
Hide resolved
...directions-models/src/main/java/com/mapbox/api/directions/v5/models/NotificationDetails.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/Notification.java
Show resolved
Hide resolved
|
LGTM, but I can't approve my own PR. :) |
No description provided.