News for hackers. Stuff that matters.
Re:Best practices for REST API design (2020) by Kwpolska on Monday February 22, 2021 @05:23PM (#26231491)
In languages with reasonable number types (i.e. not JS), the parsers are typically able to produce integers, or even BigDecimal, out of a JSON number, without going through double.
Re:Best practices for REST API design (2020) by e12e on Tuesday February 23, 2021 @05:05AM (#26235570)
I guess I feel returning error invalid integer for a valid json double is a bit wierd - but I guess it's not technicallyaany worse than "could not parse string as integer. It's more that it is expected that strings hold" other" data, like timestamps, while one might expect a double to hold only (but also any) doubles.