JSON datatype of number fields in returned JSON data varies - why?

  • 1
  • Problem
  • Updated 6 years ago
Part of the numeric values returned in the JSON response are encoded as numbers (without ""), others are encoded as strings (with ""), like in this example:

"wind_mph":15.0,
"wind_gust_mph":"17.0",
"wind_kph":24.1,
"wind_gust_kph":"27.4",

Can someone tell me the rationale behind this?
Photo of fvu

fvu

  • 5 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 123 Reply Likes
No good reason why it started that way, but we can't fix it or it will break people's programming. When we start working on a new development cycle, we'll get this standardized across the board.
Photo of fvu

fvu

  • 5 Posts
  • 0 Reply Likes
@Brendan thank you for the quick reply. I understand why you can't change that right away.
Photo of fvu

fvu

  • 5 Posts
  • 0 Reply Likes
@Brendan apparently the format was changed yesterday, but all of a sudden the values are rendered as integers?

"wind_degrees":10,
"wind_mph":13,
"wind_gust_mph":0,
"wind_kph":20,