We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c3fb00 commit d80a1baCopy full SHA for d80a1ba
templates/kotlin/src/main/kotlin/io/appwrite/extensions/JsonExtensions.kt.twig
@@ -1,9 +1,14 @@
1
package {{ sdk.namespace | caseDot }}.extensions
2
3
import com.google.gson.Gson
4
-
5
-val gson = Gson()
6
+import com.google.gson.GsonBuilder
+import com.google.gson.reflect.TypeToken
+import {{ sdk.namespace | caseDot }}.json.PreciseNumberAdapter
7
+
8
+val gson = GsonBuilder().registerTypeAdapter(
9
+ object : TypeToken<Map<String, Any>>(){}.type,
10
+ PreciseNumberAdapter()
11
+).create()
12
fun Any.toJson(): String =
13
gson.toJson(this)
14
0 commit comments