This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch lang8 in repository https://gitbox.apache.org/repos/asf/camel.git
commit 225c342a5a42e599a467b690951a7a9049dcde35 Author: Claus Ibsen <[email protected]> AuthorDate: Mon Feb 5 12:04:27 2024 +0100 CAMEL-20378: Languages should be thread-safe and be configured only via properties array, all in the same way. --- .../catalog/components/aws-secrets-manager.json | 12 ++--- .../camel/catalog/components/aws2-athena.json | 12 ++--- .../apache/camel/catalog/languages/datasonnet.json | 7 ++- .../apache/camel/catalog/models/datasonnet.json | 7 ++- .../apache/camel/catalog/schemas/camel-spring.xsd | 42 +++++++++--------- .../camel/language/datasonnet/datasonnet.json | 7 ++- .../language/datasonnet/DatasonnetExpression.java | 51 ++++++++++++++-------- .../language/datasonnet/DatasonnetLanguage.java | 11 ++--- .../apache/camel/model/language/datasonnet.json | 7 ++- .../camel/model/language/DatasonnetExpression.java | 2 +- .../language/DatasonnetExpressionReifier.java | 9 ++-- .../java/org/apache/camel/xml/in/ModelParser.java | 24 +++++----- .../java/org/apache/camel/xml/out/ModelWriter.java | 2 +- .../org/apache/camel/yaml/out/ModelWriter.java | 2 +- .../dsl/yaml/deserializers/ModelDeserializers.java | 20 ++++++++- .../generated/resources/schema/camelYamlDsl.json | 15 +++++++ 16 files changed, 144 insertions(+), 86 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-secrets-manager.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-secrets-manager.json index 6bfb62e0cc1..f69b0f4c01b 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-secrets-manager.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws-secrets-manager.json @@ -42,10 +42,8 @@ "proxyProtocol": { "index": 16, "kind": "property", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "To define a [...] "accessKey": { "index": 17, "kind": "property", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" }, "secretKey": { "index": 18, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }, - "sessionToken": { "index": 19, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Amazon AWS Session Token used when the user needs to assume a IAM role" }, - "trustAllCertificates": { "index": 20, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of ov [...] - "useDefaultCredentialsProvider": { "index": 21, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Set whether the Translate clien [...] - "useSessionCredentials": { "index": 22, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Set whether the Secrets Manager client should ex [...] + "trustAllCertificates": { "index": 19, "kind": "property", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of ov [...] + "useDefaultCredentialsProvider": { "index": 20, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Set whether the Translate clien [...] }, "headers": { "CamelAwsSecretsManagerOperation": { "index": 0, "kind": "header", "displayName": "", "group": "producer", "label": "", "required": false, "javaType": "String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The operation we want to perform", "constantName": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConstants#OPERATION" }, @@ -74,9 +72,7 @@ "proxyProtocol": { "index": 13, "kind": "parameter", "displayName": "Proxy Protocol", "group": "proxy", "label": "proxy", "required": false, "type": "object", "javaType": "software.amazon.awssdk.core.Protocol", "enum": [ "HTTP", "HTTPS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "HTTPS", "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "To define a [...] "accessKey": { "index": 14, "kind": "parameter", "displayName": "Access Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Amazon AWS Access Key" }, "secretKey": { "index": 15, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Amazon AWS Secret Key" }, - "sessionToken": { "index": 16, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Amazon AWS Session Token used when the user needs to assume a IAM role" }, - "trustAllCertificates": { "index": 17, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of o [...] - "useDefaultCredentialsProvider": { "index": 18, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Set whether the Translate clie [...] - "useSessionCredentials": { "index": 19, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Set whether the Secrets Manager client should e [...] + "trustAllCertificates": { "index": 16, "kind": "parameter", "displayName": "Trust All Certificates", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "If we want to trust all certificates in case of o [...] + "useDefaultCredentialsProvider": { "index": 17, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws.secretsmanager.SecretsManagerConfiguration", "configurationField": "configuration", "description": "Set whether the Translate clie [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-athena.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-athena.json index 7731d514df5..2eabb27d6bb 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-athena.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/aws2-athena.json @@ -55,10 +55,8 @@ "kmsKey": { "index": 29, "kind": "property", "displayName": "Kms Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID." }, "profileCredentialsName": { "index": 30, "kind": "property", "displayName": "Profile Credentials Name", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the profile [...] "secretKey": { "index": 31, "kind": "property", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key." }, - "sessionToken": { "index": 32, "kind": "property", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Amazon AWS Session Token used when the user needs to assume a IAM role" }, - "useDefaultCredentialsProvider": { "index": 33, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect t [...] - "useProfileCredentialsProvider": { "index": 34, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect t [...] - "useSessionCredentials": { "index": 35, "kind": "property", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect to use Session Cre [...] + "useDefaultCredentialsProvider": { "index": 32, "kind": "property", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect t [...] + "useProfileCredentialsProvider": { "index": 33, "kind": "property", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect t [...] }, "headers": { "CamelAwsAthenaOperation": { "index": 0, "kind": "header", "displayName": "", "group": "all", "label": "all", "required": false, "javaType": "org.apache.camel.component.aws2.athena.Athena2Operations", "enum": [ "getQueryExecution", "getQueryResults", "listQueryExecutions", "startQueryExecution" ], "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "defaultValue": "startQueryExecution", "description": "The operation to perform. Permitted values are getQue [...] @@ -114,9 +112,7 @@ "kmsKey": { "index": 26, "kind": "parameter", "displayName": "Kms Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "For SSE-KMS and CSE-KMS, this is the KMS key ARN or ID." }, "profileCredentialsName": { "index": 27, "kind": "parameter", "displayName": "Profile Credentials Name", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "If using a profile credentials provider this parameter will set the profil [...] "secretKey": { "index": 28, "kind": "parameter", "displayName": "Secret Key", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Amazon AWS Secret Key." }, - "sessionToken": { "index": 29, "kind": "parameter", "displayName": "Session Token", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Amazon AWS Session Token used when the user needs to assume a IAM role" }, - "useDefaultCredentialsProvider": { "index": 30, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect [...] - "useProfileCredentialsProvider": { "index": 31, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect [...] - "useSessionCredentials": { "index": 32, "kind": "parameter", "displayName": "Use Session Credentials", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect to use Session Cr [...] + "useDefaultCredentialsProvider": { "index": 29, "kind": "parameter", "displayName": "Use Default Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect [...] + "useProfileCredentialsProvider": { "index": 30, "kind": "parameter", "displayName": "Use Profile Credentials Provider", "group": "security", "label": "security", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "configurationClass": "org.apache.camel.component.aws2.athena.Athena2Configuration", "configurationField": "configuration", "description": "Set whether the Athena client should expect [...] } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/datasonnet.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/datasonnet.json index c64723f1dc0..aaf22efac7c 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/datasonnet.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/languages/datasonnet.json @@ -20,7 +20,10 @@ "expression": { "index": 1, "kind": "value", "displayName": "Expression", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax" }, "bodyMediaType": { "index": 2, "kind": "attribute", "displayName": "Body Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the message's body MediaType" }, "outputMediaType": { "index": 3, "kind": "attribute", "displayName": "Output Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the MediaType to output" }, - "resultType": { "index": 4, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, - "trim": { "index": 5, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } + "variableName": { "index": 4, "kind": "attribute", "displayName": "Variable Name", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of variable to use as input, instead of the message body" }, + "headerName": { "index": 5, "kind": "attribute", "displayName": "Header Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of header to use as input, instead of the message body" }, + "propertyName": { "index": 6, "kind": "attribute", "displayName": "Property Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of property to use as input, instead of the message body." }, + "resultType": { "index": 7, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, + "trim": { "index": 8, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/datasonnet.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/datasonnet.json index 45c1e989f89..6b4bfe1e4ba 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/datasonnet.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/datasonnet.json @@ -17,7 +17,10 @@ "expression": { "index": 1, "kind": "value", "displayName": "Expression", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax" }, "bodyMediaType": { "index": 2, "kind": "attribute", "displayName": "Body Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the message's body MediaType" }, "outputMediaType": { "index": 3, "kind": "attribute", "displayName": "Output Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the MediaType to output" }, - "resultType": { "index": 4, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, - "trim": { "index": 5, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } + "variableName": { "index": 4, "kind": "attribute", "displayName": "Variable Name", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of variable to use as input, instead of the message body" }, + "headerName": { "index": 5, "kind": "attribute", "displayName": "Header Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of header to use as input, instead of the message body" }, + "propertyName": { "index": 6, "kind": "attribute", "displayName": "Property Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of property to use as input, instead of the message body." }, + "resultType": { "index": 7, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, + "trim": { "index": 8, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } } } diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd index 7ee874733f9..62a224fc6ac 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd @@ -15197,7 +15197,7 @@ Sets the class of the result type (type from output). </xs:complexType> <xs:complexType name="datasonnetExpression"> <xs:simpleContent> - <xs:extension base="tns:typedExpressionDefinition"> + <xs:extension base="tns:singleInputTypedExpressionDefinition"> <xs:attribute name="bodyMediaType" type="xs:string"> <xs:annotation> <xs:documentation xml:lang="en"> @@ -15219,26 +15219,6 @@ The String representation of the MediaType to output. </xs:extension> </xs:simpleContent> </xs:complexType> - <xs:complexType name="exchangePropertyExpression"> - <xs:simpleContent> - <xs:extension base="tns:expression"/> - </xs:simpleContent> - </xs:complexType> - <xs:complexType name="groovyExpression"> - <xs:simpleContent> - <xs:extension base="tns:typedExpressionDefinition"/> - </xs:simpleContent> - </xs:complexType> - <xs:complexType name="headerExpression"> - <xs:simpleContent> - <xs:extension base="tns:expression"/> - </xs:simpleContent> - </xs:complexType> - <xs:complexType name="hl7TerserExpression"> - <xs:simpleContent> - <xs:extension base="tns:singleInputTypedExpressionDefinition"/> - </xs:simpleContent> - </xs:complexType> <xs:complexType abstract="true" name="singleInputTypedExpressionDefinition"> <xs:simpleContent> <xs:extension base="tns:typedExpressionDefinition"> @@ -15272,6 +15252,26 @@ Name of property to use as input, instead of the message body. </xs:extension> </xs:simpleContent> </xs:complexType> + <xs:complexType name="exchangePropertyExpression"> + <xs:simpleContent> + <xs:extension base="tns:expression"/> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name="groovyExpression"> + <xs:simpleContent> + <xs:extension base="tns:typedExpressionDefinition"/> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name="headerExpression"> + <xs:simpleContent> + <xs:extension base="tns:expression"/> + </xs:simpleContent> + </xs:complexType> + <xs:complexType name="hl7TerserExpression"> + <xs:simpleContent> + <xs:extension base="tns:singleInputTypedExpressionDefinition"/> + </xs:simpleContent> + </xs:complexType> <xs:complexType name="javaExpression"> <xs:simpleContent> <xs:extension base="tns:typedExpressionDefinition"> diff --git a/components/camel-datasonnet/src/generated/resources/org/apache/camel/language/datasonnet/datasonnet.json b/components/camel-datasonnet/src/generated/resources/org/apache/camel/language/datasonnet/datasonnet.json index c64723f1dc0..aaf22efac7c 100644 --- a/components/camel-datasonnet/src/generated/resources/org/apache/camel/language/datasonnet/datasonnet.json +++ b/components/camel-datasonnet/src/generated/resources/org/apache/camel/language/datasonnet/datasonnet.json @@ -20,7 +20,10 @@ "expression": { "index": 1, "kind": "value", "displayName": "Expression", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax" }, "bodyMediaType": { "index": 2, "kind": "attribute", "displayName": "Body Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the message's body MediaType" }, "outputMediaType": { "index": 3, "kind": "attribute", "displayName": "Output Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the MediaType to output" }, - "resultType": { "index": 4, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, - "trim": { "index": 5, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } + "variableName": { "index": 4, "kind": "attribute", "displayName": "Variable Name", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of variable to use as input, instead of the message body" }, + "headerName": { "index": 5, "kind": "attribute", "displayName": "Header Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of header to use as input, instead of the message body" }, + "propertyName": { "index": 6, "kind": "attribute", "displayName": "Property Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of property to use as input, instead of the message body." }, + "resultType": { "index": 7, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, + "trim": { "index": 8, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } } } diff --git a/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetExpression.java b/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetExpression.java index 1071a82756b..86bb0b244ff 100644 --- a/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetExpression.java +++ b/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetExpression.java @@ -40,11 +40,11 @@ import com.datasonnet.header.Header; import com.datasonnet.spi.Library; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; +import org.apache.camel.Expression; import org.apache.camel.RuntimeExpressionException; import org.apache.camel.spi.ExpressionResultTypeAware; import org.apache.camel.support.ExchangeHelper; import org.apache.camel.support.ExpressionAdapter; -import org.apache.camel.support.MessageHelper; import org.apache.commons.io.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,6 +53,7 @@ public class DatasonnetExpression extends ExpressionAdapter implements Expressio private static final Logger LOG = LoggerFactory.getLogger(DatasonnetExpression.class); private final String expression; + private Expression source; private MediaType bodyMediaType; private MediaType outputMediaType; private Class<?> resultType; @@ -63,10 +64,12 @@ public class DatasonnetExpression extends ExpressionAdapter implements Expressio this.expression = expression; } + @Deprecated public static DatasonnetExpression builder(String expression) { return new DatasonnetExpression(expression); } + @Deprecated public static DatasonnetExpression builder(String expression, Class<?> resultType) { DatasonnetExpression answer = new DatasonnetExpression(expression); answer.setResultType(resultType); @@ -112,19 +115,22 @@ public class DatasonnetExpression extends ExpressionAdapter implements Expressio } } - Document<?> body; - - String bodyAsString = MessageHelper.extractBodyAsString(exchange.getMessage()); - - if (exchange.getMessage().getBody() instanceof Document) { - body = (Document<?>) exchange.getMessage().getBody(); - } else if (exchange.getMessage().getBody() == null || "".equals(bodyAsString)) { - //Empty body, force type to be application/java - body = new DefaultDocument<>("", MediaTypes.APPLICATION_JAVA); - } else if (MediaTypes.APPLICATION_JAVA.equalsTypeAndSubtype(bodyMT) || bodyMT == null) { - body = new DefaultDocument<>(exchange.getMessage().getBody()); - } else { - body = new DefaultDocument<>(bodyAsString, bodyMT); + Object payload = source != null ? source.evaluate(exchange, Object.class) : exchange.getMessage().getBody(); + Document<?> doc = null; + if (payload != null) { + doc = exchange.getContext().getTypeConverter().tryConvertTo(Document.class, exchange, payload); + } + if (doc == null) { + String text = exchange.getContext().getTypeConverter().tryConvertTo(String.class, exchange, payload); + if (exchange.getMessage().getBody() == null || "".equals(text)) { + //Empty body, force type to be application/java + doc = new DefaultDocument<>("", MediaTypes.APPLICATION_JAVA); + } else if (MediaTypes.APPLICATION_JAVA.equalsTypeAndSubtype(bodyMT) || bodyMT == null) { + doc = new DefaultDocument<>(payload); + } else { + // force using string value + doc = new DefaultDocument<>(text, bodyMT); + } } // the mapper is pre initialized @@ -143,11 +149,11 @@ public class DatasonnetExpression extends ExpressionAdapter implements Expressio } } - Map<String, Document<?>> inputs = Collections.singletonMap("body", body); + Map<String, Document<?>> inputs = Collections.singletonMap("body", doc); if (resultType == null || resultType.equals(Document.class)) { - return mapper.transform(body, inputs, outMT, Object.class); + return mapper.transform(doc, inputs, outMT, Object.class); } else { - return mapper.transform(body, inputs, outMT, resultType); + return mapper.transform(doc, inputs, outMT, resultType); } } @@ -208,6 +214,14 @@ public class DatasonnetExpression extends ExpressionAdapter implements Expressio // Getter/Setter methods // ------------------------------------------------------------------------- + public Expression getSource() { + return source; + } + + public void setSource(Expression source) { + this.source = source; + } + public MediaType getBodyMediaType() { return bodyMediaType; } @@ -262,11 +276,14 @@ public class DatasonnetExpression extends ExpressionAdapter implements Expressio // Fluent builder methods // ------------------------------------------------------------------------- + + @Deprecated public DatasonnetExpression bodyMediaType(MediaType bodyMediaType) { setBodyMediaType(bodyMediaType); return this; } + @Deprecated public DatasonnetExpression outputMediaType(MediaType outputMediaType) { setOutputMediaType(outputMediaType); return this; diff --git a/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java b/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java index b3f5b24187c..214a277fb51 100644 --- a/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java +++ b/components/camel-datasonnet/src/main/java/org/apache/camel/language/datasonnet/DatasonnetLanguage.java @@ -31,12 +31,12 @@ import org.apache.camel.Expression; import org.apache.camel.Predicate; import org.apache.camel.spi.annotations.Language; import org.apache.camel.support.LRUCacheFactory; -import org.apache.camel.support.TypedLanguageSupport; +import org.apache.camel.support.SingleInputTypedLanguageSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Language("datasonnet") -public class DatasonnetLanguage extends TypedLanguageSupport { +public class DatasonnetLanguage extends SingleInputTypedLanguageSupport { private static final Logger LOG = LoggerFactory.getLogger(DatasonnetLanguage.class); private static final Map<String, String> CLASSPATH_IMPORTS = new HashMap<>(); @@ -77,16 +77,17 @@ public class DatasonnetLanguage extends TypedLanguageSupport { } @Override - public Expression createExpression(String expression, Object[] properties) { + public Expression createExpression(Expression source, String expression, Object[] properties) { expression = loadResource(expression); DatasonnetExpression answer = new DatasonnetExpression(expression); + answer.setSource(source); answer.setResultType(property(Class.class, properties, 0, null)); - String mediaType = property(String.class, properties, 1, null); + String mediaType = property(String.class, properties, 4, null); if (mediaType != null) { answer.setBodyMediaType(MediaType.valueOf(mediaType)); } - mediaType = property(String.class, properties, 2, null); + mediaType = property(String.class, properties, 5, null); if (mediaType != null) { answer.setOutputMediaType(MediaType.valueOf(mediaType)); } diff --git a/core/camel-core-model/src/generated/resources/org/apache/camel/model/language/datasonnet.json b/core/camel-core-model/src/generated/resources/org/apache/camel/model/language/datasonnet.json index 45c1e989f89..6b4bfe1e4ba 100644 --- a/core/camel-core-model/src/generated/resources/org/apache/camel/model/language/datasonnet.json +++ b/core/camel-core-model/src/generated/resources/org/apache/camel/model/language/datasonnet.json @@ -17,7 +17,10 @@ "expression": { "index": 1, "kind": "value", "displayName": "Expression", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The expression value in your chosen language syntax" }, "bodyMediaType": { "index": 2, "kind": "attribute", "displayName": "Body Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the message's body MediaType" }, "outputMediaType": { "index": 3, "kind": "attribute", "displayName": "Output Media Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "The String representation of the MediaType to output" }, - "resultType": { "index": 4, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, - "trim": { "index": 5, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } + "variableName": { "index": 4, "kind": "attribute", "displayName": "Variable Name", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of variable to use as input, instead of the message body" }, + "headerName": { "index": 5, "kind": "attribute", "displayName": "Header Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of header to use as input, instead of the message body" }, + "propertyName": { "index": 6, "kind": "attribute", "displayName": "Property Name", "label": "advanced", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Name of property to use as input, instead of the message body." }, + "resultType": { "index": 7, "kind": "attribute", "displayName": "Result Type", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "description": "Sets the class of the result type (type from output)" }, + "trim": { "index": 8, "kind": "attribute", "displayName": "Trim", "label": "advanced", "required": false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether to trim the value to remove leading and trailing whitespaces and line breaks" } } } diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/language/DatasonnetExpression.java b/core/camel-core-model/src/main/java/org/apache/camel/model/language/DatasonnetExpression.java index dee493c94f1..8e887510868 100644 --- a/core/camel-core-model/src/main/java/org/apache/camel/model/language/DatasonnetExpression.java +++ b/core/camel-core-model/src/main/java/org/apache/camel/model/language/DatasonnetExpression.java @@ -31,7 +31,7 @@ import org.apache.camel.spi.Metadata; @Metadata(firstVersion = "3.7.0", label = "language,transformation", title = "DataSonnet") @XmlRootElement(name = "datasonnet") @XmlAccessorType(XmlAccessType.FIELD) -public class DatasonnetExpression extends TypedExpressionDefinition { +public class DatasonnetExpression extends SingleInputTypedExpressionDefinition { @XmlAttribute(name = "bodyMediaType") private String bodyMediaType; diff --git a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/language/DatasonnetExpressionReifier.java b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/language/DatasonnetExpressionReifier.java index 2248b144ce4..daa52811857 100644 --- a/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/language/DatasonnetExpressionReifier.java +++ b/core/camel-core-reifier/src/main/java/org/apache/camel/reifier/language/DatasonnetExpressionReifier.java @@ -28,10 +28,13 @@ public class DatasonnetExpressionReifier extends TypedExpressionReifier<Datasonn @Override protected Object[] createProperties() { - Object[] properties = new Object[3]; + Object[] properties = new Object[6]; properties[0] = asResultType(); - properties[1] = parseString(definition.getBodyMediaType()); - properties[2] = parseString(definition.getOutputMediaType()); + properties[1] = parseString(definition.getVariableName()); + properties[2] = parseString(definition.getHeaderName()); + properties[3] = parseString(definition.getPropertyName()); + properties[4] = parseString(definition.getBodyMediaType()); + properties[5] = parseString(definition.getOutputMediaType()); return properties; } } diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java index d4474dc6fb7..8c571ce7cf2 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/in/ModelParser.java @@ -2869,11 +2869,22 @@ public class ModelParser extends BaseParser { switch (key) { case "bodyMediaType": def.setBodyMediaType(val); break; case "outputMediaType": def.setOutputMediaType(val); break; - default: return typedExpressionDefinitionAttributeHandler().accept(def, key, val); + default: return singleInputTypedExpressionDefinitionAttributeHandler().accept(def, key, val); } return true; }, noElementHandler(), expressionDefinitionValueHandler()); } + protected <T extends SingleInputTypedExpressionDefinition> AttributeHandler<T> singleInputTypedExpressionDefinitionAttributeHandler() { + return (def, key, val) -> { + switch (key) { + case "headerName": def.setHeaderName(val); break; + case "propertyName": def.setPropertyName(val); break; + case "variableName": def.setVariableName(val); break; + default: return typedExpressionDefinitionAttributeHandler().accept(def, key, val); + } + return true; + }; + } protected ExchangePropertyExpression doParseExchangePropertyExpression() throws IOException, XmlPullParserException { return doParse(new ExchangePropertyExpression(), expressionDefinitionAttributeHandler(), noElementHandler(), expressionDefinitionValueHandler()); @@ -2890,17 +2901,6 @@ public class ModelParser extends BaseParser { return doParse(new Hl7TerserExpression(), singleInputTypedExpressionDefinitionAttributeHandler(), noElementHandler(), expressionDefinitionValueHandler()); } - protected <T extends SingleInputTypedExpressionDefinition> AttributeHandler<T> singleInputTypedExpressionDefinitionAttributeHandler() { - return (def, key, val) -> { - switch (key) { - case "headerName": def.setHeaderName(val); break; - case "propertyName": def.setPropertyName(val); break; - case "variableName": def.setVariableName(val); break; - default: return typedExpressionDefinitionAttributeHandler().accept(def, key, val); - } - return true; - }; - } protected JavaExpression doParseJavaExpression() throws IOException, XmlPullParserException { return doParse(new JavaExpression(), (def, key, val) -> { switch (key) { diff --git a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java index d2584e6c57f..709a3f77709 100644 --- a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java +++ b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java @@ -3939,7 +3939,7 @@ public class ModelWriter extends BaseWriter { DatasonnetExpression def) throws IOException { startElement(name); - doWriteTypedExpressionDefinitionAttributes(def); + doWriteSingleInputTypedExpressionDefinitionAttributes(def); doWriteAttribute("outputMediaType", def.getOutputMediaType()); doWriteAttribute("bodyMediaType", def.getBodyMediaType()); doWriteValue(def.getExpression()); diff --git a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java index 7ff96f5e633..ef72bc4447a 100644 --- a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java +++ b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java @@ -3939,7 +3939,7 @@ public class ModelWriter extends BaseWriter { DatasonnetExpression def) throws IOException { startElement(name); - doWriteTypedExpressionDefinitionAttributes(def); + doWriteSingleInputTypedExpressionDefinitionAttributes(def); doWriteAttribute("outputMediaType", def.getOutputMediaType()); doWriteAttribute("bodyMediaType", def.getBodyMediaType()); doWriteValue(def.getExpression()); diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java index b75fd44a89b..bba7f181965 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java @@ -4257,10 +4257,13 @@ public final class ModelDeserializers extends YamlDeserializerSupport { properties = { @YamlProperty(name = "bodyMediaType", type = "string", description = "The String representation of the message's body MediaType", displayName = "Body Media Type"), @YamlProperty(name = "expression", type = "string", required = true, description = "The expression value in your chosen language syntax", displayName = "Expression"), + @YamlProperty(name = "headerName", type = "string", description = "Name of header to use as input, instead of the message body", displayName = "Header Name"), @YamlProperty(name = "id", type = "string", description = "Sets the id of this node", displayName = "Id"), @YamlProperty(name = "outputMediaType", type = "string", description = "The String representation of the MediaType to output", displayName = "Output Media Type"), + @YamlProperty(name = "propertyName", type = "string", description = "Name of property to use as input, instead of the message body.", displayName = "Property Name"), @YamlProperty(name = "resultType", type = "string", description = "Sets the class of the result type (type from output)", displayName = "Result Type"), - @YamlProperty(name = "trim", type = "boolean", description = "Whether to trim the value to remove leading and trailing whitespaces and line breaks", displayName = "Trim") + @YamlProperty(name = "trim", type = "boolean", description = "Whether to trim the value to remove leading and trailing whitespaces and line breaks", displayName = "Trim"), + @YamlProperty(name = "variableName", type = "string", description = "Name of variable to use as input, instead of the message body", displayName = "Variable Name") } ) public static class DatasonnetExpressionDeserializer extends YamlDeserializerBase<DatasonnetExpression> { @@ -4293,6 +4296,11 @@ public final class ModelDeserializers extends YamlDeserializerSupport { target.setExpression(val); break; } + case "headerName": { + String val = asText(node); + target.setHeaderName(val); + break; + } case "id": { String val = asText(node); target.setId(val); @@ -4303,6 +4311,11 @@ public final class ModelDeserializers extends YamlDeserializerSupport { target.setOutputMediaType(val); break; } + case "propertyName": { + String val = asText(node); + target.setPropertyName(val); + break; + } case "resultType": { String val = asText(node); target.setResultTypeName(val); @@ -4313,6 +4326,11 @@ public final class ModelDeserializers extends YamlDeserializerSupport { target.setTrim(val); break; } + case "variableName": { + String val = asText(node); + target.setVariableName(val); + break; + } default: { ExpressionDefinition ed = target.getExpressionType(); if (ed != null) { diff --git a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json index d7d507c08ff..acc483a442a 100644 --- a/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json +++ b/dsl/camel-yaml-dsl/camel-yaml-dsl/src/generated/resources/schema/camelYamlDsl.json @@ -12670,6 +12670,11 @@ "title" : "Expression", "description" : "The expression value in your chosen language syntax" }, + "headerName" : { + "type" : "string", + "title" : "Header Name", + "description" : "Name of header to use as input, instead of the message body" + }, "id" : { "type" : "string", "title" : "Id", @@ -12680,6 +12685,11 @@ "title" : "Output Media Type", "description" : "The String representation of the MediaType to output" }, + "propertyName" : { + "type" : "string", + "title" : "Property Name", + "description" : "Name of property to use as input, instead of the message body." + }, "resultType" : { "type" : "string", "title" : "Result Type", @@ -12689,6 +12699,11 @@ "type" : "boolean", "title" : "Trim", "description" : "Whether to trim the value to remove leading and trailing whitespaces and line breaks" + }, + "variableName" : { + "type" : "string", + "title" : "Variable Name", + "description" : "Name of variable to use as input, instead of the message body" } } } ],
