Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change (de)serialization formats #89

Open
vyacheslav-pushkin opened this issue Jan 31, 2020 · 0 comments
Open

Change (de)serialization formats #89

vyacheslav-pushkin opened this issue Jan 31, 2020 · 0 comments
Assignees

Comments

@vyacheslav-pushkin
Copy link
Contributor

vyacheslav-pushkin commented Jan 31, 2020

Support for big numbers

Currently long and BigDecimal values are serialized as numbers. A JavaScript number is an IEEE 754 64-bit double-precision floating-point format number, which is not enough to safely represent a sufficiently large long or a sufficiently large and/or precise BigDecimal.

For example, an attempt to store Long.MAX_VALUE (9,223,372,036,854,775,807) in a number will result in 9,223,372,036,854,776,000 (maximum value that can be safely represented as a number is 9,007,199,254,740,991).

We might prefer to serialize long and BigDecimal values as strings instead.

Datatype-independent serialization

Currently serialization format depends on datatype. It means that change in datatype format has to be replicated on client side. It might be better if REST API would use standard datatype-agnostic formats for data transfer.

Support for offsets

(Related to cuba-platform/frontend#91)

Currently offset is only supported for OffsetDateTime and OffsetTime. Other temporal types implicitly have server's offset. The server's offset is not known on client side. This may lead to wrong values being displayed/saved if server and client have different offsets.

dateAttr: "2019-11-07",
timeAttr: "20:16:02",
dateTimeAttr: "2019-11-07 20:16:02.613",
localDateAttr: "2019-11-07",
localTimeAttr: "20:16:02",
localDateTimeAttr: "2019-11-07 20:16:02.613",

offsetDateTimeAttr: "2019-11-07 20:16:02.613 +0400",
offsetTimeAttr: "20:16:02 +0400"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants