Skip to content

Commit

Permalink
Merge pull request #2364 from hongwei1/develop
Browse files Browse the repository at this point in the history
bugfix/tweaked the response body for createMetricJson
  • Loading branch information
simonredfern authored Feb 14, 2024
2 parents e865577 + 38477a8 commit 82b6eb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions obp-api/src/main/scala/code/api/v5_1_0/JSONFactory5.1.0.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import code.metrics.APIMetric
import code.model.Consumer
import net.liftweb.common.{Box, Full}
import net.liftweb.json
import net.liftweb.json.{JValue, parse}
import net.liftweb.json.{JString, JValue, parse, parseOpt}

import scala.collection.immutable.List
import scala.util.Try
Expand Down Expand Up @@ -627,7 +627,7 @@ object JSONFactory510 extends CustomJsonFormats {
duration = metric.getDuration(),
source_ip = metric.getSourceIp(),
target_ip = metric.getTargetIp(),
response_body = parse(metric.getResponseBody())
response_body = parseOpt(metric.getResponseBody()).getOrElse(JString("Not enabled"))
)
}

Expand Down

0 comments on commit 82b6eb9

Please sign in to comment.