12/30/2023 0 Comments Kotlin do if not null![]() They are all equally good default values. The reason I'm asking it that the specific value of the default is opaque to Kotlin Serialization. There will be a big benefit(at least save network bandwidth) from the feature especially if there are high-frequency API requests from clients daily. For client, these null properties totally can be ignored, but client doesn't know the default non-null values, so all non-null properties, include non-null default, should be encoded. Maybe there are lots of properties in a data model, but most properties usually are null. ktor) provides API, send json response to client(eg. Yes, the expect feature is: non-null should be encoded, null should not be encoded, not considering they are default or not.ĭo you have a lot of those "non-null must be encoded" default in your data model? How you have a situation where where null defaults should not be encoded, but non-null default still should be encoded? Yes, can you, please, give a bit more concrete example on what kind of problem this creates in your particular domain? = false remove all keys which have default value include non-null, as following:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |