Class EscapeJsonFunction
java.lang.Object
org.citrusframework.functions.core.EscapeJsonFunction
- All Implemented Interfaces:
Function
This function takes a JSON string as input and escapes all double quotes within it.
The input must be a single non-empty string containing a valid JSON, wrapped in double quotes.
If the input is invalid (null, empty, or contains more than one string), an IllegalArgumentException will be thrown.
Example input: "{\"mySuperJson\": \"valium\"}"
Example output: "{\\\"mySuperJson\\\": \\\"valium\\\"}"
-
Field Summary
Fields inherited from interface org.citrusframework.functions.Function
functions, logger, RESOURCE_PATH -
Constructor Summary
Constructors -
Method Summary