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
package rocks.theodolite.kubernetes.slo
import com.google.gson.Gson
import com.fasterxml.jackson.databind.ObjectMapper
import rocks.theodolite.kubernetes.util.PromResult
import rocks.theodolite.kubernetes.util.PromResult
class SloJson constructor(
class SloJson constructor(
@@ -9,7 +9,7 @@ class SloJson constructor(
@@ -9,7 +9,7 @@ class SloJson constructor(
) {
) {
fun toJson(): String {
fun toJson(): String {
return Gson().toJson(
return ObjectMapper().writeValueAsString(
mapOf(
mapOf(
"results" to this.results,
"results" to this.results,
"metadata" to this.metadata
"metadata" to this.metadata
Loading