String value length exceeds the maximum allowed
14:55 29 Sep 2024

I'm sending 28MB CSV data as Base64 encoded string in json format to REST API. Below is example of request body.

{
   "csvData" : "ReallyLargeBase64EncodedString"
}

I get this exception when request is sent to API.

JSON parse error: String value length (20051112) exceeds the maximum allowed (20000000, from `StreamReadConstraints.getMaxStringLength()`); nested exception is com.fasterxml.jackson.databind.JsonMappingException: String value length (20051112) exceeds the maximum allowed (20000000, from `StreamReadConstraints.getMaxStringLength()`)

Jackson core version: 2.16.0

Is it possible to increase default size from 20000000 to custom value?

java json spring-mvc jackson