Skip to content

Commit

Permalink
feat(UploadRequest): Remove null keys encode to json
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeWeidmann committed Dec 12, 2024
1 parent cde3879 commit dbb17b1
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,16 @@ import io.ktor.http.contentType
import io.ktor.http.isSuccess
import kotlinx.serialization.json.Json
import kotlinx.serialization.json.JsonObject
import kotlinx.serialization.json.encodeToJsonElement

internal class UploadRequest(json: Json, httpClient: HttpClient) : BaseRequest(json, httpClient) {

suspend fun initUpload(initUploadBody: InitUploadBody): InitUploadResponseApi {
return post(url = createUrl(ApiRoutes.initUpload), initUploadBody)
val nullableJson = Json(json) {
explicitNulls = false
}
val encodedInitUploadBody = nullableJson.encodeToJsonElement(initUploadBody)
return post(url = createUrl(ApiRoutes.initUpload), encodedInitUploadBody)
}

suspend fun verifyEmailCode(verifyEmailCodeBody: VerifyEmailCodeBody): AuthorEmailToken {
Expand Down

0 comments on commit dbb17b1

Please sign in to comment.