Skip to main content
Known Participant
March 11, 2011
Question

Bug or intended behavior?

  • March 11, 2011
  • 1 reply
  • 364 views

Hi

Consider his script code

n = "0";

writeoutput ("IsJSON: " & IsJSON (n) & "<br>");

n = DeserializeJSON(n);

writedump (n);

It gives a YES for IsJSON() ....
It this really intended?
I really doubt.
I want to use IsJSON to detect succesful results of my cfcs to work with them. If not json, it is an error code. please do not tell me that I can do it in a diffreent manner. I know that.

    This topic has been closed for replies.

    1 reply

    Inspiring
    March 11, 2011

    Not everyting represented in JSON is an object.  One can represent a number in JSON to.  Just like your example demonstrates.

    Read the RFC:

    http://tools.ietf.org/html/rfc4627

    Or validate it for yourself:

    http://www.jsonlint.com/

    --

    Adam