1 Reply Latest reply on Jul 4, 2012 1:44 PM by Afshin Ghajar

    Json data, issue with boolean values



      I'm using "Rho::AsyncHttp.get" to get json data in call back method. Our server returns json data for so many platforms so it's working for all platform except RhoMobile platform.

      The issue is with boolean values like true or false , because these values are not receiving as "true", "false".

      The call back code is like below:


      def populateResourceCallback

           if @params['status'] == 'ok'

                response = @params['body']

                description = response['Description']


                isCrewChief = response['IsCrewChief']



      The value of isCrewChief above will be nil, however looking at fiddler or other html5/javascript test page evaluating as boolean true!

      I looked at "variable" tab of debugger and noticed the value of isCrewChief (after expanding response object) is true"IsMale" which means parser ruins next key value pair as well (IsMale).

      And here is the json data:

      {"Description":"Marshall Taylor",...,"IsCrewChief":true,"IsMale":true,...}


      Any help is appreciated.