Skip to content

Commit

Permalink
jackson 2.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Nov 16, 2023
1 parent 2f2dd77 commit 704ac5c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ lazy val library =
val argonaut = "6.3.9"
val avro4s = "4.1.1"
val circe = "0.14.1"
val jacksonModuleScala = "2.15.3"
val jacksonModuleScala = "2.16.0"
val json4s = "4.0.6"
val jsoniterScala = "2.24.4"
val ninny = "0.8.2"
Expand Down
11 changes: 10 additions & 1 deletion pekko-http-jackson/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
pekko-http-json {
jackson {
read {
# see https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.15.2/com/fasterxml/jackson/core/StreamReadConstraints.html
# see https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.16.0/com/fasterxml/jackson/core/StreamReadConstraints.html
# these defaults are the same as the defaults in `StreamReadConstraints`
max-nesting-depth = 1000
max-number-length = 1000
max-string-length = 20000000
# following were added in jackson 2.16.0
max-name-length = 50000
# max-document-length of 0 means unlimited
max-document-length = 0
}
write {
# see https://www.javadoc.io/static/com.fasterxml.jackson.core/jackson-core/2.16.0/com/fasterxml/jackson/core/StreamWriteConstraints.html
# these defaults are the same as the defaults in `StreamWriteConstraints`
max-nesting-depth = 1000
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@

package com.github.pjfanning.pekkohttpjackson

import com.fasterxml.jackson.core.{ JsonFactory, JsonFactoryBuilder, StreamReadConstraints }
import com.fasterxml.jackson.core.{
JsonFactory,
JsonFactoryBuilder,
StreamReadConstraints,
StreamWriteConstraints
}
import org.apache.pekko.http.javadsl.common.JsonEntityStreamingSupport
import org.apache.pekko.http.javadsl.marshallers.jackson.Jackson
import org.apache.pekko.http.scaladsl.common.EntityStreamingSupport
Expand Down Expand Up @@ -63,6 +68,12 @@ object JacksonSupport extends JacksonSupport {
.maxNestingDepth(configFactory.getInt("pekko-http-json.jackson.read.max-nesting-depth"))
.maxNumberLength(configFactory.getInt("pekko-http-json.jackson.read.max-number-length"))
.maxStringLength(configFactory.getInt("pekko-http-json.jackson.read.max-string-length"))
.maxNameLength(configFactory.getInt("pekko-http-json.jackson.read.max-name-length"))
.maxDocumentLength(configFactory.getInt("pekko-http-json.jackson.read.max-document-length"))
.build()
val streamWriteConstraints = StreamWriteConstraints
.builder()
.maxNestingDepth(configFactory.getInt("pekko-http-json.jackson.write.max-nesting-depth"))
.build()
val jsonFactoryBuilder: JsonFactoryBuilder = JsonFactory
.builder()
Expand Down

0 comments on commit 704ac5c

Please sign in to comment.