-
Notifications
You must be signed in to change notification settings - Fork 120
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
Deprecated serialized fields #1447
Conversation
@@ -968,6 +976,9 @@ public URL toUrl(@NonNull String accessToken) { | |||
if (unrecognized != null) { | |||
for (Map.Entry<String, SerializableJsonElement> entry : unrecognized.entrySet()) { | |||
JsonElement element = entry.getValue().getElement(); | |||
if (DEPRECATED_SERIALIZED_FIELDS.contains(entry.getKey())) { |
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.
@Guardiola31337 , @LukasPaczos , @mapbox/navigation-android , do you think this simple mechanism is sufficient?
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.
LGTM
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.
A warning log could be good.
Codecov Report
@@ Coverage Diff @@
## main #1447 +/- ##
============================================
+ Coverage 75.63% 75.67% +0.04%
- Complexity 879 881 +2
============================================
Files 125 125
Lines 3899 3906 +7
Branches 577 578 +1
============================================
+ Hits 2949 2956 +7
Misses 687 687
Partials 263 263
|
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.
LGTM. Let's add a check (+logs) to toUrl
that checks that we don't have the same queries twice or more time. wdyt?
...es-directions-models/src/test/java/com/mapbox/api/directions/v5/models/RouteOptionsTest.java
Outdated
Show resolved
Hide resolved
services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/RouteOptions.java
Outdated
Show resolved
Hide resolved
@RingerJK , how do you think, what's the best think we can do if there're duplicated parameters? Throw an exceptions with an understandable description? |
I think logs with |
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.
Should we add a sanity test that serializes a legacy DirectionsResponse
JSON like multiple_routes.json
and verifies that the URL doesn't contain neither a duplicated access_token
nor the uuid
? 🤔
509598c
to
d455e67
Compare
added, see |
@RingerJK , @LukasPaczos , I don't see any logging mechanisms in mapbox-java. Do you think it's time to introduce one? TBH, I don't think that it's time 🙂 |
suppose, mapbox-java contains business logic, so it's time to investigate if it needs a logging mechanism. Let's cut a ticket |
|
as we still don't have logger, could you put |
Added to the logger ticket instead #1448 (comment) |
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.
LGTM
mapbox-java used to serialized
access-token
anduuid
when a user callsRouteOptions#toJson()
. You will get an invalid URL If you deserializeRouteOptions
from a json, which containsaccess-token
oruuid
, and then callRouteOptions#toURL
.