|
16 | 16 |
|
17 | 17 | package com.predic8.membrane.core.lang; |
18 | 18 |
|
19 | | -import com.fasterxml.jackson.databind.*; |
20 | | -import com.predic8.membrane.core.exchange.*; |
21 | | -import com.predic8.membrane.core.http.*; |
22 | | -import com.predic8.membrane.core.interceptor.Interceptor.*; |
23 | | -import com.predic8.membrane.core.lang.groovy.*; |
24 | | -import com.predic8.membrane.core.openapi.serviceproxy.*; |
25 | | -import com.predic8.membrane.core.openapi.util.*; |
26 | | -import com.predic8.membrane.core.router.*; |
27 | | -import com.predic8.membrane.core.util.text.*; |
28 | | -import org.slf4j.*; |
29 | | - |
30 | | -import java.util.*; |
31 | | -import java.util.function.*; |
32 | | - |
33 | | -import static com.predic8.membrane.core.interceptor.Interceptor.Flow.*; |
34 | | -import static com.predic8.membrane.core.openapi.util.UriTemplateMatcher.*; |
35 | | -import static com.predic8.membrane.core.util.FileUtil.*; |
36 | | -import static com.predic8.membrane.core.util.URLParamUtil.*; |
37 | | -import static java.util.Collections.*; |
| 19 | +import com.fasterxml.jackson.databind.ObjectMapper; |
| 20 | +import com.predic8.membrane.core.exchange.Exchange; |
| 21 | +import com.predic8.membrane.core.http.HeaderMap; |
| 22 | +import com.predic8.membrane.core.http.LazyCookieMap; |
| 23 | +import com.predic8.membrane.core.interceptor.Interceptor.Flow; |
| 24 | +import com.predic8.membrane.core.lang.groovy.GroovyBuiltInFunctions; |
| 25 | +import com.predic8.membrane.core.lang.groovy.PathParametersMap; |
| 26 | +import com.predic8.membrane.core.openapi.serviceproxy.APIProxy; |
| 27 | +import com.predic8.membrane.core.openapi.util.PathDoesNotMatchException; |
| 28 | +import com.predic8.membrane.core.router.Router; |
| 29 | +import com.predic8.membrane.core.util.text.SerializationFunction; |
| 30 | +import org.slf4j.Logger; |
| 31 | +import org.slf4j.LoggerFactory; |
| 32 | + |
| 33 | +import java.util.HashMap; |
| 34 | +import java.util.Map; |
| 35 | + |
| 36 | +import static com.predic8.membrane.core.interceptor.Interceptor.Flow.REQUEST; |
| 37 | +import static com.predic8.membrane.core.interceptor.Interceptor.Flow.RESPONSE; |
| 38 | +import static com.predic8.membrane.core.openapi.util.UriTemplateMatcher.matchTemplate; |
| 39 | +import static com.predic8.membrane.core.util.FileUtil.readInputStream; |
| 40 | +import static com.predic8.membrane.core.util.URLParamUtil.getParams; |
| 41 | +import static java.util.Collections.emptyMap; |
38 | 42 |
|
39 | 43 | public class ScriptingUtils { |
40 | 44 |
|
@@ -92,9 +96,9 @@ public static Map<String, Object> createParameterBindings(Router router, Exchang |
92 | 96 | if (includeJsonObject) { |
93 | 97 | try { |
94 | 98 | log.debug("Parsing body as JSON for scripting plugins"); |
95 | | - params.put("json", om.readValue(readInputStream(msg.getBodyAsStreamDecoded()), Map.class)); |
| 99 | + params.put("json", om.readValue(readInputStream(msg.getBodyAsStreamDecoded()), Object.class)); |
96 | 100 | } catch (Exception e) { |
97 | | - log.warn("Can't parse body as JSON", e); |
| 101 | + log.info("Can't parse body as JSON: {}", e.getMessage()); |
98 | 102 | } |
99 | 103 | } |
100 | 104 | } |
|
0 commit comments