Next in thread →
Next in month →
Re: JSON Profile and the Integer Data-Type
Hi Steven, I've been doing a bit of thinking around the way one should infer a datatype. If we get "3", according to the spec, as it stands today, it should be treated as a string since "3" is a _javascript_ string. If we get 3, according to the spec, as it stands today, it should be treated as an integer... If we get 3.12, we should get a double. The number range in javscript is defined by ECMA - there's a good article here: http://www.hunlock.com/blogs/The_Complete_Javascript_Number_Reference That said, what matters most of course is the XML definition of #integer and #double since it's what XACML uses. Integer is defined here: http://www.w3.org/TR/xmlschema-2/#integer double is defined here: http://www.w3.org/TR/xmlschema-2/#double In what you wrote, you start from the Javscript / JSON definition. I'd rather start from the XML definition of the numbers since this is what is expected by the XACML standard. Does that make more sense? I would need to rephrase the profile text to the following: _javascript_ ”Number” with no fractional portion and within the integer range defined in the XML schema at http://www.w3.org/TR/xmlschema-2/#integer Happy holidays! David. On Tue, Dec 11, 2012 at 12:22 AM, Steven Legg <> wrote: Hi David, I'm not sure how to interpret this description of values of the integer data-type in section 3.4.1 of the JSON profile: _javascript_ ”Number” with no fractional portion and within integer range By referencing _javascript_ it seems to be suggesting that a JSON number should be parsed as a double and treated as an integer if that double value is a whole number in the range of a 53-bit integer value. If that is the case, then 1.23e3 is an integer value and 9223372036854775807 is a double value. Can you clarify what you intended ? Regards, Steven -- David Brossard, M.Eng, SCEA, CSTP Product Manager +46(0)760 25 85 75 Axiomatics AB Skeppsbron 40 S-111 30 Stockholm, Sweden http://www.linkedin.com/companies/536082 http://www.axiomatics.com http://twitter.com/axiomatics
Next in thread →
Next in month →