Vasileios Chroniadis
01/31/2023, 9:24 PMVasileios Chroniadis
01/31/2023, 9:25 PM{
"name": "John",
"age": 30
}
to
{
"name": "John",
"age": 30,
"car": null
}
kevin.cianfarini
01/31/2023, 9:29 PMCasey Brooks
01/31/2023, 9:30 PM"car"
is null
, if a consumer has as class which does not have a car
property and ignoreUnknownKeys
is false
, the new JSON response would throw an errorCasey Brooks
01/31/2023, 9:32 PMcar
is nullablekevin.cianfarini
01/31/2023, 9:33 PMignoreUnkownKeys
would play into this. I think for most other deserializing clients (eg. the general question) this would be backwards compatible.ephemient
01/31/2023, 9:54 PMVasileios Chroniadis
01/31/2023, 9:59 PMkevin.cianfarini
01/31/2023, 10:04 PMkevin.cianfarini
01/31/2023, 10:04 PMCasey Brooks
01/31/2023, 10:10 PMignoreUnkownKeys: true
and isLenient: true
whenever Iām not using the same models on the server, because 3rd party servers are the wild west and always end up sending stuff in production that I didnāt expect.kevin.cianfarini
01/31/2023, 10:13 PMIt might not be the āstandardā to be so strict, but consider that, unlike most serialization libraries, this one is designed so that you use the same serialization models on both the server and client.This doesnāt matter when youāre deploying applications to an app store where you have no control over when your clients are actually updated unfortunately.
kevin.cianfarini
01/31/2023, 10:14 PMVasileios Chroniadis
01/31/2023, 10:14 PMCasey Brooks
01/31/2023, 10:16 PMkevin.cianfarini
01/31/2023, 10:16 PMkevin.cianfarini
01/31/2023, 10:16 PMephemient
01/31/2023, 10:18 PMignoreUnknownKeys=false
confuse me, especially since kotlinx.serialization.protobuf has its behavior default to the equivalent of true
(as is the expectation for that format)kevin.cianfarini
01/31/2023, 10:19 PMEmil Kantis
01/31/2023, 10:21 PMVasileios Chroniadis
01/31/2023, 10:22 PMkevin.cianfarini
01/31/2023, 10:23 PMCasey Brooks
01/31/2023, 10:31 PMcar
property in its model
2) Deploy to the app stores
3) Wait 2 weeks for 80% of your apps to be updated
4) Deploy the not-backward-compatible server changes to production
5) 20% of your users start complaining about crashes
6) customer service tells everyone to just update their apps
7) folks still donāt update their appskevin.cianfarini
01/31/2023, 10:31 PMignoreUnknownKeys
to true and communicate expectations to your backend devsCasey Brooks
01/31/2023, 10:31 PMignoreUnknownKeys
is true the next time you release, and hopefully donāt have to worry about this as muchVasileios Chroniadis
01/31/2023, 10:31 PMephemient
01/31/2023, 10:32 PMephemient
01/31/2023, 10:33 PMVasileios Chroniadis
01/31/2023, 10:34 PMkevin.cianfarini
01/31/2023, 10:34 PMkevin.cianfarini
01/31/2023, 10:37 PMVasileios Chroniadis
01/31/2023, 10:38 PMkevin.cianfarini
01/31/2023, 10:41 PMephemient
01/31/2023, 10:41 PMkevin.cianfarini
01/31/2023, 10:41 PMkevin.cianfarini
01/31/2023, 10:42 PMephemient
01/31/2023, 10:42 PMCasey Brooks
01/31/2023, 10:43 PMkevin.cianfarini
01/31/2023, 10:43 PMkevin.cianfarini
01/31/2023, 10:43 PMephemient
01/31/2023, 10:44 PMephemient
01/31/2023, 10:44 PMkevin.cianfarini
01/31/2023, 10:45 PMephemient
01/31/2023, 10:45 PMkevin.cianfarini
01/31/2023, 10:45 PMCasey Brooks
01/31/2023, 10:45 PMBigInteger
does under the hood)kevin.cianfarini
01/31/2023, 10:46 PMkevin.cianfarini
01/31/2023, 10:46 PMkevin.cianfarini
01/31/2023, 10:46 PMWatt Hours
hereephemient
01/31/2023, 10:46 PMephemient
01/31/2023, 10:46 PMkevin.cianfarini
01/31/2023, 10:47 PMVasileios Chroniadis
01/31/2023, 10:47 PMCasey Brooks
01/31/2023, 10:47 PMkevin.cianfarini
01/31/2023, 10:48 PMephemient
01/31/2023, 10:48 PMkevin.cianfarini
01/31/2023, 10:49 PMephemient
01/31/2023, 10:49 PMephemient
01/31/2023, 10:53 PMkevin.cianfarini
01/31/2023, 10:53 PMcenterpoint of all money representationsFor example, we recently had a prod bug regarding eastern arabic numerals. Thereās also some weird stuff with bulgarian where they culturally donāt include a
,
as a grouping separator but only when dealing with money. If itās normal numbers they do. So strange.Casey Brooks
01/31/2023, 10:55 PM,
instead of .
for the decimal portion of the USDephemient
01/31/2023, 10:55 PMkevin.cianfarini
01/31/2023, 10:56 PMCasey Brooks
01/31/2023, 10:57 PMkevin.cianfarini
01/31/2023, 10:57 PMkevin.cianfarini
01/31/2023, 10:57 PMephemient
01/31/2023, 11:02 PMkevin.cianfarini
01/31/2023, 11:03 PMpdvrieze
02/01/2023, 2:24 PMignoreUnknownKeys
is simple API compatibility. This key was introduced later (per user demand), but allowing the default behavior to change would break the expectations of many existing users. As such it is stuck to false
until there is some reason to have an API incompatible change.ephemient
02/01/2023, 3:56 PMJson.ignoreUnknownKeys
pre-1.0? there already was a bunch of API-incompatible changes for 1.0