REST return null for a Boolean value

0
How should I handle a json response from a REST webservice which contains a Boolean attribute with a null value : for instance "sent": null I read on this forum that a null value is not allowed for a Boolean and better is to use a enum for that case, but what if you don't have control over the webservice?
asked
2 answers
1

Hi Olivier,

When you open your import mapping, you can select the import entity (grey) and select a microflow to convert attributes.

Here is a similar question that Austin and myself answered. https://forum.mendix.com/link/questions/88815

Let me know if you have any further questions.

answered
1

Map with an import mapping your data to a non-persistent entity and set the sent attribute to datatype string. After that you process you non-persistent entity to you persistent entity. If your default value for the sent attribute in your persistent model is false map the empty string to false 

In this case your mapping won't fail and you have more control over the data you get in ‚úč

answered