vc.0
vc.0

Reputation: 1

how to remove quotations from dataweave 2.0 script?

dataweave 2.0 script in Anypoint Studio 7.3 while building JSON always add quotations to the object, even if it's not value but new JSON object.

My code looks like this:

%dw 2.0
output application/java
import * from dw::core::Strings
var studyId = vars.request.studyId
---
{[
    {
      (vars.keytype): value1,
      StudyId: value2
    },
    (vars.condition)
]}

where (vars.condition) is just another json object:

{"key1":"value"}

the Question is how to remove extra quotations surrounding (vars.condidtion)?

Upvotes: 0

Views: 2057

Answers (1)

Shoki
Shoki

Reputation: 1538

The most probable reason for it to add extra quotes is that your condition variable doesn't have the application/json mime-type set.

Upvotes: 0

Related Questions