From 716877e49ac2cd52cb23d598b45dc53632109cf9 Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Wed, 15 Jan 2025 12:50:46 +0100 Subject: [PATCH] Temp: Add new EIPGenerator --- .../generators/CamelYAMLSchemaReader.java | 178 ++ .../camelcatalog/generators/EIPGenerator.java | 68 + .../camelcatalog/generators/Generator.java | 5 + .../generators/CamelYAMLSchemaReaderTest.java | 63 + .../generators/EIPGeneratorTest.java | 47 + .../camel-4.9.0-resequence-schema.json | 1794 +++++++++++++++++ 6 files changed, 2155 insertions(+) create mode 100644 packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReader.java create mode 100644 packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/EIPGenerator.java create mode 100644 packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/Generator.java create mode 100644 packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReaderTest.java create mode 100644 packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/EIPGeneratorTest.java create mode 100644 packages/catalog-generator/src/test/resources/camel-4.9.0-resequence-schema.json diff --git a/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReader.java b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReader.java new file mode 100644 index 000000000..11b7b574b --- /dev/null +++ b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReader.java @@ -0,0 +1,178 @@ +package io.kaoto.camelcatalog.generators; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.node.ObjectNode; + +public class CamelYAMLSchemaReader { + + ObjectMapper jsonMapper = new ObjectMapper(); + ObjectNode camelYamlSchemaNode; + + public CamelYAMLSchemaReader(ObjectNode camelYamlSchemaNode) throws JsonProcessingException { + this.camelYamlSchemaNode = camelYamlSchemaNode; + } + + /** + * Get the JSON schema for a given EIP + * The Camel YAML DSL schema is a JSON schema that describes the structure of the + * Camel YAML DSL. + * The steps are: + * 1. Get the JSON schema for a given EIP from the Camel catalog + * 2. Resolve the initial $ref + * 3. Evaluate all fields recursively and inline all the required definitions + * + * @param eipName the name of the EIP to get the JSON schema for + * @return the JSON schema for a given EIP, with the initial $ref resolved and all the required definitions inlined + */ + public ObjectNode getJSONSchema(String eipName) { + var eipNodeRef = (ObjectNode) camelYamlSchemaNode.get("items") + .get("definitions") + .get("org.apache.camel.model.ProcessorDefinition") + .get("properties") + .get(eipName); + if (eipNodeRef.isNull() || !eipNodeRef.has("$ref")) { + return null; + } + + var eipSchemaNode = jsonMapper.createObjectNode(); + + + + + // TODO: Bring the definitions from the Camel YAML DSL schema + // See: io.kaoto.camelcatalog.generator.CamelYamlDslSchemaProcessor.relocateToRootDefinitions + + + + + +// var resolvedNode = getResolvedNode(eipNodeRef); +// eipSchemaNode.setAll(resolvedNode); +// +// setRequiredPropertyIfNeeded(eipSchemaNode); +// extractSingleOneOfFromAnyOf(eipSchemaNode); +// inlineDefinitions(eipSchemaNode); + + + return eipSchemaNode; + } + + + + /** + * Resolve the initial $ref + * Given a node, resolve the initial $ref and return the resolved node + * + * @param node the node to resolve the initial $ref + * @return the resolved node + */ + ObjectNode getResolvedNode(ObjectNode node) { + if (node.has("$ref")) { + String ref = node.get("$ref").asText(); + String[] refPath = ref.split("/"); + + ObjectNode currentNode = camelYamlSchemaNode; + for (String path : refPath) { + if (path.equals("#")) { + currentNode = camelYamlSchemaNode; + } else if (!path.isEmpty()) { + currentNode = (ObjectNode) currentNode.get(path); + } + } + + return currentNode; + } + + return node; + } + + /** + * Initialize the required property if it does not exist + * + * @param node the node to set the required property if it does not exist + */ + void setRequiredPropertyIfNeeded(ObjectNode node) { + if (!node.has("required")) { + node.set("required", jsonMapper.createArrayNode()); + } + } + + /** + * Extract single OneOf definition from AnyOf definition and put it into the + * root definitions. + * It's a workaround for the current Camel YAML DSL JSON schema, where some + * AnyOf definition + * contains only one OneOf definition. + * This is done mostly for the errorHandler definition, f.i. + * ``` + * { + * anyOf: [ + * { + * oneOf: [ + * { type: "object", ... }, + * { type: "object", ... }, + * ] + * }, + * ] + * } + * ``` + * will be transformed into + * ``` + * { + * oneOf: [ + * { type: "object", ... }, + * { type: "object", ... }, + * ] + * } + */ + private void extractSingleOneOfFromAnyOf(ObjectNode node) { + if (!node.has("anyOf")) { + return; + } + var anyOfArray = node.withArray("/anyOf"); + if (anyOfArray.size() != 1) { + return; + } + + var anyOfOneOf = anyOfArray.get(0).withArray("/oneOf"); + node.set("oneOf", anyOfOneOf); + node.remove("anyOf"); + } + + /** + * Inline all the definitions + * Given a node, inline the required definitions from the Camel YAML DSL schema if needed. + * For instance, when a property has a $ref + * { + * "property1": { + * "$ref": "#/definitions/UserDefinition" + * } + * } + * will be transformed into + * { + * "user": { + * "type": "object", + * "properties": { + * "name": { + * "type": "string" + * } + * + * @param node the node to inline the required definitions from the Camel YAML DSL schema + */ + void inlineDefinitions(ObjectNode node) { + if (!node.has("properties")) { + return; + } + + var properties = (ObjectNode) node.get("properties"); + properties.fields().forEachRemaining(entry -> { + var property = (ObjectNode) entry.getValue(); + if (property.has("$ref")) { + var resolvedNode = getResolvedNode(property); + property.setAll(resolvedNode); + inlineDefinitions(property); + } + }); + } +} diff --git a/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/EIPGenerator.java b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/EIPGenerator.java new file mode 100644 index 000000000..61020193a --- /dev/null +++ b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/EIPGenerator.java @@ -0,0 +1,68 @@ +package io.kaoto.camelcatalog.generators; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.camel.catalog.CamelCatalog; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EIPGenerator { + CamelCatalog camelCatalog; + String camelYamlSchema; + ObjectMapper jsonMapper = new ObjectMapper() + .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); + ObjectNode camelYamlSchemaNode; + CamelYAMLSchemaReader camelYAMLSchemaReader; + + public EIPGenerator(CamelCatalog camelCatalog, String camelYamlSchema) throws JsonProcessingException { + this.camelCatalog = camelCatalog; + this.camelYamlSchema = camelYamlSchema; + this.camelYamlSchemaNode = (ObjectNode) jsonMapper.readTree(camelYamlSchema); + this.camelYAMLSchemaReader = new CamelYAMLSchemaReader(camelYamlSchemaNode); + } + + public Map generate() { + Map eipMap = new HashMap<>(); + + getEIPNames().forEach(eipName -> { + var eipJSON = getEIPJson(eipName); + var eipJSONSchema = camelYAMLSchemaReader.getJSONSchema(eipName); + + eipJSON.set("propertiesSchema", eipJSONSchema); + + eipMap.put(eipName, eipJSON); + }); + + return eipMap; + } + + List getEIPNames() { + var iterator = this.camelYamlSchemaNode.get("items").get("definitions") + .get("org.apache.camel.model.ProcessorDefinition") + .get("properties") + .fields(); + + List eipNames = new ArrayList<>(); + while (iterator.hasNext()) { + var entry = iterator.next(); + eipNames.add(entry.getKey()); + } + + return eipNames; + } + + ObjectNode getEIPJson(String eipName) { + String eipJson = camelCatalog.modelJSonSchema(eipName); + + try { + return (ObjectNode) jsonMapper.readTree(eipJson); + } catch (JsonProcessingException e) { + throw new RuntimeException(String.format("Cannot load %s JSON model", eipName), e); + } + } +} diff --git a/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/Generator.java b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/Generator.java new file mode 100644 index 000000000..7b8a96667 --- /dev/null +++ b/packages/catalog-generator/src/main/java/io/kaoto/camelcatalog/generators/Generator.java @@ -0,0 +1,5 @@ +package io.kaoto.camelcatalog.generators; + +public interface Generator { + +} diff --git a/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReaderTest.java b/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReaderTest.java new file mode 100644 index 000000000..a2cb9000c --- /dev/null +++ b/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/CamelYAMLSchemaReaderTest.java @@ -0,0 +1,63 @@ +package io.kaoto.camelcatalog.generators; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.node.ObjectNode; +import org.apache.camel.dsl.yaml.YamlRoutesBuilderLoader; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +class CamelYAMLSchemaReaderTest { + CamelYAMLSchemaReader camelYAMLSchemaReader; + + @BeforeEach + void setUp() throws IOException { + ObjectMapper jsonMapper = new ObjectMapper() + .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true); + + ObjectNode camelYamlSchemaNode; + try (var is = YamlRoutesBuilderLoader.class.getClassLoader().getResourceAsStream("schema/camelYamlDsl.json")) { + assert is != null; + var camelYamlSchema = new String(is.readAllBytes(), StandardCharsets.UTF_8); + camelYamlSchemaNode = (ObjectNode) jsonMapper.readTree(camelYamlSchema); + } + + camelYAMLSchemaReader = new CamelYAMLSchemaReader(camelYamlSchemaNode); + + var resequenceSchemaNode = (ObjectNode) jsonMapper.readTree( + getClass().getClassLoader().getResourceAsStream("camel-4.9.0-resequence-schema.json")); + } + + @Test + void shouldReturnJSONSchemaForEIP() { + var eipName = "resequence"; + var eipSchema = camelYAMLSchemaReader.getJSONSchema(eipName); + + assertNotNull(eipSchema); + assertTrue(eipSchema.has("type")); + assertTrue(eipSchema.has("properties")); + assertTrue(eipSchema.has("required")); + } + + @Test + void shouldInlineDefinitions() { + var eipName = "resequence"; + var eipSchema = camelYAMLSchemaReader.getJSONSchema(eipName); + + assertTrue(eipSchema.has("items")); + var itemsNode = (ObjectNode) eipSchema.get("items"); + + assertTrue(itemsNode.has("definitions")); + var definitionsNode = (ObjectNode) itemsNode.get("definitions"); + + assertTrue(definitionsNode.has("org.apache.camel.model.config.BatchResequencerConfig")); + assertTrue(definitionsNode.has("org.apache.camel.model.config.StreamResequencerConfig")); + assertTrue(definitionsNode.has("org.apache.camel.model.language.ExpressionDefinition")); + } +} \ No newline at end of file diff --git a/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/EIPGeneratorTest.java b/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/EIPGeneratorTest.java new file mode 100644 index 000000000..3da524160 --- /dev/null +++ b/packages/catalog-generator/src/test/java/io/kaoto/camelcatalog/generators/EIPGeneratorTest.java @@ -0,0 +1,47 @@ +package io.kaoto.camelcatalog.generators; + +import org.apache.camel.catalog.CamelCatalog; +import org.apache.camel.catalog.DefaultCamelCatalog; +import org.apache.camel.dsl.yaml.YamlRoutesBuilderLoader; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +class EIPGeneratorTest { + EIPGenerator eipGenerator; + + @BeforeEach + void setUp() throws IOException { + CamelCatalog camelCatalog = new DefaultCamelCatalog(); + String camelYamlSchema; + try (var is = YamlRoutesBuilderLoader.class.getClassLoader().getResourceAsStream("schema/camelYamlDsl.json")) { + assert is != null; + camelYamlSchema = new String(is.readAllBytes(), StandardCharsets.UTF_8); + } + + eipGenerator = new EIPGenerator(camelCatalog, camelYamlSchema); + } + + @Test + void shouldContainAListOfEips() { + var eipsMap = eipGenerator.generate(); + + assertTrue(eipsMap.containsKey("aggregate")); + assertTrue(eipsMap.containsKey("to")); + assertTrue(eipsMap.containsKey("setHeader")); + assertTrue(eipsMap.containsKey("setHeaders")); + + assertTrue(eipsMap.containsKey("choice")); + assertTrue(eipsMap.containsKey("doTry")); + + /* These are special cases, while they are processors, they cannot be used directly */ + assertTrue(eipsMap.containsKey("when")); + assertTrue(eipsMap.containsKey("otherwise")); + assertTrue(eipsMap.containsKey("doCatch")); + assertTrue(eipsMap.containsKey("doFinally")); + } +} \ No newline at end of file diff --git a/packages/catalog-generator/src/test/resources/camel-4.9.0-resequence-schema.json b/packages/catalog-generator/src/test/resources/camel-4.9.0-resequence-schema.json new file mode 100644 index 000000000..f9056cbfb --- /dev/null +++ b/packages/catalog-generator/src/test/resources/camel-4.9.0-resequence-schema.json @@ -0,0 +1,1794 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "items": { + "definitions": { + "org.apache.camel.model.ResequenceDefinition": { + "title": "Resequence", + "description": "Resequences (re-order) messages based on an expression", + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "oneOf": [ + { + "$ref": "#/items/definitions/org.apache.camel.model.language.ExpressionDefinition" + }, + { + "not": { + "anyOf": [ + { + "required": [ + "expression" + ] + }, + { + "required": [ + "constant" + ] + }, + { + "required": [ + "csimple" + ] + }, + { + "required": [ + "datasonnet" + ] + }, + { + "required": [ + "exchangeProperty" + ] + }, + { + "required": [ + "groovy" + ] + }, + { + "required": [ + "header" + ] + }, + { + "required": [ + "hl7terser" + ] + }, + { + "required": [ + "java" + ] + }, + { + "required": [ + "joor" + ] + }, + { + "required": [ + "jq" + ] + }, + { + "required": [ + "js" + ] + }, + { + "required": [ + "jsonpath" + ] + }, + { + "required": [ + "language" + ] + }, + { + "required": [ + "method" + ] + }, + { + "required": [ + "mvel" + ] + }, + { + "required": [ + "ognl" + ] + }, + { + "required": [ + "python" + ] + }, + { + "required": [ + "ref" + ] + }, + { + "required": [ + "simple" + ] + }, + { + "required": [ + "spel" + ] + }, + { + "required": [ + "tokenize" + ] + }, + { + "required": [ + "variable" + ] + }, + { + "required": [ + "wasm" + ] + }, + { + "required": [ + "xpath" + ] + }, + { + "required": [ + "xquery" + ] + }, + { + "required": [ + "xtokenize" + ] + } + ] + } + }, + { + "type": "object", + "required": [ + "expression" + ], + "properties": { + "expression": { + "title": "Expression", + "description": "Expression to use for re-ordering the messages, such as a header with a sequence number", + "$ref": "#/items/definitions/org.apache.camel.model.language.ExpressionDefinition" + } + } + } + ] + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "batchConfig" + ], + "properties": { + "batchConfig": { + "$ref": "#/items/definitions/org.apache.camel.model.config.BatchResequencerConfig" + } + } + }, + { + "not": { + "anyOf": [ + { + "required": [ + "batchConfig" + ] + }, + { + "required": [ + "streamConfig" + ] + } + ] + } + }, + { + "type": "object", + "required": [ + "streamConfig" + ], + "properties": { + "streamConfig": { + "$ref": "#/items/definitions/org.apache.camel.model.config.StreamResequencerConfig" + } + } + } + ] + } + ], + "properties": { + "description": { + "type": "string", + "title": "Description", + "description": "Sets the description of this node" + }, + "disabled": { + "type": "boolean", + "title": "Disabled", + "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "steps": { + "type": "array", + "items": { + "$ref": "#/items/definitions/org.apache.camel.model.ProcessorDefinition" + } + }, + "constant": {}, + "csimple": {}, + "datasonnet": {}, + "exchangeProperty": {}, + "groovy": {}, + "header": {}, + "hl7terser": {}, + "java": {}, + "joor": {}, + "jq": {}, + "js": {}, + "jsonpath": {}, + "language": {}, + "method": {}, + "mvel": {}, + "ognl": {}, + "python": {}, + "ref": {}, + "simple": {}, + "spel": {}, + "tokenize": {}, + "variable": {}, + "wasm": {}, + "xpath": {}, + "xquery": {}, + "xtokenize": {}, + "expression": {}, + "batchConfig": {}, + "streamConfig": {} + } + }, + "org.apache.camel.model.config.BatchResequencerConfig": { + "title": "Batch Config", + "description": "Configures batch-processing resequence eip.", + "type": "object", + "additionalProperties": false, + "properties": { + "allowDuplicates": { + "type": "boolean", + "title": "Allow Duplicates", + "description": "Whether to allow duplicates." + }, + "batchSize": { + "type": "number", + "title": "Batch Size", + "description": "Sets the size of the batch to be re-ordered. The default size is 100.", + "default": "100" + }, + "batchTimeout": { + "type": "string", + "title": "Batch Timeout", + "description": "Sets the timeout for collecting elements to be re-ordered. The default timeout is 1000 msec.", + "default": "1000" + }, + "ignoreInvalidExchanges": { + "type": "boolean", + "title": "Ignore Invalid Exchanges", + "description": "Whether to ignore invalid exchanges" + }, + "reverse": { + "type": "boolean", + "title": "Reverse", + "description": "Whether to reverse the ordering." + } + } + }, + "org.apache.camel.model.config.StreamResequencerConfig": { + "title": "Stream Config", + "description": "Configures stream-processing resequence eip.", + "type": "object", + "additionalProperties": false, + "properties": { + "capacity": { + "type": "number", + "title": "Capacity", + "description": "Sets the capacity of the resequencer inbound queue.", + "default": "1000" + }, + "comparator": { + "type": "string", + "title": "Comparator", + "description": "To use a custom comparator as a org.apache.camel.processor.resequencer.ExpressionResultComparator type." + }, + "deliveryAttemptInterval": { + "type": "string", + "title": "Delivery Attempt Interval", + "description": "Sets the interval in milliseconds the stream resequencer will at most wait while waiting for condition of being able to deliver.", + "default": "1000" + }, + "ignoreInvalidExchanges": { + "type": "boolean", + "title": "Ignore Invalid Exchanges", + "description": "Whether to ignore invalid exchanges" + }, + "rejectOld": { + "type": "boolean", + "title": "Reject Old", + "description": "If true, throws an exception when messages older than the last delivered message are processed" + }, + "timeout": { + "type": "string", + "title": "Timeout", + "description": "Sets minimum time (milliseconds) to wait for missing elements (messages).", + "default": "1000" + } + } + }, + "org.apache.camel.model.language.CSimpleExpression": { + "title": "CSimple", + "description": "Evaluate a compiled simple expression.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.ConstantExpression": { + "title": "Constant", + "description": "A fixed value set only once during the route startup.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.DatasonnetExpression": { + "title": "DataSonnet", + "description": "To use DataSonnet scripts for message transformations.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "bodyMediaType": { + "type": "string", + "title": "Body Media Type", + "description": "The String representation of the message's body MediaType" + }, + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "outputMediaType": { + "type": "string", + "title": "Output Media Type", + "description": "The String representation of the MediaType to output" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.ExchangePropertyExpression": { + "title": "ExchangeProperty", + "description": "Gets a property from the Exchange.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.ExpressionDefinition": { + "type": "object", + "anyOf": [ + { + "oneOf": [ + { + "type": "object", + "required": ["constant"], + "properties": { + "constant": { + "$ref": "#/items/definitions/org.apache.camel.model.language.ConstantExpression" + } + } + }, + { + "type": "object", + "required": ["csimple"], + "properties": { + "csimple": { + "$ref": "#/items/definitions/org.apache.camel.model.language.CSimpleExpression" + } + } + }, + { + "type": "object", + "required": ["datasonnet"], + "properties": { + "datasonnet": { + "$ref": "#/items/definitions/org.apache.camel.model.language.DatasonnetExpression" + } + } + }, + { + "type": "object", + "required": ["exchangeProperty"], + "properties": { + "exchangeProperty": { + "$ref": "#/items/definitions/org.apache.camel.model.language.ExchangePropertyExpression" + } + } + }, + { + "type": "object", + "required": ["groovy"], + "properties": { + "groovy": { + "$ref": "#/items/definitions/org.apache.camel.model.language.GroovyExpression" + } + } + }, + { + "type": "object", + "required": ["header"], + "properties": { + "header": { + "$ref": "#/items/definitions/org.apache.camel.model.language.HeaderExpression" + } + } + }, + { + "type": "object", + "required": ["hl7terser"], + "properties": { + "hl7terser": { + "$ref": "#/items/definitions/org.apache.camel.model.language.Hl7TerserExpression" + } + } + }, + { + "type": "object", + "required": ["java"], + "properties": { + "java": { + "$ref": "#/items/definitions/org.apache.camel.model.language.JavaExpression" + } + } + }, + { + "type": "object", + "required": ["joor"], + "properties": { + "joor": { + "$ref": "#/items/definitions/org.apache.camel.model.language.JoorExpression" + } + } + }, + { + "type": "object", + "required": ["jq"], + "properties": { + "jq": { + "$ref": "#/items/definitions/org.apache.camel.model.language.JqExpression" + } + } + }, + { + "type": "object", + "required": ["js"], + "properties": { + "js": { + "$ref": "#/items/definitions/org.apache.camel.model.language.JavaScriptExpression" + } + } + }, + { + "type": "object", + "required": ["jsonpath"], + "properties": { + "jsonpath": { + "$ref": "#/items/definitions/org.apache.camel.model.language.JsonPathExpression" + } + } + }, + { + "type": "object", + "required": ["language"], + "properties": { + "language": { + "$ref": "#/items/definitions/org.apache.camel.model.language.LanguageExpression" + } + } + }, + { + "type": "object", + "required": ["method"], + "properties": { + "method": { + "$ref": "#/items/definitions/org.apache.camel.model.language.MethodCallExpression" + } + } + }, + { + "type": "object", + "required": ["mvel"], + "properties": { + "mvel": { + "$ref": "#/items/definitions/org.apache.camel.model.language.MvelExpression" + } + } + }, + { + "type": "object", + "required": ["ognl"], + "properties": { + "ognl": { + "$ref": "#/items/definitions/org.apache.camel.model.language.OgnlExpression" + } + } + }, + { + "type": "object", + "required": ["python"], + "properties": { + "python": { + "$ref": "#/items/definitions/org.apache.camel.model.language.PythonExpression" + } + } + }, + { + "type": "object", + "required": ["ref"], + "properties": { + "ref": { + "$ref": "#/items/definitions/org.apache.camel.model.language.RefExpression" + } + } + }, + { + "type": "object", + "required": ["simple"], + "properties": { + "simple": { + "$ref": "#/items/definitions/org.apache.camel.model.language.SimpleExpression" + } + } + }, + { + "type": "object", + "required": ["spel"], + "properties": { + "spel": { + "$ref": "#/items/definitions/org.apache.camel.model.language.SpELExpression" + } + } + }, + { + "type": "object", + "required": ["tokenize"], + "properties": { + "tokenize": { + "$ref": "#/items/definitions/org.apache.camel.model.language.TokenizerExpression" + } + } + }, + { + "type": "object", + "required": ["variable"], + "properties": { + "variable": { + "$ref": "#/items/definitions/org.apache.camel.model.language.VariableExpression" + } + } + }, + { + "type": "object", + "required": ["wasm"], + "properties": { + "wasm": { + "$ref": "#/items/definitions/org.apache.camel.model.language.WasmExpression" + } + } + }, + { + "type": "object", + "required": ["xpath"], + "properties": { + "xpath": { + "$ref": "#/items/definitions/org.apache.camel.model.language.XPathExpression" + } + } + }, + { + "type": "object", + "required": ["xquery"], + "properties": { + "xquery": { + "$ref": "#/items/definitions/org.apache.camel.model.language.XQueryExpression" + } + } + }, + { + "type": "object", + "required": ["xtokenize"], + "properties": { + "xtokenize": { + "$ref": "#/items/definitions/org.apache.camel.model.language.XMLTokenizerExpression" + } + } + } + ] + } + ], + "properties": { + "constant": {}, + "csimple": {}, + "datasonnet": {}, + "exchangeProperty": {}, + "groovy": {}, + "header": {}, + "hl7terser": {}, + "java": {}, + "joor": {}, + "jq": {}, + "js": {}, + "jsonpath": {}, + "language": {}, + "method": {}, + "mvel": {}, + "ognl": {}, + "python": {}, + "ref": {}, + "simple": {}, + "spel": {}, + "tokenize": {}, + "variable": {}, + "wasm": {}, + "xpath": {}, + "xquery": {}, + "xtokenize": {} + } + }, + "org.apache.camel.model.language.GroovyExpression": { + "title": "Groovy", + "description": "Evaluates a Groovy script.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.HeaderExpression": { + "title": "Header", + "description": "Gets a header from the Exchange.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.Hl7TerserExpression": { + "title": "HL7 Terser", + "description": "Get the value of a HL7 message field specified by terse location specification syntax.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.JavaExpression": { + "title": "Java", + "description": "Evaluates a Java (Java compiled once at runtime) expression.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "preCompile": { + "type": "boolean", + "title": "Pre Compile", + "description": "Whether the expression should be pre compiled once during initialization phase. If this is turned off, then the expression is reloaded and compiled on each evaluation." + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "singleQuotes": { + "type": "boolean", + "title": "Single Quotes", + "description": "Whether single quotes can be used as replacement for double quotes. This is convenient when you need to work with strings inside strings." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.JavaScriptExpression": { + "title": "JavaScript", + "description": "Evaluates a JavaScript expression.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.JoorExpression": { + "title": "jOOR", + "description": "Evaluates a jOOR (Java compiled once at runtime) expression.", + "deprecated": true, + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "preCompile": { + "type": "boolean", + "title": "Pre Compile", + "description": "Whether the expression should be pre compiled once during initialization phase. If this is turned off, then the expression is reloaded and compiled on each evaluation." + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "singleQuotes": { + "type": "boolean", + "title": "Single Quotes", + "description": "Whether single quotes can be used as replacement for double quotes. This is convenient when you need to work with strings inside strings." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.JqExpression": { + "title": "JQ", + "description": "Evaluates a JQ expression against a JSON message body.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.JsonPathExpression": { + "title": "JSONPath", + "description": "Evaluates a JSONPath expression against a JSON message body.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "allowEasyPredicate": { + "type": "boolean", + "title": "Allow Easy Predicate", + "description": "Whether to allow using the easy predicate parser to pre-parse predicates." + }, + "allowSimple": { + "type": "boolean", + "title": "Allow Simple", + "description": "Whether to allow in inlined Simple exceptions in the JSONPath expression" + }, + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "option": { + "type": "string", + "title": "Option", + "description": "To configure additional options on JSONPath. Multiple values can be separated by comma.", + "enum": [ + "DEFAULT_PATH_LEAF_TO_NULL", + "ALWAYS_RETURN_LIST", + "AS_PATH_LIST", + "SUPPRESS_EXCEPTIONS", + "REQUIRE_PROPERTIES" + ] + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "suppressExceptions": { + "type": "boolean", + "title": "Suppress Exceptions", + "description": "Whether to suppress exceptions such as PathNotFoundException." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + }, + "unpackArray": { + "type": "boolean", + "title": "Unpack Array", + "description": "Whether to unpack a single element json-array into an object." + }, + "writeAsString": { + "type": "boolean", + "title": "Write As String", + "description": "Whether to write the output of each row/element as a JSON String value instead of a Map/POJO value." + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.LanguageExpression": { + "title": "Language", + "description": "Evaluates a custom language.", + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "language": { + "type": "string", + "title": "Language", + "description": "The name of the language to use" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + }, + "required": ["expression", "language"] + }, + "org.apache.camel.model.language.MethodCallExpression": { + "title": "Bean Method", + "description": "Calls a Java bean method.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "beanType": { + "type": "string", + "title": "Bean Type", + "description": "Class name (fully qualified) of the bean to use Will lookup in registry and if there is a single instance of the same type, then the existing bean is used, otherwise a new bean is created (requires a default no-arg constructor)." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "method": { + "type": "string", + "title": "Method", + "description": "Name of method to call" + }, + "ref": { + "type": "string", + "title": "Ref", + "description": "Reference to an existing bean (bean id) to lookup in the registry" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "scope": { + "type": "string", + "title": "Scope", + "description": "Scope of bean. When using singleton scope (default) the bean is created or looked up only once and reused for the lifetime of the endpoint. The bean should be thread-safe in case concurrent threads is calling the bean at the same time. When using request scope the bean is created or looked up once per request (exchange). This can be used if you want to store state on a bean while processing a request and you want to call the same bean instance multiple times while processing the request. The bean does not have to be thread-safe as the instance is only called from the same request. When using prototype scope, then the bean will be looked up or created per call. However in case of lookup then this is delegated to the bean registry such as Spring or CDI (if in use), which depends on their configuration can act as either singleton or prototype scope. So when using prototype scope then this depends on the bean registry implementation.", + "default": "Singleton", + "enum": ["Singleton", "Request", "Prototype"] + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + }, + "validate": { + "type": "boolean", + "title": "Validate", + "description": "Whether to validate the bean has the configured method." + } + } + } + ] + }, + "org.apache.camel.model.language.MvelExpression": { + "title": "MVEL", + "description": "Evaluates a MVEL template.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.OgnlExpression": { + "title": "OGNL", + "description": "Evaluates an OGNL expression (Apache Commons OGNL).", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.PythonExpression": { + "title": "Python", + "description": "Evaluates a Python expression.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.RefExpression": { + "title": "Ref", + "description": "Uses an existing expression from the registry.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.SimpleExpression": { + "title": "Simple", + "description": "Evaluates a Camel simple expression.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.SpELExpression": { + "title": "SpEL", + "description": "Evaluates a Spring expression (SpEL).", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.TokenizerExpression": { + "title": "Tokenize", + "description": "Tokenize text payloads using delimiter patterns.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "endToken": { + "type": "string", + "title": "End Token", + "description": "The end token to use as tokenizer if using start/end token pairs. You can use simple language as the token to support dynamic tokens." + }, + "group": { + "type": "string", + "title": "Group", + "description": "To group N parts together, for example to split big files into chunks of 1000 lines. You can use simple language as the group to support dynamic group sizes." + }, + "groupDelimiter": { + "type": "string", + "title": "Group Delimiter", + "description": "Sets the delimiter to use when grouping. If this has not been set then token will be used as the delimiter." + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "includeTokens": { + "type": "boolean", + "title": "Include Tokens", + "description": "Whether to include the tokens in the parts when using pairs. When including tokens then the endToken property must also be configured (to use pair mode). The default value is false" + }, + "inheritNamespaceTagName": { + "type": "string", + "title": "Inherit Namespace Tag Name", + "description": "To inherit namespaces from a root/parent tag name when using XML You can use simple language as the tag name to support dynamic names." + }, + "regex": { + "type": "boolean", + "title": "Regex", + "description": "If the token is a regular expression pattern. The default value is false" + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "skipFirst": { + "type": "boolean", + "title": "Skip First", + "description": "To skip the very first element" + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "token": { + "type": "string", + "title": "Token", + "description": "The (start) token to use as tokenizer, for example you can use the new line token. You can use simple language as the token to support dynamic tokens." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + }, + "xml": { + "type": "boolean", + "title": "Xml", + "description": "Whether the input is XML messages. This option must be set to true if working with XML payloads." + } + } + } + ], + "required": ["token"] + }, + "org.apache.camel.model.language.VariableExpression": { + "title": "Variable", + "description": "Gets a variable", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.WasmExpression": { + "title": "Wasm", + "description": "Call a wasm (web assembly) function.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "module": { + "type": "string", + "title": "Module", + "description": "Set the module (the distributable, loadable, and executable unit of code in WebAssembly) resource that provides the expression function." + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression", "module"] + }, + "org.apache.camel.model.language.XMLTokenizerExpression": { + "title": "XML Tokenize", + "description": "Tokenize XML payloads.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "group": { + "type": "number", + "title": "Group", + "description": "To group N parts together" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "mode": { + "type": "string", + "title": "Mode", + "description": "The extraction mode. The available extraction modes are: i - injecting the contextual namespace bindings into the extracted token (default) w - wrapping the extracted token in its ancestor context u - unwrapping the extracted token to its child content t - extracting the text content of the specified element", + "default": "i", + "enum": ["i", "w", "u", "t"] + }, + "namespace": { + "type": "array", + "title": "Namespace", + "description": "Injects the XML Namespaces of prefix - uri mappings", + "items": { + "$ref": "#/items/definitions/org.apache.camel.model.PropertyDefinition" + } + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.XPathExpression": { + "title": "XPath", + "description": "Evaluates an XPath expression against an XML payload.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "documentType": { + "type": "string", + "title": "Document Type", + "description": "Name of class for document type The default value is org.w3c.dom.Document" + }, + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "factoryRef": { + "type": "string", + "title": "Factory Ref", + "description": "References to a custom XPathFactory to lookup in the registry" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "logNamespaces": { + "type": "boolean", + "title": "Log Namespaces", + "description": "Whether to log namespaces which can assist during troubleshooting" + }, + "namespace": { + "type": "array", + "title": "Namespace", + "description": "Injects the XML Namespaces of prefix - uri mappings", + "items": { + "$ref": "#/items/definitions/org.apache.camel.model.PropertyDefinition" + } + }, + "objectModel": { + "type": "string", + "title": "Object Model", + "description": "The XPath object model to use" + }, + "preCompile": { + "type": "boolean", + "title": "Pre Compile", + "description": "Whether to enable pre-compiling the xpath expression during initialization phase. pre-compile is enabled by default. This can be used to turn off, for example in cases the compilation phase is desired at the starting phase, such as if the application is ahead of time compiled (for example with camel-quarkus) which would then load the xpath factory of the built operating system, and not a JVM runtime." + }, + "resultQName": { + "type": "string", + "title": "Result QName", + "description": "Sets the output type supported by XPath.", + "default": "NODESET", + "enum": ["NUMBER", "STRING", "BOOLEAN", "NODESET", "NODE"] + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "saxon": { + "type": "boolean", + "title": "Saxon", + "description": "Whether to use Saxon." + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "threadSafety": { + "type": "boolean", + "title": "Thread Safety", + "description": "Whether to enable thread-safety for the returned result of the xpath expression. This applies to when using NODESET as the result type, and the returned set has multiple elements. In this situation there can be thread-safety issues if you process the NODESET concurrently such as from a Camel Splitter EIP in parallel processing mode. This option prevents concurrency issues by doing defensive copies of the nodes. It is recommended to turn this option on if you are using camel-saxon or Saxon in your application. Saxon has thread-safety issues which can be prevented by turning this option on." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + }, + "org.apache.camel.model.language.XQueryExpression": { + "title": "XQuery", + "description": "Evaluates an XQuery expressions against an XML payload.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "configurationRef": { + "type": "string", + "title": "Configuration Ref", + "description": "Reference to a saxon configuration instance in the registry to use for xquery (requires camel-saxon). This may be needed to add custom functions to a saxon configuration, so these custom functions can be used in xquery expressions." + }, + "expression": { + "type": "string", + "title": "Expression", + "description": "The expression value in your chosen language syntax" + }, + "id": { + "type": "string", + "title": "Id", + "description": "Sets the id of this node" + }, + "namespace": { + "type": "array", + "title": "Namespace", + "description": "Injects the XML Namespaces of prefix - uri mappings", + "items": { + "$ref": "#/items/definitions/org.apache.camel.model.PropertyDefinition" + } + }, + "resultType": { + "type": "string", + "title": "Result Type", + "description": "Sets the class of the result type (type from output)" + }, + "source": { + "type": "string", + "title": "Source", + "description": "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body." + }, + "trim": { + "type": "boolean", + "title": "Trim", + "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + } + } + } + ], + "required": ["expression"] + } + } + }, + "properties": { + "resequence": { + "$ref": "#/items/definitions/org.apache.camel.model.ResequenceDefinition" + } + } +} \ No newline at end of file