3

How can you get a single backslash in DataWeave 2.0?

%dw 2.0
output application/json
---
{
  "attempt1": "\String",
  "attempt2": "\\String"
}

Returns:

{
  "attempt1": "\\String",
  "attempt2": "\\String"
}
jerney
  • 2,187
  • 1
  • 19
  • 31

1 Answers1

5

Looks like your output is a json and in json the \ always need to be escaped inside a string. That is why you are always going to see two \

machaval
  • 4,969
  • 14
  • 20