From 78ce93e8ede7c365269aed84a120c7e56c741553 Mon Sep 17 00:00:00 2001 From: Glenn Rodgers Date: Fri, 6 Jun 2025 11:34:49 -0400 Subject: [PATCH 1/7] Update policies-flex-dataweave-support.adoc --- .../pages/policies-flex-dataweave-support.adoc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc index 8ebce37f3..b42dd3887 100644 --- a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc +++ b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc @@ -127,6 +127,22 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions. * xref:dataweave::dw-strings-functions-substringbeforelast.adoc#substringbeforelast1[`substringBeforeLast(text: String, separator: String): String`] * xref:dataweave::dw-strings-functions-substringbeforelast.adoc#substringbeforelast2[`substringBeforeLast(text: Null, separator: String): Null`] +=== toBase64 + +* xref:dataweave::dw-binaries-functions-tobase64.adoc#tobase641[`toBase64(content: Binary): String`] + +=== fromBase64 + +* xref:dataweave::dw-binaries-functions-frombase64.adoc#frombase641[`fromBase64(base64String: String): Binary`] + +=== toBinary + +* xref:dataweave::dw-coercions-functions-tobinary.adoc#tobinary1[`toBinary(str: String, encoding: String): Binary`] + +=== toString + +* xref:dataweave::dw-coercions-functions-tostring.adoc#tostring3[`toString(binary: Binary, encoding: String): String`] + [[available-predefined-variables]] == Available Predefined Variables From d916a68b8f7102a8d450a1be1626e1b769ee5e89 Mon Sep 17 00:00:00 2001 From: Glenn Rodgers Date: Fri, 6 Jun 2025 12:59:46 -0400 Subject: [PATCH 2/7] Update policies-flex-dataweave-support.adoc --- .../modules/ROOT/pages/policies-flex-dataweave-support.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc index b42dd3887..e396eb3d4 100644 --- a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc +++ b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc @@ -166,7 +166,7 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions. ** `authentication.properties` * `payload` -** Use the `payload` variable to read the request body as a string. You can't parse this variable. +** Fields depend on the current payload. For example: `#[payload]` returns the body of the message. * xref:dataweave::dataweave-variables-context.adoc[`vars`] ** Individual policies support different sets of variables. For information, refer to the policies listed in xref:policies-included-directory.adoc[]. From e12acc81b11bc3b4b6778edc525a6e01222bfc10 Mon Sep 17 00:00:00 2001 From: Glenn Rodgers Date: Mon, 9 Jun 2025 10:08:55 -0400 Subject: [PATCH 3/7] Update policies-flex-dataweave-support.adoc --- .../ROOT/pages/policies-flex-dataweave-support.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc index e396eb3d4..7b1a25955 100644 --- a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc +++ b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc @@ -135,6 +135,13 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions. * xref:dataweave::dw-binaries-functions-frombase64.adoc#frombase641[`fromBase64(base64String: String): Binary`] +[NOTE] +==== +Flex Gateway doesn't support binary types. For the `dw::core::Binaries::fromBase64('dXNlcjpwYXNz')` DataWeave function, the result must be a string. Transform the binary output to string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example; `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. + +If using a different function that transform the binary by default, such as `#[splitBy(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), ':')]`, you don't need to manually transform the binary. +==== + === toBinary * xref:dataweave::dw-coercions-functions-tobinary.adoc#tobinary1[`toBinary(str: String, encoding: String): Binary`] From 714d1765aac027cdc1ea05122848be586f732ed0 Mon Sep 17 00:00:00 2001 From: Glenn Rodgers Date: Mon, 9 Jun 2025 10:14:25 -0400 Subject: [PATCH 4/7] Update policies-flex-dataweave-support.adoc --- .../modules/ROOT/pages/policies-flex-dataweave-support.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc index 7b1a25955..3ca20bb0f 100644 --- a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc +++ b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc @@ -137,7 +137,7 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions. [NOTE] ==== -Flex Gateway doesn't support binary types. For the `dw::core::Binaries::fromBase64('dXNlcjpwYXNz')` DataWeave function, the result must be a string. Transform the binary output to string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example; `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. +Flex Gateway doesn't support binary types. To use the `dw::Binaries::fromBase64('dXNlcjpwYXNz')` function, transform the result to a string.. Transform the binary output to string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example; `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. If using a different function that transform the binary by default, such as `#[splitBy(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), ':')]`, you don't need to manually transform the binary. ==== From 8b74d88421458c906342706d6aec47870e734673 Mon Sep 17 00:00:00 2001 From: Glenn Rodgers Date: Mon, 9 Jun 2025 10:24:50 -0400 Subject: [PATCH 5/7] Update policies-flex-dataweave-support.adoc --- .../modules/ROOT/pages/policies-flex-dataweave-support.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc index 3ca20bb0f..e622180f2 100644 --- a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc +++ b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc @@ -137,7 +137,7 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions. [NOTE] ==== -Flex Gateway doesn't support binary types. To use the `dw::Binaries::fromBase64('dXNlcjpwYXNz')` function, transform the result to a string.. Transform the binary output to string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example; `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. +Flex Gateway doesn't support DataWeave expressions with binary type results. To use the `dw::Binaries::fromBase64('dXNlcjpwYXNz')` function, transform the result to a string.. Transform the binary output to string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example; `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. If using a different function that transform the binary by default, such as `#[splitBy(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), ':')]`, you don't need to manually transform the binary. ==== From 64239920681816c19747ae389dec3e846bfa3382 Mon Sep 17 00:00:00 2001 From: glenn-rodgers-sf <115032644+glenn-rodgers-sf@users.noreply.github.com> Date: Mon, 9 Jun 2025 13:01:17 -0400 Subject: [PATCH 6/7] Apply suggestions from code review Co-authored-by: Tasha Moore <93338373+tasmoore@users.noreply.github.com> --- .../modules/ROOT/pages/policies-flex-dataweave-support.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc index e622180f2..bf9bbe513 100644 --- a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc +++ b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc @@ -137,9 +137,9 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions. [NOTE] ==== -Flex Gateway doesn't support DataWeave expressions with binary type results. To use the `dw::Binaries::fromBase64('dXNlcjpwYXNz')` function, transform the result to a string.. Transform the binary output to string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example; `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. +Flex Gateway doesn't support DataWeave expressions with binary type results. To use the `dw::Binaries::fromBase64('dXNlcjpwYXNz')` function, transform the result to a string. Transform the binary output to a string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example, `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. -If using a different function that transform the binary by default, such as `#[splitBy(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), ':')]`, you don't need to manually transform the binary. +If using a different function that transforms the binary by default, such as `#[splitBy(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), ':')]`, you can skip manually transforming the binary. ==== === toBinary @@ -173,7 +173,7 @@ If using a different function that transform the binary by default, such as `#[s ** `authentication.properties` * `payload` -** Fields depend on the current payload. For example: `#[payload]` returns the body of the message. +** Fields depend on the current payload. For example, `#[payload]` returns the body of the message. * xref:dataweave::dataweave-variables-context.adoc[`vars`] ** Individual policies support different sets of variables. For information, refer to the policies listed in xref:policies-included-directory.adoc[]. From 9cb05bebc1cc496df6459a2ff0593b312debc8d4 Mon Sep 17 00:00:00 2001 From: Glenn Rodgers Date: Mon, 9 Jun 2025 13:04:18 -0400 Subject: [PATCH 7/7] Update policies-flex-dataweave-support.adoc --- .../1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc | 1 - 1 file changed, 1 deletion(-) diff --git a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc index bf9bbe513..ec653b34d 100644 --- a/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc +++ b/gateway/1.10/modules/ROOT/pages/policies-flex-dataweave-support.adoc @@ -138,7 +138,6 @@ Flex Gateway supports a subset of DataWeave in policy configuration expressions. [NOTE] ==== Flex Gateway doesn't support DataWeave expressions with binary type results. To use the `dw::Binaries::fromBase64('dXNlcjpwYXNz')` function, transform the result to a string. Transform the binary output to a string with the `dw::util::Coercions::toString(binary: Binary, encoding: String): String` function. For example, `#[dw::util::Coercions::toString(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), 'UTF-8')]`. - If using a different function that transforms the binary by default, such as `#[splitBy(dw::core::Binaries::fromBase64('dXNlcjpwYXNz'), ':')]`, you can skip manually transforming the binary. ====