Skip to content

Commit

Permalink
Add Kotlinx serialization to Json Element
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasBourdin88 committed May 28, 2024
1 parent 7926a2a commit f2cda73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/infomaniak/lib/core/api/ApiController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ object ApiController {
fun generateRequestBody(body: Any?): RequestBody {
val jsonMediaType = "application/json; charset=utf-8".toMediaTypeOrNull()
val toJson = when (body) {
is JsonElement -> body.toString()
is JsonElement, is com.google.gson.JsonElement -> body.toString()
is String -> body
else -> gson.toJson(body)
}
Expand Down

0 comments on commit f2cda73

Please sign in to comment.