Page MenuHomeFeedback Tracker

Serialization from CURL not working properly for boolean
Assigned, UrgentPublic

Description

Calling an API returning two variables, "allowed" which is a boolean and "message" which is a string.
It errors out

Now, transforming the boolean to an integer, it works :

NB : The boolean works just fine if the API returns 0 instead of false :

The CallBack's OnSuccess method doesn't change between the two screenshots.

My OnConnectData which cause the error is :

class OnConnectData
{
    bool allowed;
    string message;
}

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

GrosTon1 created this task.Aug 25 2019, 3:53 PM
GrosTon1 updated the task description. (Show Details)Aug 25 2019, 3:57 PM
Geez changed the task status from New to Assigned.Aug 26 2019, 11:28 AM

Part of the underlying issue here is that the JSON-Serializer treats booleans as ints. If you write something using JSON a bool value will be 0/1 instead of false/true.