Skip to content

Commit

Permalink
fix copilot unrecognized fields serialization (#6821)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guardiola31337 committed Jan 12, 2023
1 parent cdd594e commit a1d87b6
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import android.content.pm.ApplicationInfo
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ProcessLifecycleOwner
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.mapbox.api.directions.v5.DirectionsAdapterFactory
import com.mapbox.common.UploadOptions
import com.mapbox.geojson.Point
import com.mapbox.geojson.PointAsCoordinatesTypeAdapter
import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
import com.mapbox.navigation.base.route.NavigationRoute
import com.mapbox.navigation.copilot.HistoryAttachmentsUtils.copyToAndRemove
Expand Down Expand Up @@ -397,7 +400,10 @@ internal class MapboxCopilotImpl(

internal companion object {

internal val gson = Gson()
internal val gson = GsonBuilder()
.registerTypeAdapterFactory(DirectionsAdapterFactory.create())
.registerTypeAdapter(Point::class.java, PointAsCoordinatesTypeAdapter())
.create()
internal const val GZ = "gz"
internal const val ZIP = "zip"
internal const val MEDIA_TYPE_ZIP = "application/zip"
Expand Down

0 comments on commit a1d87b6

Please sign in to comment.