Hello,
I tried to apply depthProperties on JSONProvider as told in section
"Controlling Large JAXB XML and JSON input payloads" [1], but with
Badgerfish convention:
<bean class="org.apache.cxf.jaxrs.provider.json.JSONProvider">
<property name="convention" value="badgerfish" />
<property name="depthProperties">
<bean class="org.apache.cxf.staxutils.DocumentDepthProperties">
<property name="innerElementCountThreshold" value="2" />
<property name="innerElementLevelThreshold" value="2" />
</bean>
</property>
</bean>
This has *no* effect. Looking at the source code of JSONProvider class [2],
I realized that this is obviously not supported (see lines of code down
below). However, I could not find any mention of this limitation in the doc
[1].
Shall I create an issue or is this not supported by design for some reason?
In any case, it should be mentioned in the documentation.
Regards,
Cyril
[1]
https://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-ControllingLargeJAXBXMLandJSONinputpayloads
[2]
https://github.com/apache/cxf/blob/master/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/json/JSONProvider.java#L287
Code from JSONProvider class:
protected XMLStreamReader createReader(Class<?> type, InputStream is,
String enc)
throws Exception {
XMLStreamReader reader = null;
if (BADGER_FISH_CONVENTION.equals(convention)) {
reader = JSONUtils.createBadgerFishReader(is, enc);
} else {
reader = JSONUtils.createStreamReader(is,
readXsiType,
namespaceMap,
namespaceSeparator,
primitiveArrayKeys,
getDepthProperties(),
enc);
}
reader = createTransformReaderIfNeeded(reader, is);
return reader;
}