Loading ...
Sorry, an error occurred while loading the content.

1624Re: [json] Do numeric values need to be double quoted when returned in objects?

Expand Messages
  • jonathan wallace
    Mar 11, 2011
    • 0 Attachment
      {"age":35}

      {"age":"35"}

      Are both legal JSON, but very different objects.  In the first, age is the number 35, the second is a string with characters '3' and '5'.
       
      "People have always been impressed by the power of our example, not the example of our power." - William Jefferson Clinton


      ________________________________
      From: toddkingham <toddkingham@...>
      To: json@yahoogroups.com
      Sent: Friday, March 11, 2011 5:16 PM
      Subject: [json] Do numeric values need to be double quoted when returned in objects?


       
      Just as the subject suggests... Do you need to double quote numeric values to be valid JSON? JSONlint seems to validate the following string just fine: {"age":35}

      I believe the part in the spec that says all STRINGS must be double quoted doesn't apply to numeric values as they are not strings...yes?

      Thanks







      [Non-text portions of this message have been removed]
    • Show all 4 messages in this topic