endocrimes/Jay

Can't parse exponents that starts with zero

ikhsan opened this issue · 0 comments

The API that I consume (sinatra app) has numbers with exponent like this one: 6.8e-05. I don't think this is required by the current RFC4627 spec but I think this will make Jay (and Vapor) more compatible with other API services in the wild.

// this will fail
let data = "{ \"number\" : 6.8e-05 }".chars()
_ = try Jay().jsonFromData(data)

I can confirm that JS console and JSONSerialization support it.