We are implementing an integration service of type OpenAPI (Swagger)
We implemented a Javascript post-processor with the following code:
function postProcess() {
var newOutputParam = new com.hcl.voltmx.middleware.dataobject.Param(); newOutputParam.setName('initialsAvailable'); newOutputParam.setValue(true); result.setParam(newOutputParam);
}
postProcess();
As expected by testing the service the output of the post-processor is:
{
"PostProcessor": {
"Result": {
"opstatus": 0,
"initialsAvailable": "true",
"Records": [],
"httpStatusCode": 200
}
}
}
Now we want to define our own output for the service but we cannot get to build a working mapping.
If we use the following:
We don't get the initialsAvailable value in the response
If we use the alternate below:
We get an error in the log:
- {
- "Performance (in ms)": {
- "BACKEND_REQUEST": 546,
- "PRE_PROCESSOR": 23,
- "POST_PROCESSOR": 5,
- "contype": "OpenAPIAdapter",
- "REQUEST_MAPPER": 0
- },
- "Logs": [
- "[server.console][ERROR][2025-01-27T18:43:33.506+01:00]:[63e73740-c11f-4c6c-968f-6103134867e9]:[]:[]:[http-nio-8080-exec-148]:[ALERT.com.konylabs.middleware.connectors.json.JsonPathEngineImpl:error:93]:uuid=\"07026da95753426f9287b03144f382c1\",dim=\"A\",level=\"ERROR\",comp=\"TEMN-QF-Server Console-com.konylabs.middleware.connectors.json.JsonPathEngineImpl\",cn=\"com.konylabs.middleware.connectors.json.JsonPathEngineImpl:readPathFromDocumentContext:255\",\"QF\":TL=\"Log\",msg=\"No record found in the given path: No results for path: $['initialsAvailable']\""
- ]
- }
We are definetely doing something wrong but we have not found valid end-to-end examples that would allow us to achieve the result we need.
We need to use the boolean value in output to perform validations in an HCL Leap application so the output data type MUST be a boolean property. A string or value in an array would not work.