mapbox-plugins-android icon indicating copy to clipboard operation
mapbox-plugins-android copied to clipboard

Symbol options does not support kotlinx serialization

Open guillermolc opened this issue 4 years ago • 1 comments

Good morning, I would like to know if you could modify the Symbol Options class in the data property, so that it accepts JsonElements from Kotlinx.

Example:

public class SymbolOptions extends Options<Symbol> { private JsonElement data; ---> This only accept a com.google.gson.JsonElement }

And need

public class SymbolOptions extends Options<Symbol> { private JsonElement data; ---> kotlinx.serialization.json.JsonElement }

It would be nice if you could apply this, especially since many people are starting to use this extension in cross-platform projects and import Gson and Kotlinx Serialization at the same time, it does not make sense :)

Good day

guillermolc avatar Aug 16 '21 15:08 guillermolc

Seems to me like a poor design choice. Including arbitrary in-memory data for each annotation should likely be done using Any? type or at least String? so that we can use our own serialization engines. Ideally, we shouldn't be burdened by whatever serialization library MapBox uses under the hood. Any updates on this?

Nek-12 avatar Feb 10 '22 13:02 Nek-12