Skip to content

Commit

Permalink
Merge pull request #510 from commercetools/jackson-2.15.2-update
Browse files Browse the repository at this point in the history
Update Jackson to 2.15
  • Loading branch information
dz-commercetools authored Jun 27, 2023
2 parents 5844c32 + a541da3 commit b083016
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion json/json-core/dependencies.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-jackson" % "4.0.6",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.14.2",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.15.2",
"org.typelevel" %% "cats-core" % "2.9.0"
)
3 changes: 2 additions & 1 deletion json/json-core/src/main/scala/io/sphere/json/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package io.sphere
import cats.data.Validated.{Invalid, Valid}
import cats.data.{NonEmptyList, ValidatedNel}
import com.fasterxml.jackson.core.JsonParseException
import com.fasterxml.jackson.core.exc.InputCoercionException
import com.fasterxml.jackson.core.exc.{InputCoercionException, StreamConstraintsException}
import com.fasterxml.jackson.databind.JsonMappingException
import io.sphere.util.Logging
import org.json4s.{DefaultFormats, JsonInput, StringInput}
Expand All @@ -28,6 +28,7 @@ package object json extends Logging {
case e: JsonMappingException => jsonParseError(e.getOriginalMessage)
case e: JsonParseException => jsonParseError(e.getOriginalMessage)
case e: InputCoercionException => jsonParseError(e.getOriginalMessage)
case e: StreamConstraintsException => jsonParseError(e.getOriginalMessage)
}

def parseJSON(json: String): JValidation[JValue] =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package io.sphere.json

import org.scalatest.matchers.must.Matchers
import org.scalatest.wordspec.AnyWordSpec

class SphereJsonParserSpec extends AnyWordSpec with Matchers {
"Object mapper" must {

"accept strings with 20_000_000 bytes" in {
SphereJsonParser.mapper.getFactory.streamReadConstraints().getMaxStringLength must be(
20000000)
}
}
}

0 comments on commit b083016

Please sign in to comment.