Skip to main content

The component is Validate Size and for the max size I am using the following expression.

 

%dw 2.0

output application/json

var fields = {'callbackUrl': '300',

 'username': '150',

 'firstName': '150',

 'lastName': '150',

 'email': '150'}

var key = (read(write(payload, 'application/json'), 'application/json') as Object pluck $$)[0] as String default ''

---

(fields)[key] as Number default 0

 

When I run this though "Evaluate DataWeave Expression" it returns the correct value as a number.

 

In the component flow it shows the error: Value must be an integer or a DataWeave expression but it does build fine and the code works as intended.

 

Assuming a bug is there any way to permanently ignore an error since it is returning a integer.

7 answers
  1. Nov 21, 2020, 4:10 AM

    Hi @Michael Fesser​ 

     

    Yes you are right, the code is working fine, I tried the same in using the DW component:

    Hi @Michael Fesser​ Yes you are right, the code is working fine, I tried the same in using the DW component:I guess you ignore that there might be some silly action its expecting with we are unable toI guess you ignore that there might be some silly action its expecting with we are unable to recognize or if its still bother you then have a Dataweave component before your Validate Size.

    Write you code in that and save that as payload or Variable and use that in your Size component.

    I took it as payload:

    ss7ss8Regards,

    Abhishek Bathwal

0/9000