mirror of https://github.com/apache/nifi.git
NIFI-12323 Removed String Length Limits from JSON Flow Configuration
- Configured StreamReadConstraints on the ObjectMapper used by StandardDataFlow This closes #7985 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
a89fb17f9f
commit
940c9276c5
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
package org.apache.nifi.cluster.protocol;
|
||||
|
||||
import com.fasterxml.jackson.core.StreamReadConstraints;
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector;
|
||||
|
@ -152,9 +153,14 @@ public class StandardDataFlow implements Serializable, DataFlow {
|
|||
}
|
||||
|
||||
try {
|
||||
final StreamReadConstraints streamReadConstraints = StreamReadConstraints.builder()
|
||||
.maxStringLength(Integer.MAX_VALUE)
|
||||
.build();
|
||||
|
||||
final ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.setAnnotationIntrospector(new JaxbAnnotationIntrospector(objectMapper.getTypeFactory()));
|
||||
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
|
||||
objectMapper.getFactory().setStreamReadConstraints(streamReadConstraints);
|
||||
|
||||
return objectMapper.readValue(flow, VersionedDataflow.class);
|
||||
} catch (final Exception e) {
|
||||
|
|
Loading…
Reference in New Issue