Skip to content
Snippets Groups Projects

Replace GSON with Jackson ObjectMapper

Merged Christopher Konkel requested to merge stu207811/theodolite_fork:Replace-GSON into main
1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
package rocks.theodolite.kubernetes.slo
import com.google.gson.Gson
import com.fasterxml.jackson.databind.ObjectMapper
import khttp.get
import khttp.responses.Response
import mu.KotlinLogging
@@ -68,7 +68,7 @@ class MetricFetcher(private val prometheusURL: String, private val offset: Durat
* @return a [PrometheusResponse]
*/
private fun parseValues(values: Response): PrometheusResponse {
return Gson().fromJson<PrometheusResponse>(
return ObjectMapper().readValue<PrometheusResponse>(
values.jsonObject.toString(),
PrometheusResponse::class.java
)
Loading