Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/ROOT/pages/imp-implement-api-specs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ image::get-flights-select-listener.png["HTTP listener highlighted in the impleme
---
payload map ( payload01 , indexOfPayload01 ) -> {
ID: payload01.ID,
code: (payload01.code1 default "") ++ (payload01.code2 default ""),
code: (payload01.code1 as String default "") ++ (payload01.code2 as String default ""),
price: payload01.price default 0,
departureDate: payload01.takeOffDate as String default "",
origin: payload01.fromAirport default "",
Expand All @@ -307,6 +307,9 @@ image::get-flights-select-listener.png["HTTP listener highlighted in the impleme
</flow>
--
====
+
NOTE: The `++` operator concatenates `String` values. The database connector can infer `code1` and `code2` as a non-`String` type (or as nullable). Use `as String` with `default ""` for each part so the transform matches the `departureDate` line in the same object, nulls are handled, and the `++` expression type-checks in the editor.
+
. In Anypoint Code Builder, open your `interface.xml` file.
. Locate the `get:\flights:american-flights-api-config` flow:
+
Expand Down
5 changes: 4 additions & 1 deletion modules/ROOT/pages/tut-af-debug-am-flights.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ In the configuration XML, provide this `<set-variable/>` configuration:
---
payload map ( payload01 , indexOfPayload01 ) -> {
ID: payload01.ID,
code: (payload01.code1 default "") ++ (payload01.code2 default ""),
code: (payload01.code1 as String default "") ++ (payload01.code2 as String default ""),
price: payload01.price default 0,
departureDate: payload01.takeOffDate as String default "",
origin: payload01.fromAirport default "",
Expand Down Expand Up @@ -95,6 +95,9 @@ In the configuration XML, provide this `<set-variable/>` configuration:
.. Set Variable component
.. Logger component
====
+
NOTE: The `++` operator concatenates `String` values. The database connector can infer `code1` and `code2` as a non-`String` type (or as nullable). Use `as String` with `default ""` for each part so the transform matches the `departureDate` line in the same object, nulls are handled, and the `++` expression type-checks in the editor.
+
. Proceed to <<add-breakpoint>>.
+
Learn to set up breakpoints to pause execution of your app.
Expand Down
5 changes: 4 additions & 1 deletion modules/ROOT/pages/tut-af-implement-am-flights-api.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ image::get-flights-select-listener.png["HTTP listener highlighted in the impleme
---
payload map ( payload01 , indexOfPayload01 ) -> {
ID: payload01.ID,
code: (payload01.code1 default "") ++ (payload01.code2 default ""),
code: (payload01.code1 as String default "") ++ (payload01.code2 as String default ""),
price: payload01.price default 0,
departureDate: payload01.takeOffDate as String default "",
origin: payload01.fromAirport default "",
Expand All @@ -190,6 +190,9 @@ image::get-flights-select-listener.png["HTTP listener highlighted in the impleme
</flow>
--
====
+
NOTE: The `++` operator concatenates `String` values. The database connector can infer `code1` and `code2` as a non-`String` type (or as nullable). Use `as String` with `default ""` for each part so the transform matches the `departureDate` line in the same object, nulls are handled, and the `++` expression type-checks in the editor.
+
. In Anypoint Code Builder, open your `interface.xml` file.
. Locate the `get:\flights:american-flights-api-config` flow:
+
Expand Down
9 changes: 6 additions & 3 deletions modules/ROOT/pages/tut-af-integrate-use-dataweave.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ To find the required JSON structure, search for the JSON example under the GET m

Use DataWeave to transform the response:

. In the configuration XML, replace the script within the `<![CDATA]]>` with a DataWeave mapping:
. In the configuration XML, replace the script in the CDATA block (`<![CDATA[ ... ]]>`) with a DataWeave mapping:
+
[source,xml]
--
Expand All @@ -326,7 +326,7 @@ Use DataWeave to transform the response:
---
payload map ( payload01 , indexOfPayload01 ) -> {
ID: payload01.ID,
code: (payload01.code1 default "") ++ (payload01.code2 default ""),
code: (payload01.code1 as String default "") ++ (payload01.code2 as String default ""),
price: payload01.price default 0,
departureDate: payload01.takeOffDate as String default "",
origin: payload01.fromAirport default "",
Expand All @@ -342,6 +342,9 @@ Use DataWeave to transform the response:
</ee:message>
</ee:transform>
--
+
NOTE: The `++` operator concatenates `String` values. The database connector can infer `code1` and `code2` as a non-`String` type (or as nullable). Use `as String` with `default ""` for each part so the transform matches the `departureDate` line in the same object, nulls are handled, and the `++` expression type-checks in the editor.
+
. Review your configuration XML:
+
[source,xml]
Expand Down Expand Up @@ -372,7 +375,7 @@ Use DataWeave to transform the response:
---
payload map ( payload01 , indexOfPayload01 ) -> {
ID: payload01.ID,
code: (payload01.code1 default "") ++ (payload01.code2 default ""),
code: (payload01.code1 as String default "") ++ (payload01.code2 as String default ""),
price: payload01.price default 0,
departureDate: payload01.takeOffDate as String default "",
origin: payload01.fromAirport default "",
Expand Down