In other news we’re suspecting transactions are on horizon. Half the backend team are in denial, the other half are busy trying to figure out the most pleasant place to install decidedly “unRESTy URLs” for them. Somebody already set themselves on fire over PUT/POST for that.
With offset, ok. As UTC alone, it doesn't work if you need to know the local time when something occurred, like medication administration, especially when the things may occur across time changes like DST.
The endpoint of the viewer may not be in the same local time.
If you go this route you may not care about location beyond this one data point, but have to store another location field each time.
Why? Why not send a number as number (double) and treat it as hostile in the backend? I dislike sending numbers as string because I think the different data types exist for a reason.
Same thing with serial numbers, VIN numbers, building floor numbers, phone numbers, etc. All of those should always be strings, because performing "math" on them wouldn't yield meaningful results.
Why should i send a dimension as a string? How am I going to calculate the volume from 3 strings?
You shouldn't because a dimension is a number. Something 4 feet long is twice as long as something 2 feet long.
So prices are numbers (if supplied in cents, the smallest unit). There is length/depth/height/weight/... A lot of things are actual numbers. Why supply them as string?
I agree partially with you but think ZIP are a very bad example because a zip itself may also contain letters.
Either that or use a different serialization method to communicate.
No one else seems to be complaining about this issue. If JSON doesn't fit your needs, use something else.
what's an ISO date/time?
> JSON.stringify(new Date())
'"2021-02-22T20:34:53.686Z"'That said, "time zone designator" is the formal name of the UTC offset in ISO 8601, and it's reasonable to refer to it as such whenever the distinction is clear.
Send numbers as strings. you should be treating this as hostile in your backend anyways, and checking it.
Send both an error code, and a string in simple english, or whatever your most common developer language is.
If you care about only updating certain fields, track changes and only send those fields to the backend.
These arn't really that hard.