-
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
Added wrappers for route tile APIs #913
Conversation
ea1541b
to
86d491f
Compare
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.
@devotaaabel this looks great overall, just a couple typos 👍
I know you mentioned you're still working through some tests - we should add some that ensure the response model are properly generated. We do this with the Directions API to ensure everything is being deserialized correctly.
Going to leave the final approval to @osana
services-route-tiles/src/main/java/com/mapbox/api/routetiles/v1/package-info.java
Outdated
Show resolved
Hide resolved
...ces-route-tiles/src/main/java/com/mapbox/api/routetiles/v1/versions/models/package-info.java
Outdated
Show resolved
Hide resolved
d1ce2b1
to
3c7de52
Compare
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.
Looks pretty good.
Once the test passes I fine with it to be pushed.
Serialization if makes sense could be ticketed separately
* {@link MapboxRouteTiles.Builder}. | ||
* | ||
* @param userAgent the user agent | ||
* @param coordinates a string value of the min and max longitude and latitude |
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.
we should specify the order and what separator is used
* @since 4.1.0 | ||
*/ | ||
@AutoValue | ||
public abstract class RouteTileVersionsResponse { |
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.
I believe it should implement Serializable
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.
@osana in what case would it make sense to implement serializable? The gson TypeAdapterFactory
should take care of the conversion to this object from the json response, right?
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.
@devotaaabel thoughout mapbox-java services we support the use of serialize() and deserialize() and serialize()
Line 24 in 3da1ad5
public void testSerializable() throws Exception { |
It can be ticketed and fixed in another pr
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.
ticketed here: #917
* @return this builder for chaining options together | ||
* @since 4.1.0 | ||
*/ | ||
public abstract Builder boundingBox(@NonNull BoundingBox boundingBox); |
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.
It would be nice to have a version that take (minLon, minLat, maxLon, maxLat)
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.
@osana a bounding box can be created with BoundingBox.fromLngLats
, is that 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.
I think it is a helper method so that users did not have to deal with it
I do not have a strong preference about it. Either way is fine.
One big question will be what happens over date line!
5d03217
to
b0fecfa
Compare
b0fecfa
to
e438e67
Compare
Closes #912.
This PR adds a new services module,
services-route-tiles
, which includes the following endpoint wrapper classes:MapboxRouteTiles
MapboxRouteTileVersions
.Please see the route tiles API readme for explanation of the two endpoints.
I'm currently trying to add more meaningful tests, specifically to test the json conversion.