We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When we want to communicate with external endpoints (for example: calling a REST service of an AI endpoint) we want to have this configurable.
An easy way to define the way to communicate with an external service in a customizable way.
We differ here between READ and WRITE templates.
{ "send" : { "targetType" : "$type", "mapping" : { "$sourceKey" : "$destinationKey" } }, "receive" : { "sourceType" : "$type", "mapping" : { "$sourceKey" : "$destinationKey" } } }
{ "send" : { "targetType" : "JSON", "mapping" : { "cweId" : "cwe.id", "language" : "lang", "details" : "cwe.details" } }, "receive" : { "sourceType" : "JSON", "mapping" : { "error" : "result.problem", "status" : "result.status.level", "description" : "content" } } }
CommunicationTemplate template = templateFactory.createFromFile("communicate-ai.json"); val mappingData = new HashMap<String,String>(); mappingData.set("cweId", "79"); mappingData.set("language", "java") mappingData.set("details", "some technical details about the cwe problem" String jsonToSend = template.processSend(data); // ... // REST done, result returned as "resultText" // ... Map<String, String> resultMappingData= template.processReceive(resultText); String content = resultMappingData.get("content");
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Situation
When we want to communicate with external endpoints (for example: calling a REST service of an AI endpoint) we want to have this configurable.
Wanted
An easy way to define the way to communicate with an external service in a customizable way.
Solution
We differ here between READ and WRITE templates.
Template syntax
Example
Usage
The text was updated successfully, but these errors were encountered: