local-kms icon indicating copy to clipboard operation
local-kms copied to clipboard

ScheduleKeyDeletion returns `DeletionDate` in Standard Form

Open nsmithuk opened this issue 6 years ago • 1 comments

On successfully calling ScheduleKeyDeletion, the timestamp in the DeletionDate field returned from AWS is encoded in Scientific Notation/Standard Form. Local KMS returns the value as a standard integer.

For example: AWS returns: 1.5565824E9 Local KMS returns: 1556582400

AWS' SDKs appear to transparently accept either correctly.

There appears no easy way to force Go to output the value as a number, in Scientific Notation. The community conscientious seems to be that as the interpreter should read both numbers identically, thus Go is working as expected.

nsmithuk avatar Apr 22 '19 11:04 nsmithuk

There's always the option of writing a custom MarshalJSON method on a wrapper type, like so: https://play.golang.org/p/3adteafwrAv

The strconv.FormatFloat formatting is also slightly different from the AWS format though, so it's likely to be annoying 😞

andrew-d avatar May 15 '19 03:05 andrew-d