AppEngine: longinteger values can't be returned as string for some interface combinations #630
Labels
API
This issue or pull request is about API (e.g. unclear API, new API, API change, deprecation)
app:appengine_api
This issue or pull request is about astarte_appengine_api application
minor
This issue causes only minor annoyance to the user
user experience
This issue is about user experience
AppEngine API supports passing some options that control how
longinteger
values are represented in JSON, due to the fact that 64 bit integer values are not theoretically representable using JSON numbers (since they're 64 floating point values, and the mantissa can only represent 52 bits) and some JSON decoders could fail if they encounter integers > 2^52.To prevent that,
longinteger
values are returned as string by default, and it's possible to passallow_bigintegers=true
as query parameters to always render them as integers, orallow_safe_bigintegers
to only render as integers the values which are < 2^52 (see here).Currently though there are two cases where the behaviour is inconsistent: when querying the root of an individual datastream interface and querying the root of an individual properties interface. Both those cases force
longinteger
values to be rendered as integers, and they ignore the passed options.It should be possible to optionally change the current behaviour with query parameters, possibly leaving the current default as-is (even if it's inconsistent with the rest) to avoid API breaking changes.
The text was updated successfully, but these errors were encountered: